Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

A weird mechanism is observed below:

\documentclass{beamer}
\begin{document}
\abovedisplayskip=0ex
\belowdisplayskip=0ex
\frame{\frametitle{Title}
\begin{itemize}
\item text text text text text text text
\begin{equation}
\cos \pi=-1
\end{equation}
text text text text text text text
   \begin{itemize}
   \item text text text text text text text
   \begin{equation}
   \cos \pi=-1
   \end{equation}
   text text text text text text text
   \end{itemize}
\end{itemize}}
\end{document}

enter image description here

the new \abovedisplayskip=0pt seems to be ignored in the second level itemize list. It seems to be related to the fontsize in the lists but is a bit annoying as such.

share|improve this question

2 Answers 2

Every font size changing command resets the skips around math displays. Second level itemize use \small, so you need to change it; also \normalsize and, possibly, other font size changing commands.

\documentclass{beamer}
\usepackage{etoolbox}
\appto\normalsize{%
  \abovedisplayskip=0pt
  \belowdisplayskip=0pt
  \abovedisplayshortskip=0pt
  \belowdisplayshortskip=0pt
}
\appto\small{%
  \abovedisplayskip=0pt
  \belowdisplayskip=0pt
  \abovedisplayshortskip=0pt
  \belowdisplayshortskip=0pt
}
\begin{document}
\begin{frame}
\frametitle{Title}
\begin{itemize}
\item text text text text text text text
\begin{equation}
\cos \pi=-1
\end{equation}
text text text text text text text
   \begin{itemize}
   \item text text text text text text text
   \begin{equation}
   \cos \pi=-1
   \end{equation}
   text text text text text text text
   \end{itemize}
\end{itemize}
\end{frame}
\end{document}

enter image description here

You may want to do it only in selected slides:

\documentclass{beamer}
\usepackage{etoolbox}

\newcommand{\zerodisplayskips}{%
  \abovedisplayskip=0pt
  \belowdisplayskip=0pt
  \abovedisplayshortskip=0pt
  \belowdisplayshortskip=0pt
}
\newcommand{\removedisplayskips}{%
  \appto\normalsize{\zerodisplayskips}
  \appto\small{\zerodisplayskips}
  \zerodisplayskips
}

\begin{document}
\begin{frame}
\frametitle{Title}
\removedisplayskips
\begin{itemize}
\item text text text text text text text
\begin{equation}
\cos \pi=-1
\end{equation}
text text text text text text text
   \begin{itemize}
   \item text text text text text text text
   \begin{equation}
   \cos \pi=-1
   \end{equation}
   text text text text text text text
   \end{itemize}
\end{itemize}
\end{frame}
\end{document}
share|improve this answer
    
Do you think it should be reported as a bug? –  pluton Jun 11 at 0:58
    
@pluton What bug? –  egreg Jun 11 at 8:25
    
The fact that we have to handle displayskips per font size? I know it is not a real bug but it seems a bit annoying here. Maybe the displayskips mechanism should be global and not just per font size. –  pluton Jun 11 at 12:11

Uee

\usepackage{enumitem}

and it should be ok. If it is not possible use:

\makeatletter
\g@addto@macro{\item}{%
  \abovedisplayskip=0ex
  \belowdisplayskip=0ex}
\makeatother

or redefine itemize

share|improve this answer
1  
Thanks. Is there any other possibility? Because enumitem breaks most of my beamer list settings. –  pluton Jun 10 at 20:01
    
see my edit ... It may be possible that you also nee \abovedisplayshortskip and \below... –  Herbert Jun 10 at 20:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.