Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I encountered the following problem with the beamerarticle package. If I use commands like \textit{} I get the following error massage:

./test.tex:7: Argument of \@sect has an extra }.
<inserted text> 
            \par Runaway argument?
{\normalfont \Large \bfseries }{\beamer@sortzeroread {\beamerx@\textit \ETC.
./test.tex:7: Paragraph ended before \@sect was complete.
<to be read again> 
               \par 
l.7 \section{Test \textit{test} test}

? 
l.7 \section{Test \textit{test} test}

? 

Here is a minimal example:

\documentclass{article}
\usepackage{beamerarticle}
\begin{document}
\section{Test \textit{test} test}
\end{document}

Without the package or without the \textit{} the example works. Furthermore, if I use an optional argument in the section, it works as well, but if it contains any formatting commands. That is,

\section[\textit{test}]{Test \textit{test} test}

works, while

\section[test]{Test \textit{test} test}

doesn't.

Any ideas what is going on here or how to solve it?

share|improve this question
1  
This is a fragile command in a moving argument you need \protect\textit –  David Carlisle Apr 18 '12 at 12:47
1  
@DavidCarlisle \textit is supposed to be robust: \show\textit produces \protect \textit  . But beamerarticle changes it into \beamer@sortzero{\beamerx@\textit}. :( –  egreg Apr 18 '12 at 12:51
    
Closely related question: error with bold font in section title with beamer. –  diabonas Apr 18 '12 at 17:05

1 Answer 1

While the \textit command is normally robust and doesn't need protection in moving arguments (which are the arguments to \section and siblings, \caption and some others), with the beamerarticle package it is not robust any more.

So the answer is, with that package

\section{Test \protect\textit{test} test}

or, if you use the command in the optional argument,

\section[Test \protect\textit{test}]{Test \textit{test} test}

(the moving argument is the mandatory one, if the optional argument is missing, otherwise the optional argument).

Also the other font changing commands are not robust any more.

Note: I'm inclined to consider this a bug of beamerarticle (or beamer in general), as it's not mentioned in the user manual, while LaTeX user guides tell that \textit is OK in moving arguments.

share|improve this answer
    
Thanks a lot! That helped. –  Daniel Apr 18 '12 at 19:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.