Document Classes ⇒ Beamer: Failure on \foreignlanguage within section titles
Beamer: Failure on \foreignlanguage within section titles
\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
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
- Stefan Kottwitz
- Site Admin
- Posts: 10335
- Joined: Mon Mar 10, 2008 9:44 pm
Beamer: Failure on \foreignlanguage within section titles
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
Beamer: Failure on \foreignlanguage within section titles
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}}