Recently, I am reading the book [1]. Today, I input the following code on page 794 of [1] into TeXstudio 3.1.2:
\documentclass{beamer}
\setbeamertemplate{background}[grid][0.5cm]
\setbeamercolor{frametitle}{fg=white,bg=gray}
\setbeamerfont{frametitle}{series=\bfseries}
\setbeamerfont{framesubtitle}{size=\small,series=\bfseries}
\setbeamertemplate{frametitle}{%
\begin{beamercolorbox}[wd=\paperwidth,ht=5.2ex,leftskip=.3cm,%
rightskip=.3cm plus1fil,vmode]{frametitle}
\usebeamerfont*{frametitle}\insertframetitle\strut
\hfill\Huge\raisebox{-1ex}{FU}%
\ifx\insertframesubtitle\empty\else\par
{\usebeamerfont*{framesubtitle}{%
\usebeamercolor[fg]{framesubtitle}%
\insertframesubtitle}\strut\par}%
\fi
\end{beamercolorbox}}
\logo{\includegraphics[width=1.5cm]{fu-berlin}}
\begin{document}
\begin{frame}[fragile]
\frametitle{The macro \texttt{\textbackslash setbeamertemplate}}
\framesubtitle{how it works ...}
\end{frame}
\end{document}
Then I press the key F5 on the keyboard. The TeXstudio displays the following error message:
Line 23: Package keyval Error: 0.5cm undefined. \end{frame}
I have checked my code. I am sure that it is just the same as that on page 794 of [1]. I am a beginner at the beamer. Then I google the error message, but I cannot find the problem with the code. Do you know where is the problem? Thank you in advance.
Note: I use MiKTeX 2.9.
Reference
[1] M. Goossens, F. Mittelbach, S. Rahtz, D. Roegel, H. Voss, The $\LaTeX$ Graphics Companion, 2nd ed., Addison Wesley, 2008.
Best Answer
looking at the beamer manual page 174 should be