我正在尝试消除 Beamer 演示文稿中 gather/align 环境周围的间距。像往常一样,我用 将abovedisplayskip
& friends 寄存器设置为零\g@addto@macro\normalsize
。这很有效(取消注释 lua-visual-debug 以在 LuaLaTeX 中显示调试行):
\documentclass[xcolor=dvipsnames,compress,9pt]{beamer}
\usepackage{amsmath}
%\usepackage{lua-visual-debug}
\mode<presentation>
\usenavigationsymbolstemplate{}
\setlength{\parskip}{0.2cm plus 1fill}
\global\parskip=\parskip
\makeatletter
\g@addto@macro\normalsize{%
\setlength\abovedisplayskip{0cm plus 0cm minus 0cm}
\setlength\belowdisplayskip{0cm plus 0cm minus 0cm}
\setlength\abovedisplayshortskip{0cm plus 0cm minus 0cm}
\setlength\belowdisplayshortskip{0cm plus 0cm minus 0cm}
}
\define@key{beamerframe}{c}[true]{% centered
\beamer@frametopskip=0pt plus 1fill
\beamer@framebottomskip=0pt plus 1fill%
\beamer@frametopskipautobreak=0pt plus .4\paperheight\relax%
\beamer@framebottomskipautobreak=0pt plus .6\paperheight\relax%
\def\beamer@initfirstlineunskip{}%
}
\makeatother
\begin{document}
\begin{frame}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus
elit,
vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida
mauris.
\par
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit,
vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida
mauris.
\par
\begin{gather*}
x^2+y^2=z^2
\end{gather*}
\par
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit,
vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida
mauris.
\end{frame}
\end{document}
到目前为止,一切都很好!
出乎意料的是,如果我设置 Beamer 颜色,就会引入额外的空间math text
:
\documentclass[xcolor=dvipsnames,compress,9pt]{beamer}
\usepackage{amsmath}
%\usepackage{lua-visual-debug}
\mode<presentation>
\usenavigationsymbolstemplate{}
\setlength{\parskip}{0.2cm plus 1fill}
\global\parskip=\parskip
\makeatletter
\g@addto@macro\normalsize{%
\setlength\abovedisplayskip{0cm plus 0cm minus 0cm}
\setlength\belowdisplayskip{0cm plus 0cm minus 0cm}
\setlength\abovedisplayshortskip{0cm plus 0cm minus 0cm}
\setlength\belowdisplayshortskip{0cm plus 0cm minus 0cm}
}
\define@key{beamerframe}{c}[true]{% centered
\beamer@frametopskip=0pt plus 1fill
\beamer@framebottomskip=0pt plus 1fill%
\beamer@frametopskipautobreak=0pt plus .4\paperheight\relax%
\beamer@framebottomskipautobreak=0pt plus .6\paperheight\relax%
\def\beamer@initfirstlineunskip{}%
}
\makeatother
\setbeamercolor{math text}{fg=red} %%% HERE!
\begin{document}
\begin{frame}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus
elit,
vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida
mauris.
\par
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit,
vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida
mauris.
\par
\begin{gather*}
x^2+y^2=z^2
\end{gather*}
\par
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut purus elit,
vestibulum ut, placerat ac, adipiscing vitae, felis. Curabitur dictum gravida
mauris.
\end{frame}
\end{document}
有什么方法可以让我使用该功能而不丢失我喜爱的间距配置?我的猜测是,当启动数学模式时,Beagle 的数学格式模板会被触发,并且&math text
的值会被重置。abovedisplayskip