1

I've been writing my own class and all the tutorials I've found use the following command to handle font options:

\DeclareOption{sansserif}{
  \PassOptionsToPackage{\CurrentOption}{paxcommands}
}

The problem is that if I use my class with the sansserif option, nothing changes.

Do I need to define paxcommands somewhere or how can I make it work?

Kajsa
  • 677
  • 2
    The only mentions I can find of paxcommands seems to come from https://en.wikibooks.org/wiki/LaTeX/Creating_Packages, have you seen it elsewhere? Probably just a dummy package name used in the Wikibook. – Torbjørn T. Aug 25 '17 at 12:42
  • @TorbjørnT. It's on github, and in some tutorials and shell classes I've used. – Kajsa Aug 25 '17 at 14:25
  • 1
    I think I saw that as well, but given the identical syntax, and that that class on GitHub is almost two years newer than the first appearance of paxcommands in the Wikibook, I'm inclined to guess that Daniel Chatfield took the example from the Wikibook, and never removed those unused parts. That is pure conjecture though. As @campa says, there should be a package called paxcommands, but Google for "paxcommands.sty" and you'll find nothing. Not CTAN, not GitHub, or anywhere else Google looks. – Torbjørn T. Aug 25 '17 at 14:53
  • Looking again at the Wikibook, I suspect that the package name should have been custom instead of paxcommands, given the description of making a custom.sty package that appears first on that same page. – Torbjørn T. Aug 25 '17 at 14:58
  • custom.sty has a sans option (not sansserif), and also a neverindent option. I'm going to edit the Wikibook, to fix this. – Torbjørn T. Aug 25 '17 at 15:00

1 Answers1

4

As campa mentioned in a comment, \PassOptionsToPackage{<list of options>}{<package name>} passes the options given in the first argument to the package given in the second. Hence, there should have been a paxcommands.sty somewhere. No such package exists on CTAN, GitHub, or anywhere else Google can look.

While paxcommands occurs in code 17 places on GitHub, all those occurrences are similar or identical to the one you refer to. I'm fairly certain that the origin is a (somewhat) bad edit made to the LaTeX Wikibook in January 2013. None of the 17 files on GitHub predate this.

What the code on the Wikibook should have said is most likely

%% Custom package options
\DeclareOption{sans}{
  \PassOptionsToPackage{\CurrentOption}{custom}
}
\DeclareOption{neverindent}{
  \PassOptionsToPackage{\CurrentOption}{custom}
}

where custom is the name of the custom package that is described on that same page. custom.sty defines both a sans option (which just does \renewcommand{\familydefault}{\sfdefault}) and a neverindent option, for setting the paragraph indentation to zero.

Note further that the Wikibook had \RequirePackage{custom} near the end of that class.

(I have submitted an edit, which is waiting for review, to the Wikibook making that change.)

Torbjørn T.
  • 206,688