# TeXLive Pretest 2018: beamer and subfig collide

\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)

• I'm voting to close this question as off-topic because TeX.SX is not an issue tracker. – Henri Menke Apr 11 '18 at 23:51
• @HenriMenke why beamer, the code is in caption? – David Carlisle Apr 11 '18 at 23:54
• @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 '18 at 23:57
• @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 '18 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{%
\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
{%

• 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 '18 at 6:17
• @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 '18 at 6:57
This bug has been fixed in https://gitlab.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.