I'd like to define a custom documentclass for assignments which can be optionally passed the minionpro
argument to use the Adobe Minion Pro font; if it's not set, the Adobe Utopia font (fourier
) shall be used. Now, no matter what I try, pdfLaTeX always spits out the following error:
! LaTeX Error: Missing \begin{document}.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.8 \DeclareOption(mi
nionpro){
Here is the mwe.cls:
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{mwe}[2015/12/07 mwe.cls]
\DeclareOption(minionpro){
% Adobe Minion Pro font for the document, Euler font for math
\RequirePackage{MinionPro}
\RequirePackage{eulervm}
}
\DeclareOption(utopia){
% Adobe Utopia font for the document
\RequirePackage{fourier}
}
\ExecuteOptions{utopia}
\ProcessOptions\relax
\endinput
And here the mwe.tex
\documentclass{mwe2}
\begin{Document}
content...
\end{Document}
Alternatively, I tried using the etoolbox
package to work around the package loading inside of the options, but that gave me the same error. Nevertheless, here the modified mwe.cls:
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{mwe}[2015/12/07 mwe.cls]
\RequirePackage{etoolbox}
\providebool{minionpro}
\setbool{minionpro}{false}
\DeclareOption(minionpro){
\setbool{minionpro}{true}
}
\ProcessOptions\relax
\ifthenelse{minionpro}{
% Adobe Minion Pro font for the document, Euler font for math
\RequirePackage{MinionPro}
\RequirePackage{eulervm}
}{
% Adobe Utopia font for the document
\RequirePackage{fourier}
}
\endinput
\DeclareOption
needs curly{}
not round()
braces and\ifthenelse
is fromifthen
notetoolbox
. I think it should be something like\ifbool
. – Nicola Talbot Dec 7 '15 at 20:21etoolbox
/ifthen
mixup is due to me copying the MWE together from multiple sources, I've also tried the already-deprecatedifthen
package prior toetoolbox
. – Big-Blue Dec 7 '15 at 20:38