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.
 
 

127 lines
4.2 KiB

  1. %%
  2. %% This is file `beamerouterthememetropolis.sty',
  3. %% generated with the docstrip utility.
  4. %%
  5. %% The original source files were:
  6. %%
  7. %% beamerouterthememetropolis.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{beamerouterthememetropolis}[2016/02/21 Metropolis outer theme]
  21. \RequirePackage{etoolbox}
  22. \RequirePackage{calc}
  23. \RequirePackage{pgfopts}
  24. \pgfkeys{
  25. /metropolis/outer/numbering/.cd,
  26. .is choice,
  27. none/.code=\setbeamertemplate{frame numbering}[none],
  28. counter/.code=\setbeamertemplate{frame numbering}[counter],
  29. fraction/.code=\setbeamertemplate{frame numbering}[fraction],
  30. }
  31. \pgfkeys{
  32. /metropolis/outer/progressbar/.cd,
  33. .is choice,
  34. none/.code={%
  35. \setbeamertemplate{headline}[plain]
  36. \setbeamertemplate{frametitle}[plain]
  37. \setbeamertemplate{footline}[plain]
  38. },
  39. head/.code={\pgfkeys{/metropolis/outer/progressbar=none}
  40. \addtobeamertemplate{headline}{}{%
  41. \usebeamertemplate*{progress bar in head/foot}
  42. }
  43. },
  44. frametitle/.code={\pgfkeys{/metropolis/outer/progressbar=none}
  45. \addtobeamertemplate{frametitle}{}{%
  46. \usebeamertemplate*{progress bar in head/foot}
  47. }
  48. },
  49. foot/.code={\pgfkeys{/metropolis/outer/progressbar=none}
  50. \addtobeamertemplate{footline}{}{%
  51. \usebeamertemplate*{progress bar in head/foot}%
  52. }
  53. },
  54. }
  55. \newcommand{\metropolis@outer@setdefaults}{
  56. \pgfkeys{/metropolis/outer/.cd,
  57. numbering=counter,
  58. progressbar=none,
  59. }
  60. }
  61. \setbeamertemplate{navigation symbols}{}
  62. \defbeamertemplate{frame footer}{none}{}
  63. \defbeamertemplate{frame footer}{custom}[1]{ #1 }
  64. \defbeamertemplate{frame numbering}{none}{}
  65. \defbeamertemplate{frame numbering}{counter}{\insertframenumber}
  66. \defbeamertemplate{frame numbering}{fraction}{
  67. \insertframenumber/\inserttotalframenumber
  68. }
  69. \defbeamertemplate{headline}{plain}{}
  70. \defbeamertemplate{footline}{plain}{%
  71. \begin{beamercolorbox}[wd=\textwidth, sep=3ex]{footline}%
  72. \usebeamerfont{page number in head/foot}%
  73. \usebeamertemplate*{frame footer}
  74. \hfill%
  75. \usebeamertemplate*{frame numbering}
  76. \end{beamercolorbox}%
  77. }
  78. \newlength{\metropolis@frametitle@padding}
  79. \setlength{\metropolis@frametitle@padding}{2.2ex}
  80. \newcommand{\metropolis@frametitlestrut@start}{
  81. \rule{0pt}{\metropolis@frametitle@padding +%
  82. \totalheightof{%
  83. \ifcsdef{metropolis@frametitleformat}{\metropolis@frametitleformat X}{X}%
  84. }%
  85. }%
  86. }
  87. \newcommand{\metropolis@frametitlestrut@end}{
  88. \rule[-\metropolis@frametitle@padding]{0pt}{\metropolis@frametitle@padding}
  89. }
  90. \defbeamertemplate{frametitle}{plain}{%
  91. \nointerlineskip%
  92. \begin{beamercolorbox}[%
  93. wd=\paperwidth,%
  94. sep=0pt,%
  95. leftskip=\metropolis@frametitle@padding,%
  96. rightskip=\metropolis@frametitle@padding,%
  97. ]{frametitle}%
  98. \metropolis@frametitlestrut@start\insertframetitle\metropolis@frametitlestrut@end%
  99. \end{beamercolorbox}%
  100. }
  101. \newlength{\metropolis@progressinheadfoot}
  102. \setbeamertemplate{progress bar in head/foot}{
  103. \nointerlineskip
  104. \setlength{\metropolis@progressinheadfoot}{%
  105. \paperwidth * \ratio{\insertframenumber pt}{\inserttotalframenumber pt}%
  106. }%
  107. \begin{beamercolorbox}[wd=\paperwidth]{progress bar in head/foot}
  108. \begin{tikzpicture}
  109. \draw[bg, fill=bg] (0,0) rectangle (\paperwidth, 0.4pt);
  110. \draw[fg, fill=fg] (0,0) rectangle (\metropolis@progressinheadfoot, 0.4pt);
  111. \end{tikzpicture}%
  112. \end{beamercolorbox}
  113. }
  114. \AtBeginDocument{%
  115. \apptocmd{\appendix}{%
  116. \pgfkeys{%
  117. /metropolis/outer/.cd,
  118. numbering=none,
  119. progressbar=none}
  120. }{}{}
  121. }
  122. \metropolis@outer@setdefaults
  123. \ProcessPgfPackageOptions{/metropolis/outer}
  124. \endinput
  125. %%
  126. %% End of file `beamerouterthememetropolis.sty'.