3

Before an update of TeXLive distribution, I used without problem the menukeys package. Since the update (a couple of days), the results are correct (PDF) but the following compilation error occurs (PDFLaTeX and LuaLaTeX):

 ! Extra \endgroup.
\document ->\endgroup 
    \let \BeforeStartOfDocument \@firstofone \cpt@beforestartdoc \let \BeforeStartOfDocument \@notprerr \gundefcs \cpt@beforestartdoc \gdef \cpt@docstarted {}\begingroup \UseOneTimeHook {begindocument/before}\@kernel@after@begindocum...
l.11 \begin{document}

Tracing back to the error with a MWE, it seems that the catoptions package induces the issue. The fact that this package has not been updated for several years is disturbing...

From where this issue may be coming from ?

MWE

\documentclass[10pt]{article}
\usepackage[a4paper,margin=1in]{geometry}
%\usepackage{menukeys}% Compilation error
\usepackage{catoptions}% Same compilation error

\begin{document}

\section{Menukeys test}

Where is the issue ? %\menu{File>New File}

\end{document}

ejazz
  • 1,047
  • catoptions is broken in the new LaTeX kernel because it does some heavy patching of internal commands. The author was already contacted, but no response so far – Phelype Oleinik Oct 08 '20 at 12:55
  • the menukeys author has been notified some time ago too, and there is also an issue in the github: https://github.com/tweh/menukeys/issues/59 – Ulrike Fischer Oct 08 '20 at 12:59
  • Thanks for your prompt and useful remarks. – ejazz Oct 08 '20 at 14:17

3 Answers3

3

catoptions is incompatible with a lot of latex code and finally does not work at all in the current latex release. Until it is updated you can roll back the changes as follows

\RequirePackage[2020-02-02]{latexrelease}
\documentclass[10pt]{article}
\usepackage[a4paper,margin=1in]{geometry}
%\usepackage{menukeys}% Compilation error
\usepackage{catoptions}% Same compilation error

\begin{document}

\section{Menukeys test}

Where is the issue ? %\menu{File>New File}

\end{document}

David Carlisle
  • 757,742
2

If you install the latest version of menukeys everything should work out as intended. Since 2020-10-31 (v1.6) menukeys no longer requires the catoptions package and therefore is again compatible with LaTeX2e.

\documentclass[10pt]{article}
\usepackage[a4paper,margin=1in]{geometry}
\usepackage{menukeys}% no compilation error

\begin{document}

\section{Menukeys test}

There is no issue! \menu{File>New File}

\end{document}

Skillmon
  • 60,462
  • Thank you, yes, you're right. I have noticed the new version which works fine now, but I did not dare to answer since the question was old fashioned: nevertheless, accepted answer for you! – ejazz Mar 15 '21 at 13:38
  • @ejazz good to hear that your problem was already resolved by the update! I just thought it might be a good idea to "document" this here for future visitors (and possibly you, if you didn't notice until now). – Skillmon Mar 15 '21 at 19:56
  • You're right again. It's better like that. – ejazz Mar 16 '21 at 09:24
1

EDIT: As pointed out by ejazz, the below is merely a workaround.

I reverted with tlmgr by doing

$ tlmgr restore latex
Available backups for latex: 53958 (2020-10-08 13:20)
$ tlmgr restore latex 53958

and now I can compile documents using menukeys again without any error.