1

How to typeset the two matrices which are labeled with (1) and (2) on the same line, as shown below? I tried

  1. Placing align, pmatrix inside a minipage environment, but then the two matrices are in two different lines.
  2. Placing two pmatrix in a single equation environment, but then the labels "(1)" and "(2)" are not aligned correctly -- they are center aligned instead of top aligned as desired.

I guess I will need some manual box settings to get desired outputs, but it's beyond my knowledge. enter image description here

The code I am currently using now is pasted below:

 $$(1)\; A = \begin{pmatrix*}[r]
        1 & -3 & 4 \\
        4 & -7 & 8 \\
        6 & -7 & 7 
    \end{pmatrix*}; \quad (2)\; A = \begin{pmatrix*}[r]
        0 & -2 & 3 & 2 \\
        1 & 1 & -1 & -1 \\
        0 & 0 & 2 & 0 \\
        1 & -1 & 0 & 1
    \end{pmatrix*}.$$
  • 2
    It is very easy, e.g. with a \vphantom, but not many want to punch in the matrices from scratch. Please post the code that produces the above output. – user194703 Jun 12 at 2:24
  • @Schrödinger'scat Thanks, I have edited my question. – Zhanxiong Jun 12 at 2:30
4

Maybe something like this?

\documentclass{article}
\usepackage{mathtools}
\begin{document}
\[ \newcommand{\FirstMat}{\begin{pmatrix*}[r]
        1 & -3 & 4 \\
        4 & -7 & 8 \\
        6 & -7 & 7 
    \end{pmatrix*}}
\begin{array}{c}
(1) \\ \vphantom{\FirstMat}\\
\end{array} 
\begin{array}{c}
A =\FirstMat\;,\\
    \vphantom{X}\\
\end{array} 
\quad    
\begin{array}{c}
(2) \\ \vphantom{\FirstMat}\\
\end{array} 
\begin{array}{c}
A = \begin{pmatrix*}[r]
        0 & -2 & 3 & 2 \\
        1 & 1 & -1 & -1 \\
        0 & 0 & 2 & 0 \\
        1 & -1 & 0 & 1
    \end{pmatrix*}\;.\\
\end{array}    
\]
\end{document}

enter image description here

| improve this answer | |
  • 2
    Great technique! Learned something very useful. – Zhanxiong Jun 12 at 3:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.