TransWikia.com

How to use translator for two languages in beamer

TeX - LaTeX Asked on September 6, 2021

Using translator package in beamer presentation to translate string like theorem to a single language is simple and clear, how about two languages ?

documentclass{beamer}
usepackage[spanish,french]{babel}

uselanguage{french}
languagepath{french}

begin{document}
begin{frame}
today
begin{theorem}
I will translate structure{translate[to=french]{theorem}} but not theorem
end{theorem}
end{frame}

selectlanguage{spanish}

%uselanguage{spanish}
%languagepath{spanish}

begin{frame}
today
begin{theorem}
I will translate structure{translate[to=spanish]{theorem}} but not theorem
end{theorem}
end{frame}

end{document}

One Answer

You should load languages in documentclass, just before babel and in the same order, so the last language, i.e. French is the default.

documentclass[spanish,french]{beamer}
usepackage{babel}

begin{document}
begin{frame}
today
begin{theorem}
I will translate structure{translate[to=french]{theorem}} but not theorem
end{theorem}
end{frame}

selectlanguage{spanish}

begin{frame}
today
begin{theorem}
I will translate structure{translate[to=spanish]{theorem}} but not theorem
end{theorem}
end{frame}

end{document}

enter image description here

Correct answer by user220367 on September 6, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP