0

Here is a small class lib.cls:

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{lib}[2017/03/17 lib]
\RequirePackage{libertine}
\LoadClass{article}

which with pdflatex works fine when tested with

\documentclass{lib}
\begin{document}
test
\end{document}

but with lualatex I get an error The font size command \normalsize is not defined from .../texlive/2016/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty. Is there a better way to use that font that will work then too, or does the class need to have a conditional and do different things depending on the engine?

3
  • 1
    if you loaded it after article \normalsize would be defined Commented Mar 17, 2017 at 12:32
  • Thanks! Seems obvious afterwards. Maybe I should remove this question? For the actual class the font settings are determined by options to this class, and then the order seemed natural to me; (1) take care of the options, (2) \ProcessPgfOptions, (3) \LoadClass. But just remembering the font option and taking care of that afterwards works fine when I tested now (for both engines and all my font options). So I am helped. I will accept the comment as an answer, or else remove the question to avoid clutter.
    – pst
    Commented Mar 17, 2017 at 12:48
  • 1
    it's safer really to load the font package later. The order you had works with article as that just lets the default fonts fall through from the initial format settings, but if you had a class that did as you are doing, and setting fonts within the class, then setting the font before hand would give no error but the settings would be undone by the loaded class. Commented Mar 17, 2017 at 12:58

1 Answer 1

2

If you loaded the package after article class \normalsize would be defined.

You must log in to answer this question.

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