17

Consider the following code:

\begin{align}
f_1(x) &= \frac{15x}{3} \\
f_2(x) &= 3x + 5 \\
f_3(x) &= 4x + 13
\end{align}

This produces three lines where the first line takes up more vertical space than the others. Is there any way to make all the lines take the same vertical space (meaning effectively all lines take as much vertical space as the largest one)?

14

I don't know of an automatic way to do this, but in a particular case, you can use \vphantom to effect this.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
f_1(x) &= \frac{15x}{3} \\
f_2(x) &= \vphantom{\frac11}3x + 5 \\
f_3(x) &= \vphantom{\frac11}4x + 13
\end{align}
\end{document}

alt text

| improve this answer | |
14

if you do not want it globally changed put the complete formula into {...}

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

\savebox\strutbox{$\vphantom{\dfrac11}$}
\begin{align}
  f_1(x) &= \frac{15x}{3} \\
  f_2(x) &= 3x + 5 \\
  f_3(x) &= 4x + 13
\end{align}

\end{document}
| improve this answer | |
  • Despite the additional white space below the display, this is definitely most elegant. – Hendrik Vogt Jan 17 '11 at 14:28
  • Beautiful! How exactly does it work? – mavzolej Nov 20 '18 at 17:33
  • \vphantom{...} defines box of width zero and height nof its contents. Which is the height of a fraction "1/1". \strutbox is used by align for every row. – user2478 Nov 20 '18 at 18:38
4

I can offer a variant of TH's answer that produces a bit less vertical space, but it is adjusted to your particular situation: Only the second line needs a bit of additional depth. The advantage of this more special adjustment is that it doesn't produce additional white space below the display.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
Here's some text just to fill the line sufficiently
\begin{align}
f_1(x) &= \frac{15x}{3} \\
f_2(x) &= 3x + 5 \vphantom{\smash[t]{\frac11}} \\
f_3(x) &= 4x + 13
\end{align}
Here's some text just to fill the line sufficiently
\end{document}

| 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.