我该如何扩展逻辑,从跳过特定幻灯片到 Beamer 框架的特定部分?

我该如何扩展逻辑,从跳过特定幻灯片到 Beamer 框架的特定部分?

我有以下工作结构,用于从讲座的文章形式中排除特定的讲座幻灯片:

\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}

相关内容