1

I'm looking at packages to document packages. cnltx-doc looked nice, so I thought I'd try it. However, it does this:

\ProcessPgfOptions{/cnltx-doc}

\let\@classoptionslist\relax
\LoadClass{scrartcl}

which means that any unrecognised options are lost rather than being passed onto scrartcl as they normally would be. This means, for example, that the following document fails to compile:

\documentclass[british]{cnltx-doc}
\usepackage{babel}

\begin{document}

another aardvark

\end{document}

with the usual Babel error complaining that no language has been declared. In contrast, replacing cnltx-doc with the underlying class, scrartcl, results in code which compiles fine as expected.

I assume there is some reason for throwing the options away, since it is non-standard, but I'm not at all sure what that reason might be. What problem does this solve or avoid?

I'd like to know because it would obviously be very easy to modify a derived class for my own use, and I'm wondering why I might not want to do that.

Note that I realise I can pass the option to Babel directly, but then I need to think about which other packages might need that information - including, potentially, packages which cnltx-doc loads directly. So then I start needing to \PassOptions... and it all gets messy rather quickly. Not to mention that there are other options I likely want to pass onto Koma or those packages....

There is an option for passing options to Babel. Unfortunately, this only has an effect if load-preamble is true. But load-preamble will apparently load the author's custom preamble and I don't wish to load that.

Is the bundle just not intended for use by others - at least, not in unmodified form? Am I supposed instead to clone and modify it? This is fine but it would mean I'd then need to post my modified version to CTAN to support documentation for my package, say, and so, of course, would everybody else.

In general, there are a lot of author-specific packages and classes on CTAN for documenting LaTeX packages.... I'm not adverse to creating my own, but I'd prefer not to rediscover fire if somebody else has already written brought out a recipe book explaining 101 ways to grill tofu.

1

You could have asked me directly :)

I actually never thought that anyone would want to use this class which is why there are some building sites left. You found the most obvious one which I long ago had forgotten about. IIRC this was meant as a temporary fix (?) for something which I forgot to do correctly later, probably because I never use global options myself if I can avoid them.

I'll send an update to CTAN later today.

5
  • BTW: the reason for the \let\@classoptionslist\relax was this behaviour: \documentclass[DIV={12}]{scrartcl}
    – cgnieder
    Aug 17 '15 at 9:41
  • Sorry. I wasn't actually sure whether the author was someone here or not. (I had no idea what your surname was.) But, also, I kind of assumed there must be a good reason for this and figured it might be useful to have the reasons for it documented somewhere. (Just because it obviously had to be a deliberate decision to do this - it isn't like a typo or something.)
    – cfr
    Aug 17 '15 at 10:59
  • And thanks for updating. I was planning to use doctools but I've run into some issues with that.
    – cfr
    Aug 17 '15 at 10:59
  • The reason was that class options with braces lead to errors when passed to scrartcl so I couldn't (and after the update can't) use \documentclass[load-preamble,babel-options={ngerman,english}]{cnltx-doc} – but since there's still \PassOptionsToPackage
    – cgnieder
    Aug 17 '15 at 11:07
  • That makes sense - thanks. I always pass the options for Babel directly so that other packages can pick them up (e.g. fancyref). So I'd just say \documentclass[load-preamble,ngerman,english]{cnltx-doc}. It is annoying that the key-value syntax breaks here, though.
    – cfr
    Aug 17 '15 at 11:12

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.