I'm writing a multilingual LaTeX2e package to be used with pdflatex containing several macro and environment definitions. The main language of the document--a thesis--is English, Finnish or Swedish. One page of the document contains text in one secondary language, again English, Finnish or Swedish. My problem is in some ways similar to the one here.

I have implemented the choice of the main language as an option of my package, which I then pass on to the babel package using \PassOptionsToPackage. I then process the package options with english as the default. However, specifying a language other than english globally as say \documentclass[finnish]{article} doesn't seem to pass on the chosen language to babel while \usepackage[finnish]{mypackage} does. This is evident from the caption in tables and figures, which are in English and not Finnish, as well as the title of the list of references, which is also in English in the first case.

After digging around I found a solution to my problem (a more elegant one to using flags and then loading babel with the appropriate options) here.

My question is why doesn't \PassOptionsToPackage pass on the option to babel when it is specified in \documentclass? The option isn't passed on when finnish is specified to both \documentclass and \usepackage{mypackage} either. Why? A minimum working package code for mypackage.sty is:

\ProvidesPackage{mypackage}[2013/09/26 Version 0.01]

%  \AtEndOfClass{\main@language{english}}
%  \AtEndOfClass{\main@language{finnish}}
\ExecuteOptions{english}% Default package options
\ProcessOptions \relax



A not-so-minimal LaTeX file that shows the caption and reference list heading in the wrong language follows:

% This works when \AtEndOfClass{\main@language{...} is uncommented
% but not with \PassOptionsToPackage{finnish}{babel}.

% This works with \PassOptionsToPackage{finnish}{babel} uncommented.
% This causes an error with \AtEndOfClass{\main@language{



Tämän tekstin lähteenä oleva tiedosto on opinnäytteen pohja...

\caption{\label{taulukko1} Taulukon kirjaintyypin...}
\hline \textbf{A} & 1 & $e^{j \omega t}$ \\ \hline


Viite \cite{bcs} on esimerkki artikkelin esittämisestä lähdeluettelossa.


\bibitem{bcs} Bardeen,\ J., Cooper,\ L.\ N. ja Schrieffer,\ J.\ R.
  Theory of Superconductivity. \textit{Physical Review,} 1957, vol.      108, nro~5, s.\ 1175--1204.


  • 2
    Doesn't the babel key main solve it? -- ie, pass main=finnish instead of just finnish. Oct 7, 2013 at 13:19
  • If you want to use this also with Babel 3.8, then the only ways are: (1) avoid executing the english option, or (2) passing the language options to mypackage rather than the class. With Babel 3.9 you can use main=<language> in \DeclareOption{<language>}
    – egreg
    Oct 7, 2013 at 13:59
  • 2
    The global option is passed, but before the local options, among which there is english. So english ends up to be the last one.
    – egreg
    Oct 7, 2013 at 14:01
  • Adding main=finnish works, but it generates the warning Unused global option(s): [main=finnish]
    – Luis Costa
    Oct 7, 2013 at 14:32
  • What I meant was to pass it with \PassOptionToPackage. Due to way LaTeX handles options, a global option cannot be the main language if other languages are set as package options. Oct 7, 2013 at 14:51

1 Answer 1


My question is why doesn't \PassOptionsToPackage pass on the option to babel when it is specified in \documentclass?

The thinking was that there was no need to as it was a global option so the included package already sees it. Of course babel is a bit special as it matters there about the order or the options, the last one being default, that isn't really handled in the general code.

  • Shouldn't a global option, finnish here, be passed to to babel loaded by mypackage regardless of whether it is an option of mypackage?
    – Luis Costa
    Oct 7, 2013 at 13:01
  • What puzzles me even more is that when I load babel with the option finnish as \RequirePackage[finnish]{babel} in the above package with \PassOptionsToPackage` active, Finnish isn't activated. Why is this so?
    – Luis Costa
    Oct 7, 2013 at 13:32

You must log in to answer this question.

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