# Beamer: How to showcase LaTeX-Code and results that look like scrartcl

We are currently working on a beginner's course for LaTeX.

We are using LuaLaTeX and Beamer for the slides. We typeset code with the listings-package.

We often show Code on the left and a result on the right. For most parts adding a \rmfamily is enough to let it look like the result one would get in an article-class and not in beamer.

But not so for \item, \ref, \caption and some other features.

My dream would be an environment scrartcl-result.

Any ideas?

• maybe you could provide a MWE showing what works and what doesn't with your current approach? – Old Nick Sep 29 '14 at 7:30
• I will add this during this week. What works is: We have Roman Font for text. Nothing else. The itemize-points look like beamer, the equation-numbers are sans-serif ... – MaxNoe Sep 29 '14 at 7:45
• – Ignasi Sep 29 '14 at 8:38
• I know this answer. Is there no way that does not involve creating and loading several dozens of pdfs? – MaxNoe Sep 29 '14 at 8:43
• From the top of my head i would have suggested the same approach given by @Joseph in the linked answer. If you want something to look like scrartcl use it. beamer uses a whole lot of different mechanisms to do beamer stuff. Reinventing the wheel seems to be much more effort than necessary. – Johannes_B Sep 30 '14 at 12:08

We now have an environment (with xparse, but not necessary) that lets everything we need to look like article. Hardest part were the equation numbers because of the lacking beamer font template.

You have to use ~ for the white space in the beamer template names.

\makeatletter
\NewDocumentEnvironment {EmulateArticle} {} {
%Roman Font:
\rmfamily

%Itemize/Enumerate/Description
\setbeamercolor{item}{fg=black}
\setbeamerfont{item}{family=\rmfamily, size=\normalsize}
\setbeamerfont{itemize/enumerate~body}{family=\rmfamily}
\setbeamerfont{itemize/enumerate~subbody}{family=\rmfamily}
\setbeamerfont{itemize/enumerate~subsubbody}{family=\rmfamily}
\setbeamerfont{description~item}{series=\bfseries}
\setbeamertemplate{itemize~item}{\bullet}
\setbeamertemplate{itemize~subitem}{--}
\setbeamertemplate{itemize~subsubitem}{\textasteriskcentered}
\setbeamertemplate{enumerate~item}{\theenumi.}
\setbeamertemplate{enumerate~subitem}{\alph{enumii})}
\setbeamertemplate{enumerate~subsubitem}{\roman{enumii}.}

% Captions
\setbeamerfont{caption}{family=\rmfamily}
\setbeamercolor{caption~name}{fg=black}
\setbeamerfont{caption~name}{family=\rmfamily, series=\bfseries}

% Footnotes
\setbeamerfont{footnote}{family=\rmfamily}
\setbeamerfont{footnote~mark}{family=\rmfamily}

% Serif Equation Numbers:
\let\reftagform@=\tagform@
\def\tagform@##1{\maketag@@@{(\ignorespaces{\rmfamily{##1}}\unskip\@@italiccorr)}}
\renewcommand{\eqref}[1]{\textup{\reftagform@{\rmfamily\ref{##1}}}}
}{
}
\makeatother


The Slides are available at http://toolbox.pep-dortmund.org/files/archive/latest/latex.pdf

Our Github-Repo is https://github.com/pep-dortmund/toolbox-workshop

One might want to add settings for the bibliography-output.