scrbase breaks option handling of LaTeX 2020-05-01
KOMA-Script is a bundle of versatile LaTeX classes and packages
Brought to you by:
kohm
The new option handling of LaTeX 2021-05-01 allows:
\documentclass[foo=bar,bar={foo}]{article} \begin{document} \end{document}
without error. There is only a message:
LaTeX Warning: Unused global option(s): [foo,bar].
Former LaTeX versions reported an error:
LaTeX Error: Missing \begin{document}. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.113 \input {size1\@ptsize.clo}
But scrbase
breaks the new option handling of LaTeX 2020-05-02:
\documentclass[foo=bar,bar={foo}]{article} \usepackage{scrbase} \begin{document} \end{document}
results in:
! LaTeX Error: Missing \begin{document}. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.502 \FamilyProcessOptions{KOMA} \relax
Issues: #38
Wiki (Deutsch): HowTo_NumbersAtOuterMargin
Wiki (English): HowTo_NumbersAtOuterMargin
The reason of the issue is the usage of
\in@
.\in@
explicitly does not support braces. A poor man's loop likeinstead of
could solve this. Maybe
\CurrentOption
should beMaybe rewriting the whole code using the LaTeX 3 layer of LaTeX 2021/05/01 would be an alternative approach. In this case we could use
\clist_map_inline:Nn
and\clist_map_break:
to increase speed. On the other hand, classes and packages, that use\FamilyProcessOptions
shouldn't have several dozens of options declared using\DeclareOption
(instead of\DefineFamilyKey
etc.). So the poor man's loop should be fast enough.BTW:
\FamilyProcessOptions
is based on LaTeX's\ProcessOptions*
. LaTeX2e <2021-05-01> pre-release-2 (develop 2021-3-2 branch) has the same issue with\ProcessOptions*
. So maybe I should wait with the final implementation until this will be fixed. Then I could (again) use the fixed\ProcessOptions*
code as a template for my own changes.I've commited a kind of early fix (as shown above). This could be fixed again, after
\ProcessOptions*
will have been fixed in the LaTeX kernel.Related
Commit: [r3576]
Last edit: Markus Kohm 2021-03-04
The LaTeX kernel now uses the fast check I've suggested in https://github.com/latex3/latex2e/issues/513#issuecomment-789082387 and so do I.
Related
Commit: [r3578]
Last edit: Markus Kohm 2021-03-12