# Passing options to Beamer from another file

I have broken my Beamer file in two parts: a preamble and the presentation proper (for reusing purposes).

My preamble is something like this:

% Start of mypreamble.tex
% =================================================
\documentclass[xcolor=svgnames]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[spanish]{babel}
\usepackage[autostyle=false, style=british]{csquotes}
\usepackage{graphicx}
\usepackage{tcolorbox}
\usepackage{hyperref}
% ====================================================
% End of mypreamble.tex


The main presentation file is as follows:

% Start of presentation.tex
% =====================================================
\input{mypreamble.tex}
\PassOptionsToClass{handout}{beamer}

\begin{document}
\begin{frame}
. . .
\end{frame}
\end{document}
% =======================================================
% end of presentation.tex


Notice line 4 of the latter file: \PassOptionsToClass{handout}{beamer}. I would like to decide within the presentation.tex file whether it is a handout or a normal presentation. The problem is that that line makes no difference in the output. (In fact, no options passed to Beamer in this place have any affect.)

How can I fix this?

• your passoptionstoclass would need to be before the \input line, you can not pass options to a class after it has finished loading, that's too late. – David Carlisle Sep 21 '15 at 23:12
• Great! Thanks. I didn't know that. – NVaughan Sep 21 '15 at 23:29

## 1 Answer

Your \PassOptionsToClass would need to be before the \input line, you can not pass options to a class after it has finished loading, that's too late.