我想创建一个使用LaTeX Beamer的演示文稿,它具有两种不同类型的幻灯片模板/布局:一个用于带有背景图片的幻灯片和一个用于没有指定幻灯片的布局/模板背景图。LaTeX Beamer中有多个幻灯片模板
有没有什么窍门可以用beamer来做到这一点?
我想创建一个使用LaTeX Beamer的演示文稿,它具有两种不同类型的幻灯片模板/布局:一个用于带有背景图片的幻灯片和一个用于没有指定幻灯片的布局/模板背景图。LaTeX Beamer中有多个幻灯片模板
有没有什么窍门可以用beamer来做到这一点?
基本上,我归结为\usebackgroundtemplate
之前,每\begin{frame}...\end{frame}
。
如果我理解正确,问题是如何同时生成演示文稿的两个副本。要做到这一点,你需要使用一些低级的tex命令和几个文件。
在Presentation.tex
你可能有
%&pdftex
\relax
\immediate\write18{pdflatex -synctex=1 PresentationWithBG.tex}
\relax
\immediate\write18{pdflatex -synctex=1 PresentationWithoutBG.tex}
\end
这是你实际上将要运行的乳胶,你与pdftex --shell-escape Presentation.tex
做的唯一文件。但你还需要以下内容。
在PresentationWithBG.tex
(请注意,你实际上并不每一帧之前需要\usebackgroundtemplate
):
\documentclass{beamer}
\setbeamercolor{background canvas}{bg=}
\usebackgroundtemplate{\includegraphics[width=\paperwidth]{<your_background_fig>}}
\input{PresentationContent}
在PresentationWithoutBG.tex
:
\documentclass{beamer}
\input{PresentationContent}
在PresentationContent.tex
:
\begin{document}
[All your actual presentation goes here...]
\end{document}
当你运行pdftex --shell-escape Presentation.tex
,您将获得PresentationWithBG.pdf
和PresentationWithoutBG.pdf
。
请注意%&pdftex
在Presentation.tex
确保无论哪个版本的TeX正在运行切换到正确的模式。你可以用pdflatex
来运行它。
如果你想为一个幻灯片特定的背景图像,只是你\begin{frame}
前加上一个
{\usebackgroundtemplate{\includegraphics[width=\paperwidth]{background.jpg}}
直接。
你有没有试过在这里问:http://tex.stackexchange.com/? – pgb 2010-11-25 22:05:42