Menu

#1 scrbase breaks option handling of LaTeX 2020-05-01

LaTeX 2021-06-01
closed
2021-05-17
2021-03-02
Markus Kohm
No

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

Related

Issues: #38
Wiki (Deutsch): HowTo_NumbersAtOuterMargin
Wiki (English): HowTo_NumbersAtOuterMargin

Discussion

  • Markus Kohm

    Markus Kohm - 2021-03-02

    The reason of the issue is the usage of \in@. \in@ explicitly does not support braces. A poor man's loop like

    \in@false
    \@for \reserved@a:=\@declaredoptions\do{%
       \ifx\CurrentOption\reserved@a\in@true\fi
    }%
    

    instead of

    \in@{,\CurrentOption,}{,\@declaredoptions,}
    

    could solve this. Maybe \CurrentOption should be

    Maybe 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
  • Markus Kohm

    Markus Kohm - 2021-03-05
    • status: open --> pending
     
  • Markus Kohm

    Markus Kohm - 2021-03-12
    • status: pending --> closed
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.