\documentclass{beamer}

\usepackage{subfig}

\begin{document}

test

\end{document}

returns undefined control sequence \@@magyar@captionfix

(It was not so in January; I am on fully updated pretest)

  • 1
  • 1
    I'm voting to close this question as off-topic because TeX.SX is not an issue tracker. – Henri Menke Apr 11 at 23:51
  • 9
    @HenriMenke IMO that's not a good reason to close, for a few reasons: (1) I It's hard in general for a user, encountering some trouble with getting their work done, to know whether something is a real issue to be reported, or just something they ought to do differently, (2) Even if it seems a bug, the “proper place” to report is often not clear: is hard to know which package/code has an issue, (3) Even if it's a bug that can be reported at an issue tracker, usually users just want to learn a workaround from TeX experts so that they can continue getting their work done. So it's on-topic IMO. – ShreevatsaR Apr 11 at 23:57
  • 1
    @ShreevatsaR “User clearly knows that it is a bug. Then the question should be closed as not a real question.” tex.meta.stackexchange.com/questions/2622/… – Henri Menke Apr 12 at 0:15
  • 5
    @HenriMenke the code is not in beamer or in subfig, it is in caption3.sty. As explained in the accepted answer of the meta question you linked to if the question is not clearly just a bug report on a known package there is merit in asking the question and answering it here – David Carlisle Apr 12 at 0:19

It is enough to add a definition of the command to \relax

\documentclass{beamer}

\usepackage{subfig}

\makeatletter
\let\@@magyar@captionfix\relax
\makeatother
\begin{document}

test

\end{document}

This is due to a change to \@ifundefined in the 2018 LaTeX release.


caption3.sty has

  \@ifundefined{@@magyar@captionfix}\AtBeginDocument\@firstofone{%
    \g@addto@macro\@@magyar@captionfix{%
      \let\caption@lfmt@simple@magyar\caption@lfmt@simpleMagyar
      \let\caption@lfmt@simpleMagyar\caption@lfmt@default@magyar}}

which relies on the side effect that \@ifundefined defines the tested command to be \relax. That side effect is almost always unwanted and in the 2018 LaTeX release this is changed, as noted in LaTeX News 28. I have mailed the author suggesting

  \@ifundefined{@@magyar@captionfix}%
   {\let\@@magyar@captionfix\@empty\AtBeginDocument}
   \@firstofone
   {%
    \g@addto@macro\@@magyar@captionfix{%
      \let\caption@lfmt@simple@magyar\caption@lfmt@simpleMagyar
      \let\caption@lfmt@simpleMagyar\caption@lfmt@default@magyar}}
  • 2
    Wow, \@ifundefined changed... While I perfectly understand the reason behind, this is a pretty fundamental kernel macro that now behaves differently. I am afraid we are going to see a lot of similar version clashes for a long time. – Daniel Apr 12 at 6:17
  • 3
    @Daniel we see clashes all the time here (and before that on c.t.t) with one package doing \ifx\foo\@undefined and it working until another package does \@ifundefined{foo} there are really very few legitimate cases where a package intentionally uses the implicit \let to \relax intentionally (we found two and changed them before the release) the use here missed our search but the previous behaviour, although it avoided an error here was clearly accidental, it defined \@@magyar@captionfix to be an infinite loop – David Carlisle Apr 12 at 6:57
  • 1
    That is good to know and I don‘t question the reasons behind (your example how one undefined test changes the outcome of another is more than convincing...). In fact, I truely trust you guys in this respect. My comment was more about the general tragedy behind having to fix fundamentally flawed behavior in some API that nevertheless has a widespread use. It always is a dilemma. – Daniel Apr 13 at 5:24

This bug has been fixed in https://github.com/axelsommerfeldt/caption/commit/e03e61eb7c5987644cb1d8ed336dbb5e8ee2f96f and should be included version v1.7-167 of the caption3 package

Given what samcarter and Axel Sommerfeldt report above, that the bug has been fixed and put on the CTAN, you may want to consider updating the caption library files, and for that matter, freshen all your installed LaTeX files. If you have a TexLive installation, the way to do this is given here, namely, from the command line: sudo tlmgr update --self, then sudo tlmgr update --all. I did this and it fixed the problem.

  • Then either you already have TL 2018 or you are still using an earlier edition. Note that the question concerned the pre-test and was posted in April .... Can you update using this command from pre-test to release? – cfr Jun 15 at 3:20
  • @cfr Yes, I already had TexLive-2018 installed and ran into this bug. But I’m afraid I don’t know how to do what you suggest. – Andrew Sundstrom Jun 15 at 3:26

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.