In a beamer document (using beamer-3.07), I get an "Undefined control sequence" error on a line like:
\section{Motivation \foreignlanguage{italian}{Motivazione}}
while the foreignlanguage statements works correctly elsewhere.
For an example, take the conference-ornate-20min.de template from the beamer package and declare some text within a section title as italian. I attached the modified templates both in lyx (1.5.6) and by regular editor on .tex file, compiled by pdflatex (the modified line is one containing "Motivation")
I usually work with lyx, so I don't know that much about latex and I'm not sure if this is a bug or if I'm doing anything wrong.
Could anybody provide a workaround for this problem?
Thanks in advance
Document Classes ⇒ Beamer: Failure on \foreignlanguage within section titles
Beamer: Failure on \foreignlanguage within section titles
Last edited by pebo on Mon Aug 18, 2008 9:17 am, edited 1 time in total.
NEW: TikZ book now 40% off at Amazon.com for a short time.

- Stefan Kottwitz
- Site Admin
- Posts: 10345
- Joined: Mon Mar 10, 2008 9:44 pm
Beamer: Failure on \foreignlanguage within section titles
Hi Pebo,
welcome to the board!
The command \foreignlanguage will cause problems with pdf bookmarks. In such cases you can use \texorpdfstring:
\texorpdfstring is explained by the hyperref manual.
Stefan
welcome to the board!
The command \foreignlanguage will cause problems with pdf bookmarks. In such cases you can use \texorpdfstring:
Code: Select all
\section{Motivation \texorpdfstring{\foreignlanguage{italian}{motivazione}}{motivazione}}
Stefan
LaTeX.org admin
Beamer: Failure on \foreignlanguage within section titles
Thank you, Stefan, like this the pdf compiles.
However, it's a little complicated to write, not as content-oriented as it should be. (I lost all this morning trying to figure out, what's wrong
)
Maybe, one of hyperref, beamer or at least lyx, should handle this automatically (?)
For the moment, I will prepend this redefinition, I'll see whether it introduces new problems:
However, it's a little complicated to write, not as content-oriented as it should be. (I lost all this morning trying to figure out, what's wrong

Maybe, one of hyperref, beamer or at least lyx, should handle this automatically (?)
For the moment, I will prepend this redefinition, I'll see whether it introduces new problems:
Code: Select all
\let\oldforeignlanguage\foreignlanguage\renewcommand{\foreignlanguage}[2]{\texorpdfstring{\oldforeignlanguage{#1}{#2}}{#2}}