Missing $inserted inside matrix I'm getting "missing$ inserted" (along with a lot of other nearby errors, but that's the first one) on this snippet:

$$(\tilde A-\lambda)^m = \begin{blockarray}{(cccc)} \BAmulticolumn{3}{c}{\multirow{3}{*}{(A-\lambda)^m}} & \multirow{3}{*}{\vdots} \\ & & & & \\ \\ 0 & \dots & 0 & (1-\lambda)^m \end{blockarray} \end{pmatrix}$$


Specifically, it's at the line

\BAmulticolumn{3}{c}{\multirow{3}{*}{(A-\lambda)^m}} & \multirow{3}{*}{\vdots}


Notes:

• I replaced the $$...$$ with $...$. As Werner pointed out, please see Why is $...$ preferable to $$...$$?.
• The $ were required in the option to \multirow as that parameter is assumed to be in text mode. Using the $ ensures that math mode is used.

Code:

\documentclass{article}
\usepackage{amsmath}
\usepackage{blkarray}
\usepackage{multirow}

\begin{document}

$(\tilde A-\lambda)^m = \begin{blockarray}{(cccc)} \BAmulticolumn{3}{c}{\multirow{3}{*}{(A-\lambda)^m}} & \multirow{3}{*}{\vdots} \\ & & & & \\ \\ 0 & \dots & 0 & (1-\lambda)^m \end{blockarray} %\end{pmatrix}$
\end{document}

• Could you explain why \$s are needed in the \multirow? Does the \begin{blockmatrix} break out of math mode? – Jack M Oct 7 '14 at 17:14
• @JackM: Added brief explanation. – Peter Grill Oct 7 '14 at 17:21
• A simple pmatrix will produce the same result.The blkarray environment is designed for block matrices. – Bernard Oct 7 '14 at 17:45

You need neither multirow nor blkarray:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

$(\tilde A-\lambda)^m = \begin{pmatrix} (A-\lambda)^m & \vdots\vphantom{\Bigg|} \\ \begin{matrix}0 & \dots & 0\end{matrix} & (1-\lambda)^m \end{pmatrix}$

\end{document}


• why not just 0 \quad\dots\quad 0 for the first part of the second line, and why is the extra height needed with the \Bigg|? adding an optional space [2\jot] (or even a bit more) would put the extra space only between the lines where it's really wanted. (or am i missing something?) – barbara beeton Oct 7 '14 at 20:38
• @barbarabeeton I wanted to reproduce the same spacing made by pmatrix, so a nested matrix seems best. The space above (A-\lambda)^m is probably meant for making clear that it's a submatrix, rather than a row. – egreg Oct 7 '14 at 20:43