1

I am working on a class and cannot figure out why geometry is passed my argument "twocolumn", even though I did not use \RequirePackageWithOptions but only \RequirePackage. Can someone explain to me how I can circumvent this strange behaviour ?

Class file

\ProvidesClass{toto}
\DeclareOption{twocolumn}{}
\ProcessOptions\relax
\LoadClass[a4paper]{article}
\RequirePackage{geometry}
\endinput

Main .tex file

\documentclass[twocolumn]{toto}
\usepackage{lipsum}
\begin{document}
\lipsum
\end{document}
3

Global options are passed to every loaded package and geometry has its own twocolumn option.

If you want to nullify it, do

\ProvidesClass{toto}
\DeclareOption{twocolumn}{}
\ProcessOptions\relax
\LoadClass[a4paper]{article}
\RequirePackage[twocolumn=false]{geometry}
\endinput
  • If I remove the \RequirePackage{geometry}, then why is the "twocolumn" option not passed through the \LoadClass[a4paper]{article} ? Are global options passed only to packages and not to classes ? – Florian Aug 25 '15 at 14:42
  • @Florian Exactly. – egreg Aug 25 '15 at 16:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.