我问的问题与这里提出的问题非常相似重复使用 Beamer 演示文稿中的幻灯片但可能略有不同。我教授了许多非常相似的模块,主要区别在于主题的数量和细节。我知道我可以使用主文件,并根据需要将幻灯片作为单独的文件包含在内。
我更多地思考的是以下伪代码......
\modulelist{CHEM6005,CHEM7002,CHEM8005}
.
.
.
\begin{frame}{Grignard Reagents}[]
This frame appears for all modules
\end{frame}
\begin{frame}{Grignard Reagents-General reaction mechanisms}[CHEM7002, CHEM8005]
This frame only appears for modules CHEM7002 and CHEM8005 when compiled
\end{frame}
\begin{frame}{Grignard Reagents-Aldehydes and Ketones}[]
This frame appears for all modules
\end{frame}
\begin{frame}{Grignard Reagents-Esters}[CHEM8005]
This frame appears for module CHEM8005 only when compiled
\end{frame}
当文档被编译时(无需手动注释掉框架等),它会在上述情况下输出三个不同的文件,lecture-chem6005.pdf,lecture-chem7002.pdf 和 lesson-chem8005.pdf,它们具有模块所需的深度和细节......
答案1
下面我给出了 beameraudience 包的一个示例。它相当简单,也不是很令人兴奋。虽然它没有准确回答我提出的问题,但它非常接近了。我所需要做的就是注释掉我不想要的模块,然后进行编译。
\framefor{}{}
\justfor{}{}
\showcontentfor{}{}
下面使用了三个宏。\framefor{audience}{frame contents}
基本上为 选择了整个框架[audience]
。由于\begin{frame}
和\end{frame}
在宏中定义,因此不需要它们,但需要框架标题。\justfor{audience}{contents}
可以包含完整的框架内容(需要使用\begin{frame}...\end{frame}
或仅框架内内容。\showcontentfor{audience}{content}
是更微妙的用法\justfor{}{}
查看 beameraudience 样式文件,只能定义一个受众。如果可以使用ifthenelse
允许选择多种受众类型的命令来定义受众列表,那就太理想了。我的意思是,我不必重复三种受众类型中的两种的内容,我可以将这两种类型包含在选项 [audience=intermediate,expert] 中。
\documentclass{beamer}
\usepackage[audience=
CHEM7002
%CHEM6005
%CHEM8005
]{beameraudience}% comment in the audience you are reaching out to...
\begin{document}
\begin{frame}{Grignard Reagents}
This frame appears for all modules as we do not use any of the beameraudience commands.
\end{frame}
\framefor{CHEM8005}
{
{Grignard Reagents-General reaction mechanisms}% definition of \framefor{audience} {\begin{Frame} Frame contents\end{frame}} hence the frame title being in parentheses and no \begin{frame} \end{frame} environment
This frame only appears for module CHEM8005 when compiled...
}
\begin{frame}{Grignard Reagents-Aldehydes and Ketones}
This frame appears for all modules as does this line.\\
\justfor{CHEM6005}{But this line only appears for module CHEM6005.}
\justfor{CHEM7002}{This line only appears for module CHEM7002.}
\justfor{CHEM8005}{This line only appears for CHEM8005.}
\end{frame}
\begin{frame}{Grignard Reagents-Esters}%[CHEM8005]
This frame appears for all modules.
\showcontentfor{CHEM6005}{CHEM6005. Only the barest details are necessary.}\showcontentfor{CHEM7002}{CHEM7002. A little bit more information is given.}\showcontentfor{CHEM8005}{CHEM8005. A lot more information and maybe a few diagrams are given for this module.}\end{frame}
\justfor{CHEM7002}{
\begin{frame}
Only content for CHEM7002
\end{frame}
}
\end{document}