【问题标题】:Having multiple slide templates in LaTeX Beamer在 LaTeX Beamer 中有多个幻灯片模板
【发布时间】:2010-07-01 14:21:20
【问题描述】:

我想使用 LaTeX beamer 创建一个演示文稿,它有两种不同类型的幻灯片模板/布局:一种用于带有背景图像的幻灯片,另一种用于没有指定背景图像的幻灯片的布局/模板。

使用投影仪有什么技巧吗?

【问题讨论】:

标签: latex beamer


【解决方案1】:

基本上我归结为将\usebackgroundtemplate 放在每个\begin{frame}...\end{frame} 之前。

【讨论】:

    【解决方案2】:

    如果您想要一张幻灯片的特定背景图片,只需添加一个

    {\usebackgroundtemplate{\includegraphics[width=\paperwidth]{background.jpg}}

    直接在您的\begin{frame}之前。

    【讨论】:

      【解决方案3】:

      如果我理解正确,问题是如何同时生成演示文稿的两个副本。为此,您需要使用一些低级 tex 命令和几个文件。

      Presentation.tex 你可能有

      %&pdftex
      \relax
      \immediate\write18{pdflatex -synctex=1 PresentationWithBG.tex}
      \relax
      \immediate\write18{pdflatex -synctex=1 PresentationWithoutBG.tex}
      \end
      

      这是您实际必须在其上运行 Latex 的唯一文件,您使用 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.pdfPresentationWithoutBG.pdf

      注意Presentation.tex 中的%&amp;pdftex 确保无论哪个版本的TeX 正在运行切换到正确的模式。您实际上可以使用pdflatex 运行它。

      【讨论】:

        【解决方案4】:

        这可以通过一个新的框架选项轻松完成:

        \documentclass{beamer}
        
        \defbeamertemplate{background canvas}{mydefault}{%
          \includegraphics[width=1cm]{example-image-duck}
        }
        \defbeamertemplate{background canvas}{fullimage}{%
          \includegraphics[width=\paperwidth]{example-image-duck}
        }
        
        \BeforeBeginEnvironment{frame}{%
          \setbeamertemplate{background canvas}[mydefault]%
        }
        
        \makeatletter
        \define@key{beamerframe}{fullimage}[true]{%
          \setbeamertemplate{background canvas}[fullimage]%
        }
        \makeatother
        
        \begin{document}
        
        \begin{frame}
          left
        \end{frame} 
        
        \begin{frame}[fullimage]
          right
        \end{frame}
        
        \begin{frame}
          is left again
        \end{frame}
        
        \end{document}
        

        【讨论】:

          猜你喜欢
          • 2011-02-07
          • 2010-10-29
          • 2017-05-31
          • 2017-12-26
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2014-10-20
          • 1970-01-01
          相关资源
          最近更新 更多