5

How can one have control over the vertical space brought on by a \\ for the new aligned entry in the aligned environment?

For example, how to I condense the following?

$\begin{aligned}
a & b \\
c & d
\end{aligned}$

I am using this through the btex-etex environment in metapost and \begin{group} does not seem to do it!

  • Welcome to TeX.SX! Usually, we don't put a greeting or a “thank you” in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Accepting and upvoting answers is the preferred way here to say “thank you” to users who helped you. A suggestion: Do us a favour and change your username to something more telling than "user1234". – Martin Schröder Apr 25 '14 at 16:24
7

You mean like this?

\documentclass{article}
\usepackage{amsmath}
\begin{document}
  $\begin{aligned}
    a & b \\[-2\jot]  %% or [-1ex] Change 2\jot or -1ex as you like
    c & d
    \end{aligned}
  $
\end{document}

enter image description here

Another method is to add \openup-2\jot just before \begin{aligned} as mentioned by egreg (thanks to him for letting me know this).

\documentclass{article}
\usepackage{amsmath}
\begin{document}
  $ \openup-2\jot
  \begin{aligned}
    a & b \\  
    c & d
    \end{aligned}
  $
\end{document}
| improve this answer | |
  • 2
    Or \openup-2\jot just before \begin{aligned}. – egreg Apr 25 '14 at 17:27
  • 1
    That's a “Plain TeXism”, which happens to work also with amsmath. – egreg Apr 25 '14 at 22:34
2

Another solution with the stackengine package; you can't easily change the vertical spacing, but it has a simpler syntax. This code lets you compare:

\documentclass{article}

 \usepackage{mathtools}
 \usepackage{stackengine} 

 \begin{document}

\verb+\Vectorstack:+\\[-10.3pt]
\mbox{} \hspace{4em}$ \Vectorstack{ab cd} \hspace{4em} \begin{array}{cc}
\verb+With aligned:+ & \verb+Aligned with correction:+\\
 \begin{aligned} a & b \\ c & d \end{aligned} & \begin{aligned} a & b \\[-2\jot] c & d \end{aligned}\\
 \end{array} $

 \end{document} 

enter image description here

| improve this answer | |

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.