I have a little problem with nested arrays.
The following examples give the correct matrix after a Latex=>PDF run but generate LaTeX errors ! missing $ inserted. <inserted text>, that I would like to get rid of.
Any idea about the problem?
First Example:
\begin{equation}
g_{22}=\left[\begin{array}{ccc}\fbox{\begin{array}{ccc}\frac{1}{E-E_1^1} & & \\ & \ddots & \\ & & \frac{1}{E-E_1^N}\end{array}} & & \\ & \ddots & \\ & & \fbox{\begin{array}{ccc} \frac{1}{E-E_n^1} & & \\ & \ddots & \\ & & \frac{1}{E-E_n^N}\end{array}}\end{array}\right]
\end{equation}
Second example:
\begin{equation}
H=\left[\begin{array}{cc}H_{N-n}&\begin{array}{cl}B\qquad & 0 \end{array}\\ \begin{array}{c}B^{\dag}\\ 0 \end{array} & \fbox{\begin{array}{cc}H_{n}&\quad S\\S^{\dag}&\quad\hsub\end{array}}\end{array}\right]
\end{equation}
