4

I am trying to emulate LaTeX 2020-10-01 on a system still using LaTeX 2020-02-02 PL 5. I have downloaded the latest version of latexrelease.sty from GitHub. However, the following MWE fails:

\RequirePackage[2020/10/01]{latexrelease}
\documentclass{article}

\begin{document}

Test.

\end{document}

I get:

! Undefined control sequence.
l.1911 \NewDocumentCommand
                           \NewHook             { m }{ \hook_new:n {#1} }
? 

What am I doing wrong?

16
  • 3
    Your input is correct and it should work. Marking all latexrelease tags in the source code is hard and we've obviously got something wrong along the way. Could you please report an issue at github.com/latex3/latex2e/issues? Nov 24, 2020 at 16:00
  • It's interesting to find a user in the 'real world' using the roll-forward possibility: it might be useful to outline your set up (purely for informing development, not directly for fixing the issue).
    – Joseph Wright
    Nov 24, 2020 at 16:02
  • Note that roll forward can help in simple cases but in general things can not work well, for example for this release one or two packages updated to work better with the new format but if you have an old distribution and just roll forward the base latex, you end up with an untested situation with new format code but all the packages in your installation are still old. If it helps in some cases of sharing documents with newer installations it is good but if it fails it is not totally unexpected . (although this failure is with one of our own packages, xparse so we can fix that) Nov 24, 2020 at 16:16
  • @PhelypeOleinik I opened an issue at GitHub.
    – user227621
    Nov 24, 2020 at 16:37
  • 1
    @user227621 I have a corrected latexrelease.sty more or less ready and will post it soon. Nov 25, 2020 at 11:26

1 Answer 1

5

As mentioned in the comments the main reason for latexrelease is being able to roll back. Roll forward is much harder to manage (and to test) and given that we now offer development release which are ahead of the official release less needed.

Having said this, the current latexrelease was/is simply buggy when it comes to rolling forward. For one it had the code in a different order than it is in the kernel (which doesn't matter much when rolling back but matters a lot when rolling forward). And there have been a number of other issues that I found when trying to do roll forward using earlier TeXLive releases as a starting point.

I think I have fixed all of them but I only tested from yearly releases as it is rather difficult to build a release from say 2020-02-02 just for testing. So fingers crossed but you may want to check out if the following file works for you:

https://pastebin.com/raw/sZFgEwMr

pastebin told me it is perhaps offensive content :-) (probably because the word latex appears a lot?) but it should be just the package code.

Update

I should note that rolling forward using latexrelease is obviously only rolling forward the kernel files (as these are the only ones that can be patched this way). While rolling back can also be done for package, that is obviously not possible when rolling forward, because the package from 2019 can't know what changes it needs in 2020. For the kernel that also only works by getting a new LaTeX release from 2020 and using that to patch a 2019 kernel.

So concerning the comment below: amsmath is still on 2019 version and that version used \newcommand for \negmedspace and this breaks because patching the kernel to 2020 defines that command already in the kernel.

Possible solutions: either update amsmath to 2020 or try

\RequirePackage[2020/10/01]{latexrelease}

\AddToHook{package/before/amsmath}{%
  \let\negmedspace\relax
  \let\negthickspace\relax
}

Explanation: after using latexrelease the new hook management scheme is available so we can state that just before loading amsmath it should undefine the problem commands.

But not that this only works because the change here is trivial. If more had changed in amsmath that need updating it really would get out of hand.

4
  • The MWE works. But if I add \usepackage{amsmath}, I get ! LaTeX Error: Command \negmedspace already defined. Or name \end... illegal, see p.192 of the manual. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.169 ...egmedspace}{\tmspace-\medmuskip{.2222em}} ? .
    – user227621
    Nov 25, 2020 at 13:51
  • @user227621 you are seriously testing out the roll forward ... that was a bug we actually introduced and thought that it was fixed, obviously not in the rollback/forward code. I'll check. Nov 25, 2020 at 14:18
  • @user227621 see my updated post Nov 25, 2020 at 16:32
  • Thanks! Using amsmath now also works, although I see that this is not a general approach. Indeed, one should be aware of the limitations of rolling forward.
    – user227621
    Nov 25, 2020 at 19:29

You must log in to answer this question.

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