📚 The CoCalc Library - books, templates and other resources
cocalc-examples / martinthoma-latex-examples / presentations / CNN-Intro / beamerfontthememetropolis.sty
132928 viewsLicense: OTHER
%%1%% This is file `beamerfontthememetropolis.sty',2%% generated with the docstrip utility.3%%4%% The original source files were:5%%6%% beamerfontthememetropolis.dtx (with options: `package')7%% ---------------------------------------------------------------------------8%% Copyright 2015 Matthias Vogelgesang and the LaTeX community. A full list of9%% contributors can be found at10%%11%% https://github.com/matze/mtheme/graphs/contributors12%%13%% and the original template was based on the HSRM theme by Benjamin Weiss.14%%15%% This work is licensed under a Creative Commons Attribution-ShareAlike 4.016%% International License (https://creativecommons.org/licenses/by-sa/4.0/).17%% ---------------------------------------------------------------------------18\NeedsTeXFormat{LaTeX2e}19\ProvidesPackage{beamerfontthememetropolis}[2017/01/23 Metropolis font theme]20\RequirePackage{etoolbox}21\RequirePackage{ifxetex}22\RequirePackage{ifluatex}23\RequirePackage{pgfopts}24\ifboolexpr{bool {xetex} or bool {luatex}}{25\@ifpackageloaded{fontspec}{26\PassOptionsToPackage{no-math}{fontspec}27}{28\RequirePackage[no-math]{fontspec}29}30\newcounter{fontsnotfound}31\newcommand{\checkfont}[1]{%32\suppressfontnotfounderror=1%33\font\x = "#1" at 10pt34\selectfont35\ifx\x\nullfont%36\stepcounter{fontsnotfound}%37\fi%38\suppressfontnotfounderror=0%39}4041\newcommand{\iffontsavailable}[3]{%42\setcounter{fontsnotfound}{0}%43\expandafter\forcsvlist\expandafter%44\checkfont\expandafter{#1}%45\ifnum\value{fontsnotfound}=0%46#2%47\else%48#3%49\fi%50}51\iffontsavailable{Fira Sans Light,%52Fira Sans Light Italic,%53Fira Sans,%54Fira Sans Italic}%55{%56\setsansfont[ItalicFont={Fira Sans Light Italic},%57BoldFont={Fira Sans},%58BoldItalicFont={Fira Sans Italic}]%59{Fira Sans Light}%60}{%61\iffontsavailable{Fira Sans Light OT,%62Fira Sans Light Italic OT,%63Fira Sans OT,%64Fira Sans Italic OT}%65{%66\setsansfont[ItalicFont={Fira Sans Light Italic OT},%67BoldFont={Fira Sans OT},%68BoldItalicFont={Fira Sans Italic OT}]%69{Fira Sans Light OT}%70}{%71\PackageWarning{beamerthememetropolis}{%72Could not find Fira Sans fonts%73}74}75}76\iffontsavailable{Fira Mono, Fira Mono Bold}{%77\setmonofont[BoldFont={Fira Mono Medium}]{Fira Mono}%78}{%79\iffontsavailable{Fira Mono OT, Fira Mono Bold OT}{%80\setmonofont[BoldFont={Fira Mono Medium OT}]{Fira Mono OT}%81}{%82\PackageWarning{beamerthememetropolis}{%83Could not find Fira Mono fonts%84}85}86}87\AtBeginEnvironment{tabular}{%88\addfontfeature{Numbers={Monospaced}}%89}90}{%91\PackageWarning{beamerthememetropolis}{%92You need to compile with XeLaTeX or LuaLaTeX to use the Fira fonts%93}94}95\setbeamerfont{title}{size=\Large,%96series=\bfseries}97\setbeamerfont{author}{size=\small}98\setbeamerfont{date}{size=\small}99\setbeamerfont{section title}{size=\Large,%100series=\bfseries}101\setbeamerfont{block title}{size=\normalsize,%102series=\bfseries}103\setbeamerfont{block title alerted}{size=\normalsize,%104series=\bfseries}105\setbeamerfont*{subtitle}{size=\large}106\setbeamerfont{frametitle}{size=\large,%107series=\bfseries}108\setbeamerfont{caption}{size=\small}109\setbeamerfont{caption name}{series=\bfseries}110\setbeamerfont{description item}{series=\bfseries}111\setbeamerfont{page number in head/foot}{size=\scriptsize}112\setbeamerfont{bibliography entry author}{size=\normalsize,%113series=\normalfont}114\setbeamerfont{bibliography entry title}{size=\normalsize,%115series=\bfseries}116\setbeamerfont{bibliography entry location}{size=\normalsize,%117series=\normalfont}118\setbeamerfont{bibliography entry note}{size=\small,%119series=\normalfont}120\setbeamerfont{standout}{size=\Large,%121series=\bfseries}122\pgfkeys{123/metropolis/font/titleformat title/.cd,124.is choice,125regular/.code={%126\let\metropolis@titleformat\@empty%127\setbeamerfont{title}{shape=\normalfont}%128},129smallcaps/.code={%130\let\metropolis@titleformat\@empty%131\setbeamerfont{title}{shape=\scshape}%132},133allsmallcaps/.code={%134\let\metropolis@titleformat\lowercase%135\setbeamerfont{title}{shape=\scshape}%136\PackageWarning{beamerthememetropolis}{%137Be aware that titleformat title=allsmallcaps can lead to problems%138}139},140allcaps/.code={%141\let\metropolis@titleformat\uppercase%142\setbeamerfont{title}{shape=\normalfont}143\PackageWarning{beamerthememetropolis}{%144Be aware that titleformat title=allcaps can lead to problems%145}146},147}148\pgfkeys{149/metropolis/font/titleformat subtitle/.cd,150.is choice,151regular/.code={%152\let\metropolis@subtitleformat\@empty%153\setbeamerfont{subtitle}{shape=\normalfont}%154},155smallcaps/.code={%156\let\metropolis@subtitleformat\@empty%157\setbeamerfont{subtitle}{shape=\scshape}%158},159allsmallcaps/.code={%160\let\metropolis@subtitleformat\lowercase%161\setbeamerfont{subtitle}{shape=\scshape}%162\PackageWarning{beamerthememetropolis}{%163Be aware that titleformat subtitle=allsmallcaps can lead to problems%164}165},166allcaps/.code={%167\let\metropolis@subtitleformat\uppercase%168\setbeamerfont{subtitle}{shape=\normalfont}%169\PackageWarning{beamerthememetropolis}{%170Be aware that titleformat subtitle=allcaps can lead to problems%171}172},173}174\pgfkeys{175/metropolis/font/titleformat section/.cd,176.is choice,177regular/.code={%178\let\metropolis@sectiontitleformat\@empty%179\setbeamerfont{section title}{shape=\normalfont}%180},181smallcaps/.code={%182\let\metropolis@sectiontitleformat\@empty%183\setbeamerfont{section title}{shape=\scshape}%184},185allsmallcaps/.code={%186\let\metropolis@sectiontitleformat\MakeLowercase%187\setbeamerfont{section title}{shape=\scshape}%188\PackageWarning{beamerthememetropolis}{%189Be aware that titleformat section=allsmallcaps can lead to problems%190}191},192allcaps/.code={%193\let\metropolis@sectiontitleformat\MakeUppercase%194\setbeamerfont{section title}{shape=\normalfont}%195\PackageWarning{beamerthememetropolis}{%196Be aware that titleformat section=allcaps can lead to problems%197}198},199}200\pgfkeys{201/metropolis/font/titleformat frame/.cd,202.is choice,203regular/.code={%204\let\metropolis@frametitleformat\@empty%205\setbeamerfont{frametitle}{shape=\normalfont}%206},207smallcaps/.code={%208\let\metropolis@frametitleformat\@empty%209\setbeamerfont{frametitle}{shape=\scshape}%210},211allsmallcaps/.code={%212\let\metropolis@frametitleformat\MakeLowercase%213\setbeamerfont{frametitle}{shape=\scshape}%214\PackageWarning{beamerthememetropolis}{%215Be aware that titleformat frame=allsmallcaps can lead to problems%216}217},218allcaps/.code={%219\let\metropolis@frametitleformat\MakeUppercase%220\setbeamerfont{frametitle}{shape=\normalfont}221\PackageWarning{beamerthememetropolis}{%222Be aware that titleformat frame=allcaps can lead to problems%223}224},225}226\pgfkeys{227/metropolis/font/.cd,228titleformattitle/.code=\pgfkeysalso{titleformat title=#1},229titleformatsubtitle/.code=\pgfkeysalso{titleformat subtitle=#1},230titleformatsection/.code=\pgfkeysalso{titleformat section=#1},231titleformatframe/.code=\pgfkeysalso{titleformat frame=#1},232}233\newcommand{\metropolis@font@setdefaults}{234\pgfkeys{/metropolis/font/.cd,235titleformat title=regular,236titleformat subtitle=regular,237titleformat section=regular,238titleformat frame=regular,239}240}241\def\metropolis@titleformat#1{#1}242\def\metropolis@subtitleformat#1{#1}243\def\metropolis@sectiontitleformat#1{#1}244\def\metropolis@frametitleformat#1{#1}245\patchcmd{\beamer@title}%246{\def\inserttitle{#2}}%247{\def\inserttitle{\metropolis@titleformat{#2}}}%248{}%249{\PackageError{beamerfontthememetropolis}{Patching title failed}\@ehc}250\patchcmd{\beamer@subtitle}%251{\def\insertsubtitle{#2}}%252{\def\insertsubtitle{\metropolis@subtitleformat{#2}}}%253{}%254{\PackageError{beamerfontthememetropolis}{Patching subtitle failed}\@ehc}255\patchcmd{\sectionentry}256{\def\insertsectionhead{#2}}257{\def\insertsectionhead{\metropolis@sectiontitleformat{#2}}}258{}259{\PackageError{beamerfontthememetropolis}{Patching section title failed}\@ehc}260\@tempswafalse261\patchcmd{\beamer@section}262{\edef\insertsectionhead{\noexpand\hyperlink{Navigation\the\c@page}{\unexpanded{#1}}}}263{\edef\insertsectionhead{\noexpand\hyperlink{Navigation\the\c@page}{%264\noexpand\metropolis@sectiontitleformat{\unexpanded{#1}}}}}265{\@tempswatrue}266{}267\patchcmd{\beamer@section}268{\def\insertsectionhead{\hyperlink{Navigation\the\c@page}{#1}}}269{\def\insertsectionhead{\hyperlink{Navigation\the\c@page}{%270\metropolis@sectiontitleformat{#1}}}}271{\@tempswatrue}272{}273\patchcmd{\beamer@section}274{\protected@edef\insertsectionhead{\noexpand\hyperlink{Navigation\the\c@page}{#1}}}275{\protected@edef\insertsectionhead{\noexpand\hyperlink{Navigation\the\c@page}{%276\noexpand\metropolis@sectiontitleformat{#1}}}}277{\@tempswatrue}278{}279\if@tempswa\else280\PackageError{beamerfontthememetropolis}{Patching section title failed}\@ehc281\fi282\@tempswafalse283\patchcmd{\beamer@subsection}284{\edef\insertsubsectionhead{\noexpand\hyperlink{Navigation\the\c@page}{\unexpanded{#1}}}}285{\edef\insertsubsectionhead{\noexpand\hyperlink{Navigation\the\c@page}{%286\noexpand\metropolis@sectiontitleformat{\unexpanded{#1}}}}}287{\@tempswatrue}288{}289\patchcmd{\beamer@subsection}290{\def\insertsubsectionhead{\hyperlink{Navigation\the\c@page}{#1}}}291{\def\insertsubsectionhead{\hyperlink{Navigation\the\c@page}{%292\metropolis@sectiontitleformat{#1}}}}293{\@tempswatrue}294{}295\patchcmd{\beamer@subsection}296{\protected@edef\insertsubsectionhead{\noexpand\hyperlink{Navigation\the\c@page}{#1}}}297{\protected@edef\insertsubsectionhead{\noexpand\hyperlink{Navigation\the\c@page}{%298\noexpand\metropolis@sectiontitleformat{#1}}}}299{\@tempswatrue}300{}301\if@tempswa\else302\PackageError{beamerfontthememetropolis}{Patching section title failed}\@ehc303\fi304\patchcmd{\beamer@@frametitle}305{{%306\gdef\insertframetitle{{#2\ifnum\beamer@autobreakcount>0\relax{}\space%307\usebeamertemplate*{frametitle continuation}\fi}}%308\gdef\beamer@frametitle{#2}%309\gdef\beamer@shortframetitle{#1}%310}}311{{%312\gdef\insertframetitle{{\metropolis@frametitleformat{#2}\ifnum%313\beamer@autobreakcount>0\relax{}\space%314\usebeamertemplate*{frametitle continuation}\fi}}%315\gdef\beamer@frametitle{#2}%316\gdef\beamer@shortframetitle{#1}%317}}318{}319{\PackageError{beamerfontthememetropolis}{Patching frame title failed}\@ehc}320\metropolis@font@setdefaults321\ProcessPgfPackageOptions{/metropolis/font}322\endinput323%%324%% End of file `beamerfontthememetropolis.sty'.325326327