[Tex/LaTex] TeXLive Pretest 2018: beamer and subfig collide

beamercaptionssubfig

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

Best Answer

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}}
Related Question