Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you make parentheses match height when they're split between lines in LaTeX math?

Consider the following example

\begin{equation}
    \begin{split}
        f = & \left( \frac{a}{b} + \right. \\
                   & \left. c \right) + d 
    \end{split}
\end{equation}

In the result, the left parenthesis on the first line is very large, because of the fraction inside. In the second line, since there is no fraction, the parenthesis is small.

How can I make the one on the second line match the one on the first line in height?

like image 511
cheshirekow Avatar asked Jan 02 '10 06:01

cheshirekow


2 Answers

You should use \vphantom, it makes a vertical space equal to its argument and no horizontal space:

\begin{equation}
    \begin{split}
        f = & \left( \frac{a}{b} + \right. \\
                   & \left. \vphantom{\frac{a}{b}} c \right) + d 
    \end{split}
\end{equation}

(I recommend \vphantom over \phantom in this case because \phantom adds horizontal space that you don't need.)

For a lot of great advice on typesetting mathematics, have a look at Math mode by Herbert Voß.

like image 123
Alok Singhal Avatar answered Oct 10 '22 20:10

Alok Singhal


Oh. It's the \phantom{} command

\begin{equation}
    \begin{split}
        f = & \left( \frac{a}{b} + \right. \\
                   & \left. \phantom{\frac{a}{b}} c \right) + d 
    \end{split}
\end{equation}
like image 43
cheshirekow Avatar answered Oct 10 '22 20:10

cheshirekow