From 2a1fcb7ea9733db8fb65e96f53130ee78c5d5b35 Mon Sep 17 00:00:00 2001 From: Joseph Wright Date: Fri, 6 Jan 2017 10:37:53 +0000 Subject: [PATCH 1/2] Add missing arguments for \PackageError The command needs three arguments: \@ehc is the 'Press Enter to continue" generic advice. --- source/beamerfontthememetropolis.dtx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source/beamerfontthememetropolis.dtx b/source/beamerfontthememetropolis.dtx index 277809c..5988ca3 100644 --- a/source/beamerfontthememetropolis.dtx +++ b/source/beamerfontthememetropolis.dtx @@ -356,29 +356,29 @@ {\def\inserttitle{#2}}% {\def\inserttitle{\metropolis@titleformat{#2}}}% {}% - {\PackageError{beamerfontthememetropolis}{Patching title failed}} + {\PackageError{beamerfontthememetropolis}{Patching title failed}\@ehc} \patchcmd{\beamer@subtitle}% {\def\insertsubtitle{#2}}% {\def\insertsubtitle{\metropolis@subtitleformat{#2}}}% {}% - {\PackageError{beamerfontthememetropolis}{Patching subtitle failed}} + {\PackageError{beamerfontthememetropolis}{Patching subtitle failed}\@ehc} \patchcmd{\sectionentry} {\def\insertsectionhead{#2}} {\def\insertsectionhead{\metropolis@sectiontitleformat{#2}}} {} - {\PackageError{beamerfontthememetropolis}{Patching section title failed}} + {\PackageError{beamerfontthememetropolis}{Patching section title failed}\@ehc} \patchcmd{\beamer@section} {\def\insertsectionhead{\hyperlink{Navigation\the\c@page}{#1}}} {\def\insertsectionhead{\hyperlink{Navigation\the\c@page}{% \metropolis@sectiontitleformat{#1}}}} {} - {\PackageError{beamerfontthememetropolis}{Patching section title failed}} + {\PackageError{beamerfontthememetropolis}{Patching section title failed}\@ehc} \patchcmd{\beamer@subsection} {\def\insertsubsectionhead{\hyperlink{Navigation\the\c@page}{#1}}} {\def\insertsubsectionhead{\hyperlink{Navigation\the\c@page}{% \metropolis@sectiontitleformat{#1}}}} {} - {\PackageError{beamerfontthememetropolis}{Patching section title failed}} + {\PackageError{beamerfontthememetropolis}{Patching section title failed}\@ehc} % \end{macrocode} % % Similarly, to make the |\MakeLowercase| and |\MakeUppercase| macros work in @@ -400,7 +400,7 @@ \gdef\beamer@shortframetitle{#1}% }} {} - {\PackageError{beamerfontthememetropolis}{Patching frame title failed}} + {\PackageError{beamerfontthememetropolis}{Patching frame title failed}\@ehc} % \end{macrocode} % % From 30d207d6960a8cdead5b1a240e316f567060d5e7 Mon Sep 17 00:00:00 2001 From: Joseph Wright Date: Fri, 6 Jan 2017 10:52:53 +0000 Subject: [PATCH 2/2] Patch older and newer versions of beamer code The fixes in https://github.com/josephwright/beamer/commit/ef419391cbe5245cabf3b77c89b58023fb253c95 and https://github.com/josephwright/beamer/commit/ce790e640c0b41ab3adf764a79a9ef9475e37532 mean that a new patch route is needed. Patches cannot be nested (easily) so use two and a switch to track if an error is needed. --- source/beamerfontthememetropolis.dtx | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/source/beamerfontthememetropolis.dtx b/source/beamerfontthememetropolis.dtx index 5988ca3..09f6212 100644 --- a/source/beamerfontthememetropolis.dtx +++ b/source/beamerfontthememetropolis.dtx @@ -367,18 +367,38 @@ {\def\insertsectionhead{\metropolis@sectiontitleformat{#2}}} {} {\PackageError{beamerfontthememetropolis}{Patching section title failed}\@ehc} +\@tempswafalse \patchcmd{\beamer@section} {\def\insertsectionhead{\hyperlink{Navigation\the\c@page}{#1}}} {\def\insertsectionhead{\hyperlink{Navigation\the\c@page}{% \metropolis@sectiontitleformat{#1}}}} + {\@tempswatrue} {} - {\PackageError{beamerfontthememetropolis}{Patching section title failed}\@ehc} +\patchcmd{\beamer@section} + {\protected@edef\insertsectionhead{\noexpand\hyperlink{Navigation\the\c@page}{#1}}} + {\protected@edef\insertsectionhead{\noexpand\hyperlink{Navigation\the\c@page}{% + \noexpand\metropolis@sectiontitleformat{#1}}}} + {\@tempswatrue} + {} +\if@tempswa\else + \PackageError{beamerfontthememetropolis}{Patching section title failed}\@ehc +\fi +\@tempswafalse \patchcmd{\beamer@subsection} {\def\insertsubsectionhead{\hyperlink{Navigation\the\c@page}{#1}}} {\def\insertsubsectionhead{\hyperlink{Navigation\the\c@page}{% \metropolis@sectiontitleformat{#1}}}} + {\@tempswatrue} {} - {\PackageError{beamerfontthememetropolis}{Patching section title failed}\@ehc} +\patchcmd{\beamer@subsection} + {\protected@edef\insertsubsectionhead{\noexpand\hyperlink{Navigation\the\c@page}{#1}}} + {\protected@edef\insertsubsectionhead{\noexpand\hyperlink{Navigation\the\c@page}{% + \noexpand\metropolis@sectiontitleformat{#1}}}} + {\@tempswatrue} + {} +\if@tempswa\else + \PackageError{beamerfontthememetropolis}{Patching section title failed}\@ehc +\fi % \end{macrocode} % % Similarly, to make the |\MakeLowercase| and |\MakeUppercase| macros work in