
以下程式碼使用 將標題名稱列印到投影機標題中\insertshorttitle
。問題是,對於長標題,行不會自動在標題內換行。奇怪的是,使用時自動斷線\inserttitle
。
\documentclass[]{beamer}
\usepackage{tikz}
\usepackage{varwidth}
\tikzstyle{example-box} = [fill=yellow, align=left, rectangle, text width=\textwidth]
\setbeamertemplate{headline}{
\begin{tikzpicture}
\node [example-box] (box){
\insertshorttitle
};
\end{tikzpicture}
}
\title{A long title when inserted in the headline, using insertshorttitle does not break line. Whereas using inserttitle breaks the line. Specifying align=left in tikz block is not working either.}
\begin{document}
\begin{frame}
Insert the short title.
\end{frame}
\end{document}
使用 \inserttitle 時:
使用 \insertshorttitle 時:
有誰知道如何在使用時在標題內自動換行\insertshorttitle
?先致謝