9

Traditionally, LaTeX packages will use package options (I mean the options in \usepackage[...]{package}) for setup. However, I have noticed in some modern packages, e.g. siunitx, unicode-math, ctex, etc, one can set the options using a command, e.g. \sisetup.

Personally, I don't like passing too much options to a package so I prefer the later method. Could anyone give some advice on which method is better?

16

It is best to set things up using a \foosetup command and then (possibly) also make those options available as package options using kvoptions or similar packages.

the advantage of having a separate setup command is that it can be run more than once which avoids many issues with option clashes and also the package option list is somewhat aggressively normalised for expansion and white space which can interfere with option values that you may want to set. However for simple options it is often convenient to just set them in the \usepackage option list.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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