How can I pass options of my package in a specific order to another loaded package?

\DeclareOption{others}{% other options are also declared}

Above declaration results in babel being loaded with english,ngerman always regardless whether I load L10n with




How can I manage to have the options ngerman and english in order for babel when loading my package?

  • I tried to specify your title a bit, hope you don't mind. The previous wording hinted at a question way simpler than yours actually is.
    – doncherry
    Commented Sep 15, 2011 at 12:25
  • 1
    \ProcessOptions* is what's needed.
    – egreg
    Commented Sep 15, 2011 at 12:26
  • \ProcessOptions* scans through all options. I only want to pass english and ngerman to babel but in the given order. There are other options not being passed to babel but handled by my package. I don't know the way how to handle options differently when using \ProcessOptions*
    – Sebastian
    Commented Sep 15, 2011 at 12:29
  • @egreg or Sebastian: Please post this as an answer. I would do it myself you where first. Commented Sep 15, 2011 at 12:45

1 Answer 1


It mostly depends on what the other options should do. The command


will scan the option code in the order the options are passed to the package, without doing anything for the options not specified at package call. If other options do things that shouldn't depend on the calling order, then you have a problem.

In general it's not a good idea to call babel from a package, as this cuts out languages which are not provided in the package as an explicitly declared option.

A clean way might be to load options with a key-value interface, so


could do the job by passing the languages to babel in the prescribed order and maintaining the possibility to choose any supported language. Many packages use this syntax.

  • Thanks! Sounds good but sadly I got stuck \DeclareOption{languages}{\PassOptionsToPackage{\CurrentOption}{babel}} Doesn't work now. I need to handle the key-value pair correctly.
    – Sebastian
    Commented Sep 15, 2011 at 14:57
  • @Sebastian: you should look the documentation of package kvoptions
    – egreg
    Commented Sep 15, 2011 at 15:10

You must log in to answer this question.

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