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.

130 lines
4.2KB

  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/03/14 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%
  99. \insertframetitle%
  100. \nolinebreak%
  101. \metropolis@frametitlestrut@end%
  102. \end{beamercolorbox}%
  103. }
  104. \newlength{\metropolis@progressinheadfoot}
  105. \setbeamertemplate{progress bar in head/foot}{
  106. \nointerlineskip
  107. \setlength{\metropolis@progressinheadfoot}{%
  108. \paperwidth * \ratio{\insertframenumber pt}{\inserttotalframenumber pt}%
  109. }%
  110. \begin{beamercolorbox}[wd=\paperwidth]{progress bar in head/foot}
  111. \begin{tikzpicture}
  112. \fill[bg] (0,0) rectangle (\paperwidth, 0.4pt);
  113. \fill[fg] (0,0) rectangle (\metropolis@progressinheadfoot, 0.4pt);
  114. \end{tikzpicture}%
  115. \end{beamercolorbox}
  116. }
  117. \AtBeginDocument{%
  118. \apptocmd{\appendix}{%
  119. \pgfkeys{%
  120. /metropolis/outer/.cd,
  121. numbering=none,
  122. progressbar=none}
  123. }{}{}
  124. }
  125. \metropolis@outer@setdefaults
  126. \ProcessPgfPackageOptions{/metropolis/outer}
  127. \endinput
  128. %%
  129. %% End of file `beamerouterthememetropolis.sty'.