如何使用哥本哈根主题在 Beamer 中拆分小节标题中的文本?

如何使用哥本哈根主题在 Beamer 中拆分小节标题中的文本?
\documentclass[hyperref={pdfpagelabels=false}]{beamer} 
\usetheme{Copenhagen} 
\begin{document} 
\title[Title]{} 
\author[Author]{} 
\institute[Test]{} 
\date{\today} 
\subject{Informatics} 
{ \begin{frame} 
\titlepage 
\end{frame} } 
\section{Introduction} 
\subsection{Test subsection with a really long title and some additional words for the example} 
\begin{frame} 
\frametitle{Table} 
Test Section 
\end{frame} 
\end{document} 

答案1

您可以使用可选参数,例如

\subsection[test sub section]{Test subsection with a really long title and 
                              some additional words for the example}

完整代码:

\documentclass[hyperref={pdfpagelabels=false}]{beamer}
\usetheme{Copenhagen}
\begin{document}
  \title[Title]{}
  \author[Author]{}
  \institute[Test]{}
  \date{\today}
  \subject{Informatics}
  \begin{frame}
    \titlepage
  \end{frame}
  \section{Introduction}
    \subsection[test sub section]{Test subsection with a really long title 
                                  and some additional words for the example}
  \begin{frame}
    \frametitle{Table}
      Test Section
  \end{frame}
\end{document}

在此处输入图片描述

可选参数用于运行内容。

如果你想显示整个标题(恕我直言,这不是一个好主意),这里有一个丑陋的方法:

\documentclass[hyperref={pdfpagelabels=false}]{beamer}
\usetheme{Copenhagen}

\setbeamertemplate{headline}
{%
  \leavevmode%
  \begin{beamercolorbox}[wd=.5\paperwidth,ht=4.5ex,dp=2.5ex]{section in head/foot}%
    \insertsectionnavigationhorizontal{.5\paperwidth}{\hskip0pt plus1filll}{}%
  \end{beamercolorbox}%
  \begin{beamercolorbox}[wd=.5\paperwidth,ht=4.5ex,dp=2.5ex]{subsection in head/foot}%
    \insertsubsectionnavigationhorizontal{.5\paperwidth}{}{\hskip0pt plus1filll}%
  \end{beamercolorbox}%
}


\begin{document}
  \title[Title]{}
  \author[Author]{}
  \institute[Test]{}
  \date{\today}
  \subject{Informatics}
  \begin{frame}
    \titlepage
  \end{frame}
  \section{Introduction}
    \subsection{\protect\parbox{0.5\linewidth}{Test subsection with a really long title and some additional words for the example}}
  \begin{frame}
    \frametitle{Table}
      Test Section
  \end{frame}
\end{document}

在此处输入图片描述

相关内容