2

in the code below I'd like the elements in each of the rows to be aligned with the corresponding elements in the other rows and the inside brackets in each row to be aligned with the corresponding brackets in other rows yet to adjust size depending on their contents.

Thanks!

\documentclass{amsart}


\begin{document}

\begin{gather}
 \begin{bmatrix}
  a  \begin{bmatrix} b & a_{long} f_{ormula} \end{bmatrix}\\
  c_d  \begin{bmatrix} \dfrac{e}{f} & g \end{bmatrix}
 \end{bmatrix}
\end{gather}
I want $e/f$ aligned with $b$ and $g$ with $a_{long} f_{ormula} $ and the inside brackets to be both aligned with the corresponding brackets in other rows and to adjust to their contents.  What is the easiest way of doing this?
\end{document}
JPi
  • 13,595
  • Do you mean a & and c_d & to change to second column? – Sigur Jan 24 '15 at 21:31
  • I don't know what your question is, but no. I want a to multiply a row vector and c_d to multiply a row vector and both of these row vectors to have elements that are aligned and ditto for the brackets surrounding them. – JPi Jan 24 '15 at 21:33

1 Answers1

3

I'd set the inner-matrix as a "pseudo-matrix" where you specify the brackets using amsmath's \bigl/\bigr constructions. It allows you the break them across the cell boundary but also to maintain a structure-wide columnar alignment:

enter image description here

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\[
  \left[\begin{array}{c r @{} c c @{} l}
      a   & \bigl[ & bcdefgh &   ijk    & \bigr] \\
    lmnop & \bigl[ &   qr    & stuvwxyz & \bigr]
  \end{array}\right]
\]

\end{document}

Above I've used an outer array, but you could also use a bmatrix. The spacing between the inner "pseudo-matrix" brackets have been removed using a @{} column specification - one advantage of using a pure array implementation.

Werner
  • 603,163