在 Lyx beamer 环境中,enumerate
编译不正确:球覆盖了项目文本的首字母,数字位于球的左侧(并且不可见,因为它们是白色的——通过改变颜色确认)。当我的序言仅包含时,不会发生这种情况,\usetheme{Madrid}
但当我添加我发现的减少显示方程之间空间的代码时,就会发生这种情况。我不知道还有其他方法可以全局减少显示方程之间的空间。
任何提示将非常感谢。
以下是我的 Lyx 文档中生成该图像的代码:
#LyX 2.0 created this file.
\lyxformat 413
\begin_document
\begin_header
\textclass beamer
\begin_preamble
\usetheme{Madrid}
% Code to reduce space between displayed equations
\g@addto@macro\normalsize{%
\setlength\abovedisplayskip{2pt}
\setlength\belowdisplayskip{2pt}
\setlength\abovedisplayshortskip{2pt}
\setlength\belowdisplayshortskip{2pt}
}
\end_preamble
\use_default_options true
\maintain_unincluded_children false
\language english
\language_package default
\inputencoding auto
\fontencoding global
\font_roman default
\font_sans default
\font_typewriter default
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100
\font_tt_scale 100
\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize default
\spacing single
\use_hyperref false
\papersize default
\use_geometry true
\use_amsmath 1
\use_esint 1
\use_mhchem 1
\use_mathdots 1
\cite_engine basic
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\use_refstyle 1
\index Index
\shortcut idx
\color #008000
\end_index
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\paragraph_indentation default
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\end_header
\begin_body
\begin_layout BeginFrame
Testing
\end_layout
\begin_layout Enumerate
Elephant
\end_layout
\begin_layout Enumerate
Zebra
\end_layout
\begin_layout Enumerate
Jaguar
\end_layout
\begin_layout Standard
Want less space between display equations
\begin_inset Formula
\[
y=a+bx
\]
\end_inset
\end_layout
\begin_layout Standard
and
\end_layout
\begin_layout Standard
\begin_inset Formula
\[
z=d+rw
\]
\end_inset
\end_layout
\begin_layout Standard
ending here.
\end_layout
\begin_layout EndFrame
\end_layout
\end_body
\end_document
答案1
这发生在包含减少空间的代码的等效普通 LaTeX 文档中:
\documentclass{beamer}
\usetheme{Madrid}
\makeatletter
\g@addto@macro\normalsize{%
\setlength\abovedisplayskip{2pt}
\setlength\belowdisplayskip{2pt}
\setlength\abovedisplayshortskip{2pt}
\setlength\belowdisplayshortskip{2pt}
}
\makeatother
\begin{document}
\begin{frame}
\frametitle{Testing}
\begin{enumerate}
\item Elephant
\item Zebra
\item Jaguar
\end{enumerate}
Want less space between display equations
\[
y=a+bx
\]
and
\[
z=d+rw
\]
ending here.
\end{frame}
\end{document}
错误的位置是由于您的 文件中行尾的虚假空格造成的\g@addto@macro
。您应该按如下方式注释掉每行的末尾:
\makeatletter
\g@addto@macro\normalsize{%
\setlength\abovedisplayskip{2pt}%
\setlength\belowdisplayskip{2pt}%
\setlength\abovedisplayshortskip{2pt}%
\setlength\belowdisplayshortskip{2pt}%
}
\makeatother
然后这将修复您的输出:
\documentclass{beamer}
\usetheme{Madrid}
\makeatletter
\g@addto@macro\normalsize{%
\setlength\abovedisplayskip{2pt}%
\setlength\belowdisplayskip{2pt}%
\setlength\abovedisplayshortskip{2pt}%
\setlength\belowdisplayshortskip{2pt}%
}
\makeatother
\begin{document}
\begin{frame}
\frametitle{Testing}
\begin{enumerate}
\item Elephant
\item Zebra
\item Jaguar
\end{enumerate}
Want less space between display equations
\[
y=a+bx
\]
and
\[
z=d+rw
\]
ending here.
\end{frame}
\end{document}
如果没有注释字符,每次调用都会\normalsize
插入四个空格(每个换行符一个)。当项目符号项调用时,\normalsize
会在标签前插入空格,将其向右移动,从而使它们与项目文本重叠。
看行末百分号(%)有什么用?有关行尾百分号的讨论。