![我该如何扩展逻辑,从跳过特定幻灯片到 Beamer 框架的特定部分?](https://linux22.com/image/327822/%E6%88%91%E8%AF%A5%E5%A6%82%E4%BD%95%E6%89%A9%E5%B1%95%E9%80%BB%E8%BE%91%EF%BC%8C%E4%BB%8E%E8%B7%B3%E8%BF%87%E7%89%B9%E5%AE%9A%E5%B9%BB%E7%81%AF%E7%89%87%E5%88%B0%20Beamer%20%E6%A1%86%E6%9E%B6%E7%9A%84%E7%89%B9%E5%AE%9A%E9%83%A8%E5%88%86%EF%BC%9F.png)
我有以下工作结构,用于从讲座的文章形式中排除特定的讲座幻灯片:
\documentclass[11pt,handout]{beamer}
\newif\iflecture
\lecturetrue
% Next three lines for article form of presentation
\lecturefalse
\documentclass[11pt]{article}
\usepackage{beamerarticle}
\iflecture
...frames for just the lecture and not the article form
\fi
两者的剩余帧数。
这个逻辑可以扩展到单个框架内吗?
\begin{frame}
...content for both lecture and article, a problem for example
end article content here
...remaining content just for lecture
\end{frame}
答案1
如果您希望某些材料仅在文件排版为讲座时出现,\lectureture
则只需将其括在
\iflecture <lecture only material>...\fi
同样,对于不用于讲座的材料,使用方式如下:
\iflecture\else <article only material>...\fi
当然,你也可以组合这些:
\iflecture <lecture only material>
\else <article only material>\fi
另一个有用的构造是,你可以使用 向 beamer 或其他包传递不同的选项\PassOptionsToClass
。以下是完整的 MWE:
\newif\iflecture
\lecturefalse % uncomment if typesetting as an article
%\lecturetrue % uncomment if typesetting as a lecture
\iflecture\else
\PassOptionsToClass{11pt,handout}{beamer}
\fi
\documentclass{beamer}
\begin{document}
\iflecture
\begin{frame}{Lecture only frame}
A framed lecture
\end{frame}
\fi
\begin{frame}
...content for both lecture and article, a problem for example
\iflecture\else article content here\fi
\iflecture ...remaining content just for lecture\fi
\end{frame}
\end{document}