3

I try to align a multiline equation, but im getting a large space.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{mathtools}
\begin{document}


\begin{align}
AAAAAA &\,  yyyyy &=& bbbbbb    \\
A    &\,     y  &=&    b  \notag
\end{align}
\end{document}

I would like the letters in the second line to be in the center of the above.

EDIT:

The first line stands for a Matrix equation. With Micos solution i now got:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
\begin{array}[t]{c @{\,} c @{{}={}} c}
 \begin{pmatrix}
  1 & 0  \\
  0 & 1  \\
  0 & 0 \\
\end{pmatrix} & 
\begin{pmatrix}
  x\\
  y\\
\end{pmatrix} & 
\begin{pmatrix}
  x\\
  y \\  
  0\\
\end{pmatrix} \\
A      & x     & d      \\
\end{array}
\end{equation}


\end{document}
4
  • for example the single letter 'A' in the second line should be center to 'AAAAA' from the first line. Commented Nov 6, 2014 at 16:35
  • Welcome to TeX.SE! Have you looked into using an array environment?
    – Mico
    Commented Nov 6, 2014 at 16:35
  • no i havent, but thats not a math environment, right Commented Nov 6, 2014 at 16:41
  • Actually, array is very much the math-mode equivalent of tabular.
    – Mico
    Commented Nov 6, 2014 at 16:46

1 Answer 1

4

You could try:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{mathtools}
\begin{document}
\begin{equation}
\begin{array}[t]{c @{\,} c @{{}={}} c}
AAAAAA & yyyyy & bbbbbb \\
A      & y     & b      \\
\end{array}
\end{equation}
\end{document}

Addendum, to address the OP's follow-up query: To typeset the two versions of the matrix equation you've added to your initial query, I would use nearly the same code as given above, with the exception that I would replace @{\,} with @{} as the separator between the first and second column of the array. This is because, in my not-so-humble opinion..., the spacing between matrix-like environment provided by the amsmath package (which provides the pmatrix environments) is a bit excessive, especially so for the case at hand. (If you do want the default spacing of the amsmath package, just keep the @{\,} inter-column specification as per the initial answer.)

enter image description here

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{mathtools}
\begin{document}
\begin{equation}
\begin{array}[t]{c @{} c @{{}={}} c}
  \begin{pmatrix}
    1 & 0  \\
    0 & 1  \\
    0 & 0 \\
  \end{pmatrix} & 
  \begin{pmatrix}
    x\\
    y\\
  \end{pmatrix} & 
  \begin{pmatrix}
    x\\
    y \\  
    0\\
  \end{pmatrix} \\[4ex]
  A & x & d\\
\end{array}
\end{equation}
\end{document}
3
  • Of course mathtools is not necessary.
    – egreg
    Commented Nov 6, 2014 at 16:46
  • thank you, that looks good. how can i change the vspace between first and second line? Commented Nov 6, 2014 at 16:56
  • @ArthurSpooner - I've provided an addendum to my answer to address your follow-up query about typesetting a more realistic set of equations.
    – Mico
    Commented Nov 6, 2014 at 18:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .