matze / mtheme

A modern LaTeX Beamer theme
6.38k stars 843 forks source link

Issue with texlive 2023 #393

Open jdtuck opened 1 year ago

jdtuck commented 1 year ago

Getting the following error

! Package beamerfontthememetropolis Error: Patching frame title failed.

See the beamerfontthememetropolis package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.308 ...theme}{Patching frame title failed}\@ehc}

any ideas?

noctux commented 1 year ago

Hmm, actually, beamer itself seems to have implemented a workaround for that one:

https://github.com/josephwright/beamer/blob/a9b7aefd30d6a46824de01a5220209045c2c7f7d/base/beamerbasecompatibility.sty#L254

Please note that this only triggeres if the .sty is called beamerfontthememetropolis.sty.

ArneMeier commented 1 year ago

I get a similar error Package beamerfontthememetropolis Error: Patching section title failed.

I am using [2017/01/23 v1.2 Metropolis Beamer theme] and [2023/05/15 v3.70 A class for typesetting presentations] plus pdfTeX 3.141592653-2.6-1.40.25 (TeX Live 2023).

hbjaili commented 1 year ago

I have the same issue with Texlive and Miktex. Any solution?

hbjaili commented 1 year ago

Hmm, actually, beamer itself seems to have implemented a workaround for that one:

https://github.com/josephwright/beamer/blob/a9b7aefd30d6a46824de01a5220209045c2c7f7d/base/beamerbasecompatibility.sty#L254

Please note that this only triggeres if the .sty is called beamerfontthememetropolis.sty.

So will the issue disappear if we change the .sty name to a different one? What should be renamed to?

noctux commented 1 year ago

So will the issue disappear if we change the .sty name to a different one? What should be renamed to?

Hmm, probably not, sorry for causing confusion here :/

Background: I had the above issue for another theme derived from metropolis. But this theme has renamed source files, so the hooks did not trigger. What I then did was:

(Please note that THEME here constitutes a placeholder for the derived theme)

\@ifclasslater{beamer}{2023/02/20}{%
    % The hooks where first defined for v3.69
    \AddToHook{file/beamerfontthemeTHEME.sty/before}{\UseHook{file/beamerfontthememetropolis.sty/before}}
    \AddToHook{file/beamerfontthemeTHEME.sty/after}{%
        \let\metropolis@frametitleformat\THEME@frametitleformat
        \UseHook{file/beamerfontthememetropolis.sty/after}
    }
}{}

This triggeres beamer's patching hooks even though your sty was renamed. That way, beamer's compatibilitypatches got applied and compilation was fixed for me.

But this is only necessary if your theme variation actually renames the file. For the vanilla metropolis theme, beamerfontthememetropolis.sty should be present and get patched correctly (given an up to date Beamer version, so 2023/02/20 as can be seen in the snippet above).

So if you use the standard metropolis theme, your best chances are to check whether you are using an up to date beamer version. If this does not work or is not an valid option, you could take a look at what the beamerbasecompatibility.sty-patches that beamer-version applies do and try to manually apply them/copy them to your metropolis variation/document.

Edit to add: This is the relevant beamer issue: https://github.com/josephwright/beamer/issues/802

hbjaili commented 1 year ago

Well, a standard metropolis works ok. However, when using it with Polyglossia I get the error.

hbjaili commented 1 year ago

This line triggers the error:

\setdefaultlanguage[numerals=maghrib]{arabic}

hbjaili commented 1 year ago

I solved my own problem by calling this:

\usetheme[progressbar=frametitle,sectionpage=none]{metropolis}

Before this: \usepackage{polyglossia}

Thx