Skip to content

Commit

Permalink
Merge pull request #8 from michaelroland/pandoc-compatibility
Browse files Browse the repository at this point in the history
Add Pandoc compatibility
  • Loading branch information
michaelroland authored Mar 8, 2024
2 parents 301c8a9 + 4093066 commit 2893dde
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 21 deletions.
23 changes: 20 additions & 3 deletions beamerfontthemejku.sty
Original file line number Diff line number Diff line change
Expand Up @@ -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

%%
Expand All @@ -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
Expand All @@ -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[usefilenames]{firamath-otf}%
%\RequirePackage[no-math]{fontspec}
}
% discover font path
\expandafter\IfFileExists\expandafter{\jkubeamer@fontpath PublicSans-Regular.ttf}{%
\IfFontExistsTF{\jkubeamer@fontpath PublicSans-Regular.ttf}{%
Expand Down
37 changes: 22 additions & 15 deletions beamerthemejku.sty
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -1970,21 +1972,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%
Expand Down
5 changes: 2 additions & 3 deletions main.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down

0 comments on commit 2893dde

Please sign in to comment.