[texhax] Automated package option choice possible?

Uwe Lueck uwe.lueck at web.de
Mon Sep 13 22:40:34 CEST 2010

"Beuthe, Thomas" <beuthet at aecl.ca>, 13.09.2010 22:13:49:
> There are at least two packages that require option choices 
> that depend on what program you are using to compile your LaTeX files:
> color and hyperref.
> Compile in pdflatex?  You need to use the pdftex option.
> Using xelatex? You need to use xetex option, and so on.
> Are there other packages that have similar requirements? (I'm curious)
> My main question: Is there any way of automating the choice of options?
> i.e.
> if(packagebeingusedtorun=xelatex) then
>   \usepackage[xetex]{color}
>or something like that?

Yes, it is, for a number of engines. The ones I know are `ifluatex', `ifpdf', `ifvtex', and `ifxetex': 

    http://ctan.org/pkg/ifluatex (etc.)



> I know I could always centralize the choice to a single variable that gets set once,
> but is there a way of getting away from setting this choice manually?
> I'm guessing there is not since the packages themselves would have probably
> done this already if it was possible, but I just wanted to throw this question out there...

More information about the texhax mailing list