如何在 Beamer(华沙主题)每张幻灯片的右上角添加一些内容

如何在 Beamer(华沙主题)每张幻灯片的右上角添加一些内容

我有以下带有华沙主题的 beamer 演示文稿代码,我在右上角添加了一个徽标,我想在同一区域添加机构和主题,有什么帮助吗?

\documentclass[11pt]{beamer}
    \usetheme{Warsaw}

    \makeatletter
    \setbeamertemplate{headline}
    {%
      \leavevmode%
      \@tempdimb=2.4375ex%
      \ifnum\beamer@subsectionmax<\beamer@sectionmax%
        \multiply\@tempdimb by\beamer@sectionmax%
      \else%
        \multiply\@tempdimb by\beamer@subsectionmax%
      \fi%
      \ifdim\@tempdimb>0pt%
        \advance\@tempdimb by 1.825ex%
        \begin{beamercolorbox}[wd=.5\paperwidth,ht=\@tempdimb]{section in head/foot}%
          \vbox to\@tempdimb{\vfil\insertsectionnavigation{.5\paperwidth}\vfil}%
        \end{beamercolorbox}%
        \begin{beamercolorbox}[wd=.5\paperwidth,ht=\@tempdimb]{subsection in head/foot}%
          \vbox to\@tempdimb{\vfil\insertsubsectionnavigation{.3\paperwidth}\vfil}%
          \hfill
          \includegraphics[height=\headheight]{example-image}
        \end{beamercolorbox}%
      \fi%
    }
    \makeatother

    \begin{document}

    \section{bla}
    \begin{frame}
    contenants
    \end{frame}

\end{document}

答案1

\documentclass[11pt]{beamer}
\usetheme{Warsaw}

\makeatletter
\setbeamertemplate{headline}
{%
  \leavevmode%
  \@tempdimb=2.4375ex%
  \ifnum\beamer@subsectionmax<\beamer@sectionmax%
    \multiply\@tempdimb by\beamer@sectionmax%
  \else%
    \multiply\@tempdimb by\beamer@subsectionmax%
  \fi%
  \ifdim\@tempdimb>0pt%
    \advance\@tempdimb by 1.825ex%
    \begin{beamercolorbox}[wd=.5\paperwidth,ht=\@tempdimb]{section in head/foot}%
      \vbox to\@tempdimb{\vfil\insertsectionnavigation{.5\paperwidth}\vfil}%
    \end{beamercolorbox}%
    \begin{beamercolorbox}[wd=.5\paperwidth,ht=\@tempdimb]{subsection in head/foot}%
      \quad
      \yoursubject
      \hfill
      \insertshortinstitute        
      \hfill
      \raisebox{-0.65em}{\includegraphics[height=\headheight]{example-image}}
      \vfill
    \end{beamercolorbox}%
  \fi%
}
\makeatother

\renewcommand{\subject}[1]{%
  \hypersetup{pdfsubject={#1}}%
  \newcommand{\yoursubject}{#1}
}

\title{title}
\institute{institute}
\subject{Your subject}

\begin{document}

\section{bla}
\begin{frame}
contenants
\end{frame}

\end{document}

在此处输入图片描述

相关内容