代码之家  ›  专栏  ›  技术社区  ›  Sam

在LaTeX中将图像添加到预制的投影仪中

  •  1
  • Sam  · 技术社区  · 5 月前

    我想使用一个名为Argelles的波束模板( https://github.com/piazzai/arguelles/?tab=readme-ov-file )并在标题页添加图片。 标题页的定义是:

    % title page
    \defbeamertemplate*{title page}{Arguelles}{
      \vfill\begin{beamercolorbox}{inverted text}
        {\usebeamerfont{title}\inserttitle}\par
        {\usebeamerfont{subtitle}\insertsubtitle}\par\bigskip
        {\usebeamerfont{event}\insertevent}\par
        {\usebeamerfont{date}\insertdate}\par\bigskip
        {\usebeamerfont{author}\insertauthor}\par\smallskip
        {\usebeamerfont{institute}\insertinstitute}\par
        {\usebeamerfont{email}\insertemail}\par
        {\usebeamerfont{homepage}\inserthomepage}\par
        {\usebeamerfont{github}\insertgithub}
      \end{beamercolorbox}
      \addtocounter{framenumber}{-1}
    }
    

    我们使用它:

    \begin{document}
    \frame[plain]{\titlepage}
    

    所以我认为添加tikz包并将图片直接添加到模板文件中是可行的,但我不知道为什么不行:

      \end{beamercolorbox}
      \begin{tikzpicture}[remember picture,overlay]
      \node[anchor=south east, xshift=-0.5cm, yshift=0.5cm] at (current page.south east) {
        \includegraphics[width=2cm]{obs.png}
      };
      \addtocounter{framenumber}{-1}
    

    否则,我不知道是否可以直接在我的.tex文件上做这件事。。。

    非常感谢。

    以下是一个可编译的示例:

    \documentclass[compress,12pt]{beamer}
    
    \usetheme{Arguelles}
    
    \title{Argüelles}
    \subtitle{Simple, typographic beamer theme}
    \event{}
    \date{}
    \author{Place Holder}
    \institute{University of \TeX}
    \email{[email protected]}
    \homepage{www.mywebsite.com}
    \github{username}
    
    \begin{document}
    
    \frame[plain]{\titlepage}
    
    \Section{Demo}
    
    \begin{frame}
          \frametitle{A frame with title and subtitle}
          \framesubtitle{Subtitle here}
          Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua \par
          Itemized list:
          \begin{itemize}
                \item Lorem ipsum
                \item Dolor sit amet
                      \begin{itemize}
                            \item Consectetur
                            \item Adipiscing elit
                      \end{itemize}
                \item Sed do eiusmod
                      \begin{itemize}
                            \item Tempor incididunt
                                  \begin{itemize}
                                        \item Ut labore et dolore
                                        \item Magna aliqua
                                  \end{itemize}
                      \end{itemize}
          \end{itemize}
    \end{frame}
    \end{document}
    
    1 回复  |  直到 5 月前
        1
  •  1
  •   samcarter_is_at_topanswers.xyz    5 月前

    您可以使用 \addtobeamertemplate{title page}{<code before>}{<code after>} 向标题页添加其他代码。确保:

    • 你有一个 \end{tikzpicture}
    • 编译两次以创建页面坐标,如下所示 current page.south east

    \documentclass[compress,12pt]{beamer}
    
    \usetheme{Arguelles}
    
    \title{Argüelles}
    \subtitle{Simple, typographic beamer theme}
    \event{}
    \date{}
    \author{Place Holder}
    \institute{University of \TeX}
    \email{[email protected]}
    \homepage{www.mywebsite.com}
    \github{username}
    
    \addtobeamertemplate{title page}{}{%
      \begin{tikzpicture}[remember picture,overlay]
        \node[anchor=south east, xshift=-0.5cm, yshift=0.5cm] at (current page.south east) {
          \includegraphics[width=2cm]{example-image-duck}
        };
      \end{tikzpicture}%
    }
    
    \begin{document}
    
    \begin{frame}[plain]
    \titlepage
    \end{frame}
    
    \end{document}
    

    enter image description here