I would like my custom class to forward unknown keys to the base class, or in this case, a package.

The following works (to make the example smaller, this forwards only one key; expanding it to a list would clutter the code):

\ProvidesClass{mwe}[2020/02/17 MWE]



        \message{mwe found unknown key: \pgfkeyscurrentname}



Now the following document:


displays a frame, as expected.

But if I modify my code by replacing




then it does not work anymore:


gives me a DIN-A4 document. What's more, the custom message does not appear in the log, showing that the .unknown/.code was never executed at all.

Why is this? Am I doing something wrong?

PS: I originally had code similar to that provided in this answer, but that does not work, as you can see above.

Edit: forgot a line in my MWE.

  • Welcome! On my machine not even your working example works. It does say mwe found unknown key: showframe, as you describe, but then terminates with the error ! Package geometry Error: \paperwidth (0.0pt) too short.. What am I doing wrong?
    – user194703
    Commented Feb 17, 2020 at 18:03
  • @Schrödinger'scat: Thank you, of course. In my rush to minimize the MWE I deleted the \LoadClass line. The edited version works for me as described. Commented Feb 17, 2020 at 19:12

1 Answer 1


I figured out that it is the class beamer which kills it. Moving the \LoadClass statement to after the option processing makes it work as expected.

My best guess is that beamer uses some .unknown handler internally itself. I would still be glad for a more qualified explanation though.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .