2020-06-21, 19:28
Basierend auf dem letzten Blog-Artikel dazu und einer Frage, die ich 2014 auf TSX gestellt habe, habe ich den Code für mehrsprachige Beamer-Folien angepasst.
\documentclass[ngerman]{beamer}
\usepackage{comment}
\makeatletter
\newif\if@ngerman
\newif\if@option@ngerman
\DeclareOption{ngerman}{%
\@ngermantrue
\@option@ngermantrue
}
\ProcessOptions*\relax
\newcommand*{\ifngerman}{%
\if@ngerman
\expandafter\@firstoftwo
\else
\expandafter\@secondoftwo
\fi
}
\makeatother
\ifngerman{
\usepackage[main=ngerman]{babel}
\includecomment{DE}
\excludecomment{EN}
}{
\usepackage[main=english]{babel}
\includecomment{EN}
\excludecomment{DE}
}
\begin{document}
\begin{DE}
\begin{frame}[fragile]{Hallo Welt}
Hallo Welt
\end{frame}
\end{DE}
\begin{EN}
\begin{frame}[fragile]{Hello World}
Hello World
\end{frame}
\end{EN}
\end{document} |
\documentclass[ngerman]{beamer}
\usepackage{comment}
\makeatletter
\newif\if@ngerman
\newif\if@option@ngerman
\DeclareOption{ngerman}{%
\@ngermantrue
\@option@ngermantrue
}
\ProcessOptions*\relax
\newcommand*{\ifngerman}{%
\if@ngerman
\expandafter\@firstoftwo
\else
\expandafter\@secondoftwo
\fi
}
\makeatother
\ifngerman{
\usepackage[main=ngerman]{babel}
\includecomment{DE}
\excludecomment{EN}
}{
\usepackage[main=english]{babel}
\includecomment{EN}
\excludecomment{DE}
}
\begin{document}
\begin{DE}
\begin{frame}[fragile]{Hallo Welt}
Hallo Welt
\end{frame}
\end{DE}
\begin{EN}
\begin{frame}[fragile]{Hello World}
Hello World
\end{frame}
\end{EN}
\end{document}
Uwe Ziegenhagen likes LaTeX and Python, sometimes even combined.
Do you like my content and would like to thank me for it? Consider making a small donation to my local fablab, the Dingfabrik Köln. Details on how to donate can be found here Spenden für die Dingfabrik.
More Posts - Website