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}
0

1 Answer 1

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
2
  • 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 ?
    – fyusuf-a
    Aug 25, 2015 at 14:42
  • @Florian Exactly.
    – egreg
    Aug 25, 2015 at 16:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .