From 1cc7d52dd8ef1d55384d7ad25dcd32109eabbd61 Mon Sep 17 00:00:00 2001 From: Michael Roland Date: Thu, 7 Mar 2024 16:25:29 +0100 Subject: [PATCH 1/3] permit \tightlist to be also used as command inside lists (and not only as environment wrapping a list) (see issue #7) --- beamerthemejku.sty | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/beamerthemejku.sty b/beamerthemejku.sty index 3f38ae5..ec65e21 100644 --- a/beamerthemejku.sty +++ b/beamerthemejku.sty @@ -1970,21 +1970,26 @@ % Environment tightlist: Tighter line spacing for itemize/enumerate lists (wrap any list within this environment) \newenvironment{tightlist}{% - \begingroup% - \def\@listi{\leftmargin\leftmargini - \topsep 0\p@ \@plus\p@ - \parsep 0\p@ \@plus\p@ - \itemsep \parsep}% - \let\@listI\@listi% - \def\@listii{\leftmargin\leftmarginii - \topsep 0\p@ \@plus\p@ - \parsep 0\p@ \@plus\p@ - \itemsep 0\p@ \@plus\p@}% - \def\@listiii{\leftmargin\leftmarginii - \topsep 0\p@ \@plus\p@ - \parsep 0\p@ \@plus\p@ - \itemsep 0\p@ \@plus\p@}% - \ifhmode\par\nointerlineskip\fi% + \ifdefstring{\@currenvir}{tightlist}{% + \begingroup% + \def\@listi{\leftmargin\leftmargini + \topsep 0\p@ \@plus\p@ + \parsep 0\p@ \@plus\p@ + \itemsep \parsep}% + \let\@listI\@listi% + \def\@listii{\leftmargin\leftmarginii + \topsep 0\p@ \@plus\p@ + \parsep 0\p@ \@plus\p@ + \itemsep 0\p@ \@plus\p@}% + \def\@listiii{\leftmargin\leftmarginii + \topsep 0\p@ \@plus\p@ + \parsep 0\p@ \@plus\p@ + \itemsep 0\p@ \@plus\p@}% + \ifhmode\par\nointerlineskip\fi% + }{% + \setlength{\itemsep}{0pt}% + \setlength{\parskip}{0pt}% + }% }{% \nointerlineskip% \endgroup% From 5e895b0d8fa2d9655de347512c72a4329c761dfb Mon Sep 17 00:00:00 2001 From: Michael Roland Date: Thu, 7 Mar 2024 18:06:20 +0100 Subject: [PATCH 2/3] only include Euler for pdfLaTeX and switch default math font to FiraMath for XeLaTeX (with option to switch back to Euler) --- beamerfontthemejku.sty | 23 ++++++++++++++++++++--- beamerthemejku.sty | 2 ++ main.tex | 5 ++--- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/beamerfontthemejku.sty b/beamerfontthemejku.sty index 1ea303f..6712227 100644 --- a/beamerfontthemejku.sty +++ b/beamerfontthemejku.sty @@ -64,9 +64,15 @@ % Option [no]mathastext: use standard document fonts (and default to sans-serif font) in math mode \newbool{jkubeamer@mathastext} %\booltrue{jkubeamer@mathastext}% -\DeclareOptionBeamer{mathastext}[true]{\setbool{jkubeamer@mathastext}{#1}} +\DeclareOptionBeamer{mathastext}[true]{\setbool{jkubeamer@mathastext}{#1}\ifbool{jkubeamer@mathastext}{\boolfalse{jkubeamer@eulermath}}{}} \DeclareOptionBeamer{nomathastext}{\boolfalse{jkubeamer@mathastext}} +% Option [no]eulermath: use Euler math fonts (instead of Fira Sans) in math mode (legacy behavior) +\newbool{jkubeamer@eulermath} +%\booltrue{jkubeamer@eulermath}% +\DeclareOptionBeamer{eulermath}[true]{\setbool{jkubeamer@eulermath}{#1}\ifbool{jkubeamer@mathastext}{\boolfalse{jkubeamer@mathastext}}{}} +\DeclareOptionBeamer{noeulermath}{\boolfalse{jkubeamer@eulermath}} + \ProcessOptionsBeamer %% @@ -81,7 +87,9 @@ \RequirePackage{lmodern} \RequirePackage{inconsolata} \RequirePackage{helvet} -\RequirePackage{euler} +\ifxetex\else% + \RequirePackage{euler} +\fi \RequirePackage{fontawesome5} \ifxetex\else% % fix potentially mis-packaged FA5 in TeX Live 2017, see https://tex.stackexchange.com/q/497792/290236 @@ -98,7 +106,16 @@ \fi \ifbool{jkubeamer@xetexfonts}{% - \RequirePackage[no-math]{fontspec} + \ifbool{jkubeamer@eulermath}{ + \@ifpackageloaded{unicode-math}{% + \setmathfont{Euler-Math.otf} + }{% + \RequirePackage{euler-math}% + }% + }{% + \RequirePackage{firamath-otf}% + %\RequirePackage[no-math]{fontspec} + } % discover font path \expandafter\IfFileExists\expandafter{\jkubeamer@fontpath PublicSans-Regular.ttf}{% \IfFontExistsTF{\jkubeamer@fontpath PublicSans-Regular.ttf}{% diff --git a/beamerthemejku.sty b/beamerthemejku.sty index ec65e21..fadcd65 100644 --- a/beamerthemejku.sty +++ b/beamerthemejku.sty @@ -250,6 +250,8 @@ \DeclareOptionBeamer{nocompactmono}{\PassOptionsToPackage{nocompactmono}{beamerfontthemejku}} \DeclareOptionBeamer{mathastext}[true]{\PassOptionsToPackage{mathastext=#1}{beamerfontthemejku}} \DeclareOptionBeamer{nomathastext}{\PassOptionsToPackage{nomathastext}{beamerfontthemejku}} +\DeclareOptionBeamer{eulermath}[true]{\PassOptionsToPackage{eulermath=#1}{beamerfontthemejku}} +\DeclareOptionBeamer{noeulermath}{\PassOptionsToPackage{noeulermath}{beamerfontthemejku}} \ProcessOptionsBeamer diff --git a/main.tex b/main.tex index cbed3d0..d69b041 100644 --- a/main.tex +++ b/main.tex @@ -132,10 +132,9 @@ %% * mac ... Use adapted color palette for screen display on Mac. %% * legacyitemizestyle ... Use old bullet style in itemization. %% -%% Experimental options: -%% * mathastext ... Use standard document fonts (and default to sans-serif font) in math mode -%% %% Advanced options: +%% * mathastext ... Use standard document fonts in math mode +%% * eulermath ... Use Euler fonts (instead of Fira sans-serif font) in math mode with XeTeX %% * nooptpackages ... Do not load additional convenience packages (which are only there %% to provide interoperability to the behavior of previous versions of %% this theme but are not actually required for the current version). From 40930664128613a5f0ee6e68bd9ed07809658ffe Mon Sep 17 00:00:00 2001 From: Michael Roland Date: Thu, 7 Mar 2024 20:37:18 +0100 Subject: [PATCH 3/3] use filename to load firamath-otf font (otherwise loading fails e.g. on Debian 12) --- beamerfontthemejku.sty | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beamerfontthemejku.sty b/beamerfontthemejku.sty index 6712227..90cba51 100644 --- a/beamerfontthemejku.sty +++ b/beamerfontthemejku.sty @@ -113,7 +113,7 @@ \RequirePackage{euler-math}% }% }{% - \RequirePackage{firamath-otf}% + \RequirePackage[usefilenames]{firamath-otf}% %\RequirePackage[no-math]{fontspec} } % discover font path