You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

282 lines
8.3KB

  1. %%
  2. %% This is file `beamerinnerthememetropolis.sty',
  3. %% generated with the docstrip utility.
  4. %%
  5. %% The original source files were:
  6. %%
  7. %% beamerinnerthememetropolis.dtx (with options: `package')
  8. %% ---------------------------------------------------------------------------
  9. %% Copyright 2015 Matthias Vogelgesang and the LaTeX community. A full list of
  10. %% contributors can be found at
  11. %%
  12. %% https://github.com/matze/mtheme/graphs/contributors
  13. %%
  14. %% and the original template was based on the HSRM theme by Benjamin Weiss.
  15. %%
  16. %% This work is licensed under a Creative Commons Attribution-ShareAlike 4.0
  17. %% International License (https://creativecommons.org/licenses/by-sa/4.0/).
  18. %% ---------------------------------------------------------------------------
  19. \NeedsTeXFormat{LaTeX2e}
  20. \ProvidesPackage{beamerinnerthememetropolis}[2016/02/21 Metropolis inner theme]
  21. \RequirePackage{etoolbox}
  22. \RequirePackage{keyval}
  23. \RequirePackage{calc}
  24. \RequirePackage{pgfopts}
  25. \RequirePackage{tikz}
  26. \pgfkeys{
  27. /metropolis/inner/sectionpage/.cd,
  28. .is choice,
  29. none/.code=\metropolis@disablesectionpage,
  30. simple/.code={\metropolis@enablesectionpage
  31. \setbeamertemplate{section page}[simple]},
  32. progressbar/.code={\metropolis@enablesectionpage
  33. \setbeamertemplate{section page}[progressbar]},
  34. }
  35. \pgfkeys{
  36. /metropolis/inner/subsectionpage/.cd,
  37. .is choice,
  38. none/.code=\metropolis@disablesubsectionpage,
  39. simple/.code={\metropolis@enablesubsectionpage
  40. \setbeamertemplate{section page}[simple]},
  41. progressbar/.code={\metropolis@enablesubsectionpage
  42. \setbeamertemplate{section page}[progressbar]},
  43. }
  44. \newcommand{\metropolis@inner@setdefaults}{
  45. \pgfkeys{/metropolis/inner/.cd,
  46. sectionpage=progressbar,
  47. subsectionpage=none
  48. }
  49. }
  50. \setbeamertemplate{title page}{
  51. \begin{minipage}[b][\paperheight]{\textwidth}
  52. \ifx\inserttitlegraphic\@empty\else\usebeamertemplate*{title graphic}\fi
  53. \vfill%
  54. \ifx\inserttitle\@empty\else\usebeamertemplate*{title}\fi
  55. \ifx\insertsubtitle\@empty\else\usebeamertemplate*{subtitle}\fi
  56. \usebeamertemplate*{title separator}
  57. \ifx\beamer@shortauthor\@empty\else\usebeamertemplate*{author}\fi
  58. \ifx\insertdate\@empty\else\usebeamertemplate*{date}\fi
  59. \ifx\insertinstitute\@empty\else\usebeamertemplate*{institute}\fi
  60. \vfill
  61. \vspace*{1mm}
  62. \end{minipage}
  63. }
  64. \def\maketitle{%
  65. \ifbeamer@inframe
  66. \titlepage
  67. \else
  68. \frame[plain,noframenumbering]{\titlepage}
  69. \fi
  70. }
  71. \def\titlepage{%
  72. \usebeamertemplate{title page}
  73. }
  74. \setbeamertemplate{title graphic}{
  75. \vbox to 0pt {
  76. \vspace*{2em}
  77. \inserttitlegraphic%
  78. }%
  79. \nointerlineskip%
  80. }
  81. \setbeamertemplate{title}{
  82. \raggedright%
  83. \linespread{1.0}%
  84. \inserttitle%
  85. \par%
  86. \vspace*{0.5em}
  87. }
  88. \setbeamertemplate{subtitle}{
  89. \insertsubtitle%
  90. \par%
  91. \vspace*{0.5em}
  92. }
  93. \setbeamertemplate{title separator}{
  94. \begin{tikzpicture}
  95. \draw[fg, fill=fg] (0,0) rectangle (\textwidth, 0.4pt);
  96. \end{tikzpicture}%
  97. \par%
  98. }
  99. \setbeamertemplate{author}{
  100. \vspace*{2em}
  101. \insertauthor%
  102. \par%
  103. \vspace*{0.25em}
  104. }
  105. \setbeamertemplate{date}{
  106. \insertdate%
  107. \par%
  108. }
  109. \setbeamertemplate{institute}{
  110. \vspace*{3mm}
  111. \insertinstitute%
  112. \par%
  113. }
  114. \defbeamertemplate{section page}{simple}{
  115. \begin{center}
  116. \usebeamercolor[fg]{section title}
  117. \usebeamerfont{section title}
  118. \insertsectionhead\par
  119. \ifx\insertsubsection\@empty\else
  120. \usebeamercolor[fg]{subsection title}
  121. \usebeamerfont{subsection title}
  122. \insertsubsection
  123. \fi
  124. \end{center}
  125. }
  126. \defbeamertemplate{section page}{progressbar}{
  127. \centering
  128. \begin{minipage}{22em}
  129. \raggedright
  130. \usebeamercolor[fg]{section title}
  131. \usebeamerfont{section title}
  132. \insertsectionhead\\[-1ex]
  133. \usebeamertemplate*{progress bar in section page}
  134. \par
  135. \ifx\insertsubsection\@empty\else%
  136. \usebeamercolor[fg]{subsection title}%
  137. \usebeamerfont{subsection title}%
  138. \insertsubsection
  139. \fi
  140. \end{minipage}
  141. \par
  142. \vspace{\baselineskip}
  143. }
  144. \newcommand{\metropolis@disablesectionpage}{
  145. \AtBeginSection{
  146. % intentionally empty
  147. }
  148. }
  149. \newcommand{\metropolis@enablesectionpage}{
  150. \AtBeginSection{
  151. \ifbeamer@inframe
  152. \sectionpage
  153. \else
  154. \frame[plain,c,noframenumbering]{\sectionpage}
  155. \fi
  156. }
  157. }
  158. \setbeamertemplate{subsection page}{%
  159. \usebeamertemplate*{section page}
  160. }
  161. \newcommand{\metropolis@disablesubsectionpage}{
  162. \AtBeginSubsection{
  163. % intentionally empty
  164. }
  165. }
  166. \newcommand{\metropolis@enablesubsectionpage}{
  167. \AtBeginSubsection{
  168. \ifbeamer@inframe
  169. \subsectionpage
  170. \else
  171. \frame[plain,c,noframenumbering]{\subsectionpage}
  172. \fi
  173. }
  174. }
  175. \newlength{\metropolis@progressonsectionpage}
  176. \setbeamertemplate{progress bar in section page}{
  177. \setlength{\metropolis@progressonsectionpage}{%
  178. \textwidth * \ratio{\insertframenumber pt}{\inserttotalframenumber pt}%
  179. }%
  180. \begin{tikzpicture}
  181. \draw[bg, fill=bg] (0,0) rectangle (\textwidth, 0.4pt);
  182. \draw[fg, fill=fg] (0,0) rectangle (\metropolis@progressonsectionpage, 0.4pt);
  183. \end{tikzpicture}%
  184. }
  185. \def\inserttotalframenumber{100}
  186. \newlength{\metropolis@blocksep}
  187. \newlength{\metropolis@blockadjust}
  188. \setlength{\metropolis@blocksep}{0.75ex}
  189. \setlength{\metropolis@blockadjust}{0.25ex}
  190. \providecommand{\metropolis@strut}{%
  191. \vphantom{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz()}%
  192. }
  193. \newcommand{\metropolis@block}[1]{
  194. \par\vskip\medskipamount%
  195. \setlength{\parskip}{0pt}
  196. \ifbeamercolorempty[bg]{block title#1}{%
  197. \begin{beamercolorbox}[rightskip=0pt plus 4em]{block title#1}}{%
  198. \ifbeamercolorempty[bg]{block title}{%
  199. \begin{beamercolorbox}[rightskip=0pt plus 4em]{block title#1}%
  200. }%
  201. {%
  202. \begin{beamercolorbox}[
  203. sep=\dimexpr\metropolis@blocksep-\metropolis@blockadjust\relax,
  204. leftskip=\metropolis@blockadjust,
  205. rightskip=\dimexpr\metropolis@blockadjust plus 4em\relax
  206. ]{block title#1}%
  207. }}%
  208. \usebeamerfont*{block title#1}%
  209. \metropolis@strut%
  210. \insertblocktitle%
  211. \metropolis@strut%
  212. \end{beamercolorbox}%
  213. \nointerlineskip%
  214. \ifbeamercolorempty[bg]{block body#1}{%
  215. \begin{beamercolorbox}[vmode]{block body#1}}{
  216. \ifbeamercolorempty[bg]{block body}{%
  217. \begin{beamercolorbox}[vmode]{block body#1}%
  218. }{%
  219. \begin{beamercolorbox}[sep=\metropolis@blocksep, vmode]{block body#1}%
  220. \vspace{-\metropolis@parskip}
  221. }}%
  222. \usebeamerfont{block body#1}%
  223. \setlength{\parskip}{\metropolis@parskip}%
  224. }
  225. \setbeamertemplate{block begin}{\metropolis@block{}}
  226. \setbeamertemplate{block alerted begin}{\metropolis@block{ alerted}}
  227. \setbeamertemplate{block example begin}{\metropolis@block{ example}}
  228. \setbeamertemplate{block end}{\end{beamercolorbox}\vspace*{0.2ex}}
  229. \setbeamertemplate{block alerted end}{\end{beamercolorbox}\vspace*{0.2ex}}
  230. \setbeamertemplate{block example end}{\end{beamercolorbox}\vspace*{0.2ex}}
  231. \setbeamertemplate{itemize items}{\textbullet}
  232. \setbeamertemplate{caption label separator}{: }
  233. \setbeamertemplate{caption}[numbered]
  234. \setbeamertemplate{footnote}{%
  235. \parindent 0em\noindent%
  236. \raggedright
  237. \usebeamercolor{footnote}\hbox to 0.8em{\hfil\insertfootnotemark}\insertfootnotetext\par%
  238. }
  239. \newlength{\metropolis@parskip}
  240. \setlength{\metropolis@parskip}{0.5em}
  241. \setlength{\parskip}{\metropolis@parskip}
  242. \linespread{1.15}
  243. \define@key{beamerframe}{c}[true]{% centered
  244. \beamer@frametopskip=0pt plus 1fill\relax%
  245. \beamer@framebottomskip=0pt plus 1fill\relax%
  246. \beamer@frametopskipautobreak=0pt plus .4\paperheight\relax%
  247. \beamer@framebottomskipautobreak=0pt plus .6\paperheight\relax%
  248. \def\beamer@initfirstlineunskip{}%
  249. }
  250. \providebool{metropolis@standout}
  251. \define@key{beamerframe}{standout}[true]{%
  252. \booltrue{metropolis@standout}
  253. \begingroup
  254. \setkeys{beamerframe}{c}
  255. \setkeys{beamerframe}{noframenumbering}
  256. \ifbeamercolorempty[bg]{palette primary}{
  257. \setbeamercolor{background canvas}{
  258. use=palette primary,
  259. bg=-palette primary.fg
  260. }
  261. }{
  262. \setbeamercolor{background canvas}{
  263. use=palette primary,
  264. bg=palette primary.bg
  265. }
  266. }
  267. \centering
  268. \usebeamercolor[fg]{palette primary}
  269. \usebeamerfont{standout}
  270. }
  271. \apptocmd{\beamer@reseteecodes}{%
  272. \ifbool{metropolis@standout}{
  273. \endgroup
  274. \boolfalse{metropolis@standout}
  275. }{}
  276. }{}{}
  277. \metropolis@inner@setdefaults
  278. \ProcessPgfPackageOptions{/metropolis/inner}
  279. \endinput
  280. %%
  281. %% End of file `beamerinnerthememetropolis.sty'.