# Beamer slides and tufte-handout

I have been experimenting with a setup for slides and handouts with one main.tex file that is \input{} into a "slides" and a "handout" file (as described in the beamer user guide 21.2.1, or this example. This setup allows the handout to be typeset using different documentclasses (i.e. report, article - which I am able to produce).

However, I have been trying to use the tufte-handout class, but the compilation comes to a halt, without giving any particular error messages.

I noticed the compilation halted on amsthm so I used the [noamsthm]{beamerarticle} class option. Then the compilation halted on beamerbasetheorems.styso I used [notheorems]{beamerarticle} in the class option, but then it once again halted on amsthm.

I then tried to give both in the class options (i.e. [notheorems,noamsthm]{beamerarticle}), but this appears to ignore the [notheorems]{beamerarticle} option resulting in the same error message as when only giving the [noamsthm]{beamerarticle} option.

So, my question is, has anyone successfully used this setup to produce beamer slides and handouts using the tufte-handout class?

Minimal examples provided as requested:

File1 (slides.tex):

\documentclass[ignorenonframetext]{beamer}
\input{main.tex}


File2 (handout.tex):

\documentclass{article} % This class works
%\documentclass{tufte-handout} % Whish to use this documentclass
\usepackage{beamerarticle}
\input{main.tex}


File3 (main.tex):

\usetheme{Singapore}
\title{Title here}
\author{Some author}
\date{}
\begin{document}
\maketitle
\begin{frame}
\titlepage
\end{frame}
\section{One section}
\begin{frame}
\frametitle{One frame}
\end{frame}
Text out of frame. Should print on handout only.
\end{document}

-
Please post a minimal example that we can actually try. –  Joseph Wright Aug 11 '10 at 8:20
Not sure if this is highjacking. If, so I apologize but I have the exact same problem with \documentclass{article} and I don't know enough to modify the above. –  schremmer Jan 8 '11 at 22:12
Actually, LaTeX does not hang, I just cannot get the title to show in the article version (OSX 10.4.11) –  schremmer Jan 8 '11 at 22:12
@schremmer: Welcome to tex.sx! Yes, actually this is kind of highjacking. You should ask a new question; in that question you can link to this one. –  Hendrik Vogt Jan 8 '11 at 22:12
@schremmer: Just a note to confirm Hendrik's comment, this ought to be reposted as a question for you to get the best chance of it being answered. –  Andrew Stacey Jan 8 '11 at 22:12

The problem appears to be related to the \title command. When I compile a document using \title then it hangs, and when I compile it without then it works just fine. There's a bit of a tangled web of definitions and redefinitions going on that is a bit hard to track. One method that worked for me was to copy out the (re)definition of \title from tufte-common.def and stick it in after the call to beamerarticle. Thus my main file looks like this:

\documentclass{tufte-handout}
\usepackage{beamerarticle}

\makeatletter
\renewcommand{\title}[2][]{%
\gdef\@title{#2}%
\begingroup%
% TODO store contents of \thanks command
\renewcommand{\thanks}[1]{}% swallow \thanks contents
\protected@xdef\thanklesstitle{#2}%
\endgroup%
\ifthenelse{\isempty{#1}}%
{\renewcommand{\plaintitle}{\thanklesstitle}}% use thankless title
{\renewcommand{\plaintitle}{#1}}% use provided plain-text title
}
\makeatother

\input{tufteMain}


Of course, that means that the title doesn't get "beamerified", but as this is only for the article version, that doesn't matter.

I tried storing the old definition of \title before calling beamerarticle and resetting it afterwards, but that didn't work:

\documentclass{tufte-handout}
\let\tufteTitle=\title
\usepackage{beamerarticle}
\let\title=\tufteTitle

\input{tufteMain}


still hung.

In general, TeX hangs like that when it enters an infinite loop, so my guess is that somehow the definition and redefinition of \title mean that it ends up calling itself again and again. Also, when TeX enters an infinite loop then the logfile contains the last thing that it did okay, so removing stuff that has appeared in the logfile isn't an optimal strategy (you may happen on whatever it was that created the loop, but there's no guarantee).

-
Thanks for your reply. Unfortunately, that solution does not work on my computer (using MikTex 2.7 on Windows XP). The compilation still hangs on amsthm even after using your suggested code. –  Tormod Aug 11 '10 at 12:00
@Tormod: what happens if you don't use \title? In fact, try your document with none of the titlepage commands (\author and so on) since if it hung with \title it may well do the same with the others. I see you've posted your MWE, I'll have a look at those. –  Andrew Stacey Aug 11 '10 at 12:23
@Tormod: Yup, \author seems to have the same problem. Copying the definition of \author from tufte-common.sty (or tufte-common.def) just as with the title made it work for me. –  Andrew Stacey Aug 11 '10 at 12:31
Thanks Andrew! That does the trick. I will post a complete solution and credit you. –  Tormod Aug 11 '10 at 13:02

The answer provided by Andrew Stacey includes copying style definitions from tufte-common.def into the main.tex file.

The following works fine:

\documentclass{tufte-handout}
\usepackage{beamerarticle}

\makeatletter
\renewcommand{\title}[2][]{%
\gdef\@title{#2}%
\begingroup%
% TODO store contents of \thanks command
\renewcommand{\thanks}[1]{}% swallow \thanks contents
\protected@xdef\thanklesstitle{#2}%
\endgroup%
\ifthenelse{\isempty{#1}}%
{\renewcommand{\plaintitle}{\thanklesstitle}}% use thankless title
{\renewcommand{\plaintitle}{#1}}% use provided plain-text title
}
\makeatother

\makeatletter
\renewcommand*{\author}[2][]{%
\gdef\@author{#2}%
\begingroup%
% TODO store contents of \thanks command
\renewcommand{\thanks}[1]{}% swallow \thanks contents
\protected@xdef\thanklessauthor{#2}%
\endgroup%
\ifthenelse{\isempty{#1}}
{\renewcommand{\plainauthor}{\thanklessauthor}}% use thankless author
{\renewcommand{\plainauthor}{#1}}% use provided plain-text author