How can I parse (that is, access) the entire option list given to the current document class with l3keys?

This would obviously need some sort of

\keys_define:nn { document-class-?? }
  default .code:n { \PassOptionToClass { \l_keys_key_tl } { article } }

but I don't know where to look for the document-class option list to give to \keys_set:nn.

  • Looking at some of my code, I see I've used \ProvidesExplClass and \ProcessKeysOptions{<my choice of prefix>} where <my choice of prefix> is what I've used in the \keys_define:nn. So I think that l3keys has this functionality built in. – Andrew Stacey Dec 24 '13 at 6:39
  • @AndrewStacey Doesn't seem to be working; \ProcessKeysOptions seems to be undefined. Refer – Sean Allred Dec 24 '13 at 7:47

The l3keys modules provides general purpose keyval processing for expl3 code. However, it does not interact with LaTeX2e's package or class option system. For that, you need to load some additional code, which is available in the package l3keys2e. This provides the \ProcessKeysOptionscommand to parse class/package options and process them using keyvals defined by l3keys.

The reason for this separation is that l3keys is intended to form part of a LaTeX3 kernel, while l3keys2e is tied to the LaTeX2e model for processing options. It seems extremely likely that a stand-alone LaTeX3 kernel will use keyval options 'natively' but with a different underlying implementation.

| improve this answer | |
  • 1
    It seems that the options are getting set, but I can't manage to suppress the warning of LaTeX Warning: Unused global option(s): [minp=25,maxp=30]. where I'm still getting the correct warnings. (I implemented target page bounds.) – Sean Allred Dec 24 '13 at 19:59
  • @SeanAllred I'll need a demo for that! – Joseph Wright Dec 24 '13 at 22:25
  • 1
  • @JosephWright I'm facing exactly the same trouble as Sean Allred. Do you see what's going on? – Denis Bitouzé Feb 5 '15 at 15:14
  • @DenisBitouzé MWE (by e-mail or whatever)? I think the problem in Sean's example is \LoadClassWithOptions not with l3keys2e. – Joseph Wright Feb 5 '15 at 20:28

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.