TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to be able to pass two options to a package (actually, a class) and have them be the same. What's the best way to do this?

That is, I want:




to do the same thing.

share|improve this question

It partly depends on how you implement them internally. If the two options set some kind of flag, then it would be easiest to code them by hand


If the code is more complex then it might be easiest to write a macro to do the job

   % Code here
share|improve this answer
Or I guess I could combine the two: after the options are executed, do \if@mypkg@norsk code \fi. (Was hoping for a more elegant method, though.) – Loop Space Aug 4 '10 at 18:08
Does \DeclareOption{bokmal}{\ExecuteOptions{norsk}} not work? – TH. Sep 2 '10 at 15:51
Fair point: should do I think – Joseph Wright Sep 2 '10 at 16:38

@Andrew: There is a potential danger with the following solution: endless back-linking in not-so-complex situations. You need a flag to avoid that. See the macro \XKV@replacepointers in the xkeyval package.

  \renewcommand{\synonymous}{Greetings Earthlings}}
share|improve this answer
It's somewhat confusing to have an answer start with "@Andrew". (Also, I don't quite understand what you're writing about "endless back-linking in not-so-complex situations". Your 3 lines of code are not complex ... Maybe you can expand a bit?) – Hendrik Vogt Mar 3 '11 at 12:39
Yes, I wanted to make a comment, but the markup of the code wasn't clear enough. So I turned it into a quasi-answer. I hope the following is clear. Consider \DeclareOption{a}{\renewcommand{\synonymous}{Greetings Earthlings}\ExecuteOptions{c}} \DeclareOption{b}{\ExecuteOptions{a}} \DeclareOption{c}{\ExecuteOptions{b}}. – Ahmed Musa Mar 3 '11 at 14:38
up vote 0 down vote accepted

I'm posting TH.'s comment to Joseph's answer as an answer as it also works. (CW as it's TH.'s answer.)

synonymous.sty contains:

\newcommand{\synonymous}{Hello world}
  \renewcommand{\synonymous}{Greetings Earthlings}}

whilst synonmyous.tex is:


Changing the a to b has no visible effect on the outcome.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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