Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

\newcommand in latexrelease.sty #295

Closed
aminophen opened this issue Feb 28, 2020 · 12 comments
Closed

\newcommand in latexrelease.sty #295

aminophen opened this issue Feb 28, 2020 · 12 comments

Comments

@aminophen
Copy link
Contributor

Brief outline of the bug

I guess \newcommand should not be used inside latexrelease.sty. With 'develop' branch, I get the following error when processing the MWE:

! LaTeX Error: Command \DeclareFontSeriesDefault already defined.
               Or name \end... illegal, see p.192 of the manual.

Currently there are four:

\newcommand\DeclareFontSeriesDefault[3][]{%
\newcommand\ulcdefault{ulc}
\newcommand\swdefault{sw}
\newcommand\sscdefault{ssc}

Minimal example showing the bug

\RequirePackage[2020/02/02]{latexrelease}
\stop

Log file (required) and possibly PDF file

@FrankMittelbach
Copy link
Member

Looks to me more like a bug in the logic: if we have the following sequence of \IncludeInRelease

\IncludeInRelease{2019/10/01}{\filename@simple}
                             {Final dot for extension}%
\IncludeInRelease{0000/00/00}{\filename@simple}
                             {Final dot for extension}%

And we are asking for reverting to 2020-02-02 and the current format is 2020-10-01 then it contains the 2019/10/01 patch already and so we should not "reapply" it (but we do).

In contrast if we ask for 2018-01-01 we skip the 2019/10/01 code but execute the 0000/00/00 code.

In other words, if we move backwards I need to skip the first patch (because that is only there for forward patching).

\newcommand is one example where reapplying fails (and could be correct by not using it) but others are allocating registers again etc. So perhaps better to think once more how to get the logic fully right.

@FrankMittelbach FrankMittelbach added this to Pool (unscheduled issues) in upcoming LaTeX2e releases via automation Mar 2, 2020
@FrankMittelbach FrankMittelbach added this to the release 2020 fall milestone Mar 2, 2020
@aminophen
Copy link
Contributor Author

Looks to me more like a bug in the logic

Oh... I guess so too. I wasn't aware of that, thanks

@FrankMittelbach
Copy link
Member

well, both really. @davidcarlisle correctly pointed out to me that we need to take care of the newcommands nevertheless because if something is changed twice and both use newcommand it still breaks even if we skip over the last patch which is equal to what is in the format.

So I will go and fix that first. The logic part is not so important, eg reapplying definitions is then not a problem and burning a few registers is not a problem either given that we have enough these days.

@FrankMittelbach FrankMittelbach self-assigned this Mar 2, 2020
@FrankMittelbach FrankMittelbach moved this from Pool (unscheduled issues) to To do in upcoming LaTeX2e releases Mar 2, 2020
FrankMittelbach added a commit that referenced this issue Mar 2, 2020
…ce will probably stay;

fixed ltexpl3 because that also loaded expl3 during rollback and that dies ...(may need refinement)
@FrankMittelbach
Copy link
Member

Added the necessary \@undefined and discovered a second bug in latexrelease: it attempts to reload expl3.ltx. I turned that off, but I'm not sure the way I did it is the right solution. Can you @josephwright, @davidcarlisle have a second look please?

@PhelypeOleinik
Copy link
Member

About expl3.ltx, the change seems okay to me. However, shouldn't
expl3.ltx be made reload-safe safe, same as expl3.sty? Granted, it
probably won't be reloaded as frequently as expl3.sty, but still...

@FrankMittelbach
Copy link
Member

@PhelypeOleinik I'm not sure it is necessary as it should never get loaded other than in the format or in a rollback situation (or should it?), but please feel free to check in an improved version into that branch. It would certainly be safer.

@PhelypeOleinik
Copy link
Member

@FrankMittelbach Yes, that file should only be loaded by the format and
the rollback, but the rollback seems enough to make it reload-safe.
Shouldn't be hard: most of it already is so because of expl3.sty. I'll do it

@davidcarlisle
Copy link
Member

@FrankMittelbach looks Ok to me and worked with works with some additional simple tests, merge back to develop?

@FrankMittelbach
Copy link
Member

@PhelypeOleinik wanted to make it reload safe. Not sure it is really needed but it doesn't hurt either. So I guess we'll wait until he is done with that. No urgency .

@PhelypeOleinik
Copy link
Member

@FrankMittelbach That I do at the expl3 side, not here. The code is
common to expl3.sty, so you can merge this back (I think). I'll do the
re-load thing in a bit

@davidcarlisle
Copy link
Member

davidcarlisle commented Mar 2, 2020 via email

@PhelypeOleinik
Copy link
Member

@davidcarlisle Yeah, I noticed this right after commenting :-)
Sorry about the noise

@FrankMittelbach FrankMittelbach added the fixed in dev Fixed in development branch, not in stable release label Mar 2, 2020
@FrankMittelbach FrankMittelbach moved this from In progress to Done in dev in upcoming LaTeX2e releases Mar 2, 2020
PhelypeOleinik added a commit to latex3/latex3 that referenced this issue Mar 3, 2020
upcoming LaTeX2e releases automation moved this from Done in dev to Done May 28, 2020
@FrankMittelbach FrankMittelbach removed the fixed in dev Fixed in development branch, not in stable release label Jun 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

5 participants