鉴于以下 Beamer 演示文稿,我如何才能强制 (pdf)LaTeX 将 \partpage 放在偶数页上?我最初认为确定您所在的是奇数页还是偶数页可能是一个很好的起点,但无济于事:
\checkoddpage
\ifoddpage
\frame{intentionally left blank}
\frame{\partpage}
\else
\frame{\partpage}
\fi
这是我的 MWE:
\documentclass{beamer}
%% Show page number
\addtobeamertemplate{navigation symbols}{}{%
\usebeamerfont{footline}%
\usebeamercolor[fg]{footline}%
\vspace{0.5em}%
\hspace{1em}%
\insertframenumber/\inserttotalframenumber
}
\begin{document}
\part{Part 1}
\frame{\partpage}
\frame{1.1}
\part{Part 2}
\frame{\partpage}
\frame{2.1}
\part{Part 3}
\frame{\partpage}
\frame{3.1}
\end{document}
答案1
您可以使用以下方法实现此目的\ifthenelse{condition}{one command}{another command}
\documentclass{beamer}
\usepackage{xstring,ifthen,catchfile,forloop}
%% Show page number
\addtobeamertemplate{navigation symbols}{}{%
\usebeamerfont{footline}%
\usebeamercolor[fg]{footline}%
\vspace{0.5em}%
\hspace{1em}%
\insertframenumber/\inserttotalframenumber
}
\newcommand{\mypart}[1]{
\part{#1}
\ifthenelse{\isodd{\arabic{framenumber}}}{ \frame{\partpage} }{ \frame{intentionally left blank} \frame{\partpage} }
}
\begin{document}
\mypart{test 1}
\frame{1.1}
\mypart{test 2}
\frame{2.1}
\frame{2.2}
\mypart{test 3}
\frame{3.1}
\end{document}