4

I found one similar thread here (Removing strange vertical space after first (customized) \item), but I still could not resolve my problem. Please help.

Description of the problem:

  1. I used beamer class.

  2. In a frame, in itemize environment, if the text after the first \item is short, then the numbered equations are placed equidistantly in vertical direction. Up till now, no problem.

  3. However, if the text after the first \item is long, then the spacing of numbered equations are off. The vertical space after the first equation is unintendedly larger than that between the second and third equations.

Here is the MWE:

\documentclass{beamer}
\usetheme{Frankfurt}

\begin{document}

\begin{frame}
\begin{itemize}
\item blah
\begin{equation}
a=b
\end{equation}
\begin{equation}
b=c
\end{equation}
\begin{equation}
c=d
\end{equation}
\end{itemize}
\end{frame}


\begin{frame}
\begin{itemize}
\item blah blah blah blah blah blah blah blah blah blah:
\begin{equation}
a=b
\end{equation}
\begin{equation}
b=c
\end{equation}
\begin{equation}
c=d
\end{equation}
\end{itemize}
\end{frame}

\end{document}

Your help is appreciated!

6

You should never stack math display environments; instead of consecutive equation environments use gather:

\documentclass{beamer}
\usetheme{Frankfurt}

\begin{document}

\begin{frame}
\begin{itemize}
\item blah
\begin{gather}
a=b\\
b=c\\
c=d
\end{gather}
\end{itemize}
\end{frame}


\begin{frame}
\begin{itemize}
\item blah blah blah blah blah blah blah blah blah blah:
\begin{gather}
a=b\\
b=c\\
c=d
\end{gather}
\end{itemize}
\end{frame}

\end{document}

enter image description here

If you want to color math, the correct procedure is to add

\setbeamercolor{math text displayed}{fg=magenta}
\setbeamercolor{math text inlined}{fg=blue}

before \begin{document}. Acting on \everymath or \everydisplay doesn't guarantee correct results.

  • In using gather environment, I could not colour (automatically) the math expressions and equations anymore with: \everymath{\color{blue}} and \everydisplay{\color{magenta}}. How to solve this problem? – Thanh Nguyen Oct 21 '14 at 17:16
  • @ThanhNguyen I added the way to get colors in math – egreg Oct 21 '14 at 17:53
  • Yes, I am searching for the answer. This problem is often met problem and the answer should be somewhere in this website. – Thanh Nguyen Oct 21 '14 at 17:55
  • @ThanhNguyen The two lines of code I added are the answer you're looking for. – egreg Oct 21 '14 at 17:59
  • Great! But there is still one thing that I would like to ask: With your added solution, the number of the equations in gather environment is also coloured in magenta. Could it be coloured in different colour? – Thanh Nguyen Oct 21 '14 at 18:03

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.