LaTeX does not behave as I expected with the following files.

First file:

\usepackage{lipsum} % for dummy text only

Second file:

\usepackage{lipsum} % for dummy text only

For the first file, LaTeX gives this warning as expected:

LaTeX Warning: Unused global option(s):

However, the second file compiles without any warnings and uses double-spacing to typeset the text.

Why does the second file work? It seems like the option given to the article documentclass should be parsed and give a warning before the \usepackage{setspace} is encountered.

And a little bit of context: I'm trying to extend a document class to include a doublespacing (by using \DeclareOption{doublespacing}, etc.), but I can't configure the behavior properly because the setspace package picks it up as if I had done \usepackage{doublespacing}. Is there a way to keep setspace from seeing the doublespacing documentclass option?

  • As a follow-on: why doesn't \RequirePackage[singlespacing]{setspace} override the value given in the documentclass option?
    – amcnabb
    Jan 29, 2013 at 22:28

2 Answers 2


Every option given in the \documentclass line is called global and is passed to all packages subsequently loaded. If the package doesn't know the option, it does nothing, otherwise it applies the option. (See clsguide.pdf on your TeX system or here for details.)

Thus it's expected behavior: saying


is equivalent to saying


(as the article class doesn't know the option).

If you write a class that has a doublespacing option, the result is that this option, when specified, is passed to all packages loaded afterwards.

However, in this particular case, you can revert the setting by setspace by issuing an instruction


where <factor> is how much you like.

  • Unfortunately, the \AtBeginDocument trick didn't work because the class creates some new lengths that were based on parameters that the setspace package sets at load time. However, I was able to add \singlespacing immediately after the \RequirePackage{setspace} line.
    – amcnabb
    Jan 29, 2013 at 22:32
  • 4
    @amcnabb Please, don't use doublespacing in your class. ;-)
    – egreg
    Jan 29, 2013 at 22:50
  • 1
    egreg, I would hope it's clear from the fact that I'm writing/editing a document class that I'm not a fan of double-spacing. But I'm not a university bureaucrat, so what do I know about typesetting? :)
    – amcnabb
    Jan 29, 2013 at 22:59
  • @amcnabb So true. :(
    – egreg
    Jan 29, 2013 at 23:06

Document options (by package or by document class) are assembled and processed as needed (if one is using the \DeclareOption method). Only at the start of the document - at \begin{document}, there is a check to see whether all options have been processed or not. From latex.ltx, the following is processed at \begin{document}:

    \@latex@warning@no@line{Unused global option(s):^^J%

Unknown options are kept in \@unusedoptionlist. So, even though doublespacing is passed to the document class, it is processed when setspace is loaded. From setspace.sty:



You must log in to answer this question.

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