renewed \ProcessOptions*

David Carlisle d.p.carlisle at gmail.com
Fri Nov 24 12:31:03 CET 2023


Thanks for the report, we'll look.

Note that tex-live can only distribute unchanged files from ctan, who in
turn only distribute unchanged files from the authors. So this isn't the
right place to report these things.

If you could report it at https://github.com/latex3/latex2e/issues it would
help to track any discussion and/or changes that result,

thanks


However, to answer your question

> Wasn*'*t* \@expandtwoargs\in@{,\CurrentOption,}{,\@declaredoptions,}*
> good enough to test is global option in  current packages options?

the code changed for issue 513

https://github.com/latex3/latex2e/issues/513

But I'll need to check over the weekend if your example is an expected
change or a bug or whatever.

David


On Thu, 23 Nov 2023 at 21:29, Linas Stonys <lstonys at vtex.lt> wrote:

> Hi,
> I noticed that \ProcessOptions* acts different  in TL2019 and TL2023. In
> older Tl if option is global (used in \documentclass)
> then inside package it only evaluate that option  if it declared inside
> package. Now the behavior is changed.  If you declare
> option in style file and do not use \ProcessOptions then these options
> will be processed in other package (in next \ProcessOptions* ).
> For example  I use same options for many classes and I put them in
> separate style file (*myoptions.sty*) an load it in the class with .
> There is only one option
> \DeclareOption{showbug}{\AtEndOfClass{\IamBug}}
> and in the class file I add
> \let\IamBug\empty
> so I expect to compile normally but with TL2023 I'll get  "\IamBug
> undefined error" because showbug option
> will be executed not in class but in the inside class I loaded package (
> *simplepackage.sty*)
>
> HERE is the \ProcessOptions* responsible macro
> \def\@xprocess at ptions{%
>   \ifx\@currext\@clsextension\else
>    \ifx\@classoptionslist\relax\else
>     \@for\CurrentOption:=\@classoptionslist\do{%
>       \ifx\CurrentOption\@empty\else
>        % *\@expandtwoargs\in@{,\CurrentOption,}{,\@declaredoptions,}%
> TL2019 was this*
>        *
> \@ifundefined{ds@\detokenize\expandafter{\CurrentOption}}{}{%           %
> TL2023 *
>           \@use at ption
>           \expandafter\let\csname ds@\CurrentOption\endcsname\@empty
>         }%
>       \fi}%
>     \fi
>   \fi
>
> Wasn*'*t
> * \@expandtwoargs\in@{,\CurrentOption,}{,\@declaredoptions,} *good enough
> to test is global option in  current packages options?
>
> Here is min example files
>
> * myclass.tex*
> \documentclass[showbug]{myclass}
> \begin{document}
> aa
> \end{document}
>
> *myclass.cls*
> \NeedsTeXFormat{LaTeX2e}
> \ProvidesClass{myclass}[]
> \RequirePackage{myoptions}
> %\input myoptions.sty
> \ProcessOptions
> \RequirePackage{simplepackage}
> \def\normalsize{}
> \let\IamBug\empty
> \endinput
>
>
> * myoptions.sty *\ProvidesPackage{myoptions}[]
> \DeclareOption{showbug}{\AtEndOfClass{\IamBug}}
> \endinput
>
> * simplepackage.sty*
> \NeedsTeXFormat{LaTeX2e}[1999/12/01]
> \ProvidesPackage{simplepackage}[]
> \DeclareOption{opt2}{\dnothing}
> \expandafter\show\csname simplepackage.sty-h@@k\endcsname
> % here it shows ->.
> \ProcessOptions*\relax
> \expandafter\show\csname simplepackage.sty-h@@k\endcsname
> % here it shows ->\IamBug \expandafter \let \csname
> unprocessedoptions-\@currname .\@currext \endcsname \relax .
> \endinput
>
> Is it a bug in \ProcessOptions* and it will be changed to previous version?
>
> Thanks,
> Linas
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/tex-live/attachments/20231124/3ddff0f8/attachment.htm>


More information about the tex-live mailing list.