2

I have the following three equations and would like the space between 1 and 2 to be the same as the space between 2 and 3. Unfortunately, because the first equation has a fraction, the space between them isn't the same. I have tried adding vspace between 2 and 3 but it hasn't worked (i.e. the minimum amount of space added by vspace is too large).

Is there a way to ensure the space between 2 and 3 is the same as between 1 and 2?

Thank you in advance.

\documentclass{article}
\usepackage[utf8]{inputenc}

\title{bla}
\author{Hello}
\date{March 2021}

\begin{document}

\maketitle

\begin{equation}
\frac{P}{A} = e^{i\omega t},
\end{equation}
\begin{equation}
K = e^{i\omega t},
\end{equation}
\begin{equation}
\frac{L}{A} = e^{i\omega t},
\end{equation}

enter image description here

2
  • 1
    You should never place consecutive display environments. Use gather instead of three equation environments. It requires \usepackage{amsmath}. Is there a latex package? I don't think so.
    – egreg
    Mar 11 '21 at 16:25
  • that was a mistake - good spot! How can I ensure the space between equations is the same as between (1) and (2)? thanks again
    – jrjrjr
    Mar 11 '21 at 16:32
1

With \vphantom:

\documentclass{article}
\usepackage[super,comma, sort&compress]{natbib}

\title{bla}
\author{Hello}
\date{March 2021}

\begin{document}

\maketitle

\begin{equation}
\frac{P}{A} = e^{i\omega t},
\end{equation}
\begin{equation}
\vphantom{\frac{K}{A}}K = e^{i\omega t},
\end{equation}
\begin{equation}
\frac{L}{A} = e^{i\omega t},
\end{equation}

\end{document} 

enter image description here

2
  • thanks! that worked
    – jrjrjr
    Mar 11 '21 at 16:43
  • 1
    @jrjrjr it makes the spacing look equal here but consecutive equation environments are always wrong and will produce spurious empty paragraphs and bad spacing and bad page breaks. Mar 11 '21 at 17:44
4

There should never be consecutive displays. Use amsmath.

Here's how you can make the spacing even, but the final choice may depend on the actual formulas, so it's best to cope with these problems only when you're sure that the text is in final form.

\documentclass{article}
\usepackage{amsmath}

\title{bla}
\author{Hello}
\date{March 2021}

\begin{document}

\maketitle

\section{First attempt}

This is the first attempt, let's see what happens
\begin{gather}
\frac{P}{A} = e^{i\omega t},
\\
K = e^{i\omega t},
\\
\frac{L}{A} = e^{i\omega t},
\end{gather}

\section{Second attempt}

This is the second attempt, with a phantom;
leave this to the final revision of the
document, when no more changes to the text
are likely
\begin{gather}
\frac{P}{A} = e^{i\omega t},
\\
K = e^{i\omega t}, \vphantom{\frac{P}{A}}
\\
\frac{L}{A} = e^{i\omega t},
\end{gather}

\end{document}

enter image description here

Depending on the actual formulas, you might also consider align instead of gather.

2
  • thanks for your comment. Is it possible to label each equation separately using the 1st attempt? i.e. using \label{}
    – jrjrjr
    Mar 11 '21 at 23:21
  • 1
    @jrjrjr Add a \label next to the equations.
    – egreg
    Mar 12 '21 at 7:37

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.