我发现了一个非常整洁的beamer
主题(Arguelles
,https://github.com/piazzai/arguelles) 但我认为这个主题有三个问题。我正在努力改进它们,但我发现自己在课堂上beamer
和LaTeX
总体上缺乏所需的知识。任何帮助都将不胜感激。
这个问题涉及包的使用enumitem
。主题加载enumitem
,这是一个很棒的包,我用它来写文章,但不建议使用beamer
(无法将 enumitem 与 beamer 结合)。我发现我可以通过注释掉 的第 49 行来避免这个问题,这样beamerthemeArguelles.sty
就不会加载enumitem
,并注释掉 的第 46-55 行beamerinnerthemeArguelles.sty
。但是,这会丢失主题的列表和描述样式。有没有什么想法可以将 46-55 行重写成beamer
可以使用的内容?
答案1
您可以itemize (sub(sub))item
像这样调整模板以使用与 Arguelles 相同的符号:
\documentclass{beamer}
\usetheme{Arguelles}
\setbeamertemplate{itemize item}{$\bullet$}
\setbeamertemplate{itemize subitem}{$\circ$}
\setbeamertemplate{itemize subsubitem}{$\cdot$}
\AtBeginEnvironment{itemize}{
\setlength{\leftmargini}{0.4cm}
\setlength{\leftmarginii}{0.4cm}
\setlength{\leftmarginiii}{0.4cm}
}
\AtBeginEnvironment{enumerate}{
\setlength{\leftmargini}{0.5cm}
\setlength{\leftmarginii}{0.6cm}
\setlength{\leftmarginiii}{0.8cm}
}
\begin{document}
\begin{frame}
why does this theme colour the first frame even if there is no title page?
\end{frame}
\begin{frame}
\frametitle{A frame with title and subtitle}
\framesubtitle{Subtitle here}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua \par
Itemized list:
\begin{itemize}
\item Lorem ipsum
\item Dolor sit amet
\begin{itemize}
\item Consectetur
\item Adipiscing elit
\end{itemize}
\item Sed do eiusmod
\begin{itemize}
\item Tempor incididunt
\begin{itemize}
\item Ut labore et dolore
\item Magna aliqua
\end{itemize}
\end{itemize}
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{A frame with title and subtitle}
\framesubtitle{Subtitle here}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua \par
Itemized list:
\begin{enumerate}
\item Lorem ipsum
\item Dolor sit amet
\begin{enumerate}
\item Consectetur
\item Adipiscing elit
\end{enumerate}
\item Sed do eiusmod
\begin{enumerate}
\item Tempor incididunt
\begin{enumerate}
\item Ut labore et dolore
\item Magna aliqua
\end{enumerate}
\end{enumerate}
\end{enumerate}
\end{frame}
\end{document}
答案2
最后,这是beamerinnerthemeArguelles.sty
使用包最好地复制结果的代码(替换了 的第 46-55 行)enumitem
。它需要包xpatch
。在环境处理方面仍然存在一些差异description
,但希望itemize
和enumerate
环境看起来忠实于原始主题。
\setbeamertemplate{itemize item}{$\bullet$}
\setbeamertemplate{itemize subitem}{$\circ$}
\setbeamertemplate{itemize subsubitem}{$\cdot$}
\setbeamertemplate{enumerate item}[default]
\setbeamertemplate{enumerate subitem}{\theenumi.\theenumii.}
\setbeamertemplate{enumerate subsubitem}{\theenumi.\theenumii.\theenumiii.}
\setbeamertemplate{description item}{\normalfont\itshape\insertdescriptionitem}
\AtBeginEnvironment{itemize}{
\settowidth{\leftmargini}{\usebeamertemplate{itemize item}}
\addtolength{\leftmargini}{\labelsep}
\settowidth{\leftmarginii}{\usebeamertemplate{itemize subitem}}
\addtolength{\leftmarginii}{\labelsep}
\settowidth{\leftmarginiii}{\usebeamertemplate{itemize subsubitem}}
\addtolength{\leftmarginiii}{\labelsep}
}
\xpatchcmd{\itemize}
{\def\makelabel}
{\ifnum\@itemdepth=1\relax
\setlength\itemsep{0em}% separation for first level
\else
\ifnum\@itemdepth=2\relax
\vspace{-0.5em}
\setlength\itemsep{-0.5em}% separation for second level
\else
\vspace{-0.5em}
\ifnum\@itemdepth=3\relax
\setlength\itemsep{-.5em}% separation for third level
\fi\fi\fi\def\makelabel
}
{}
{}
\xpatchcmd{\beamer@enum@}
{\def\makelabel}
{\ifnum\@itemdepth=1\relax
\setlength\itemsep{0em}% separation for first level
\else
\ifnum\@itemdepth=2\relax
\vspace{-0.5em}
\setlength\itemsep{-0.5em}% separation for second level
\else
\vspace{-0.5em}
\ifnum\@itemdepth=3\relax
\setlength\itemsep{-.5em}% separation for third level
\fi\fi\fi\def\makelabel
}
{}
{}