Merge pull request #74 from benjamin-weiss/package

Documented LaTeX Format
This commit is contained in:
Matthias Vogelgesang 2015-06-15 08:29:37 +02:00
commit d3bb6054aa
10 changed files with 843 additions and 326 deletions

4
.gitignore vendored
View File

@ -1,4 +1,5 @@
demo.pdf
mtheme.pdf
*.fls
*.acn
@ -33,3 +34,6 @@ demo.pdf
*.vrb
*.xdy
*.tdo
*.sty
.temptex

View File

@ -0,0 +1,201 @@
% \iffalse meta-comment
%
% Copyright (C) 2015 by Matthias Vogelgesang <matthias.vogelgesang@gmail.com>
% ---------------------------------------------------------------------------
% Licensed under CC-BY-SA 4.0 International.
%
% The initial template comes from the HSRM beamer theme by Benjamin Weiss,
% which you can find at https://github.com/benjamin-weiss/hsrmbeamertheme.
% ---------------------------------------------------------------------------
%
% The Current Maintainer of this work is Matthias Vogelgesang.
%
% This work consists of the files beamercolorthememetropolis.dtx and
% beamercolorthememetropolis.ins and the derived filebase
% beamercolorthememetropolis.sty.
%
% \fi
%
% \iffalse
%<*driver>
\ProvidesFile{beamercolorthememetropolis.dtx}
%</driver>
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{beamercolorthememetropolis}
%<*package>
[2015/06/12 1.0.0 A Modern Beamer Color Theme]
%</package>
%
%<*driver>
\documentclass{ltxdoc}
\usepackage{beamercolorthememetropolis}
\EnableCrossrefs
\CodelineIndex
\RecordChanges
\begin{document}
\DocInput{beamercolorthememetropolis.dtx}
\PrintChanges
\PrintIndex
\end{document}
%</driver>
% \fi
%
% \CheckSum{0}
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
% Digits \0\1\2\3\4\5\6\7\8\9
% Exclamation \! Double quote \" Hash (number) \#
% Dollar \$ Percent \% Ampersand \&
% Acute accent \' Left paren \( Right paren \)
% Asterisk \* Plus \+ Comma \,
% Minus \- Point \. Solidus \/
% Colon \: Semicolon \; Less than \<
% Equals \= Greater than \> Question mark \?
% Commercial at \@ Left bracket \[ Backslash \\
% Right bracket \] Circumflex \^ Underscore \_
% Grave accent \` Left brace \{ Vertical bar \|
% Right brace \} Tilde \~}
%
%
% \changes{1.0.0}{2015/06/12}{Initial Stable Release.}
%
% \DoNotIndex{\newcommand,\newenvironment}
%
%
% \StopEventually{}
%
% \subsection{Color Theme}
%
% \iffalse
%<*package>
% \fi
%
% Options
%
% \begin{macrocode}
\newif\if@beamer@metropolis@blockbg
\@beamer@metropolis@blockbgfalse
\DeclareOptionBeamer{blockbg}{
\@beamer@metropolis@blockbgtrue
}
% \end{macrocode}
%
% Unknown option error handling
%
% \begin{macrocode}
\DeclareOptionBeamer*{%
\PackageWarning{beamercolorthememetropolis}{Unknown option `\CurrentOption'}%
}
\ProcessOptionsBeamer
% \end{macrocode}
%
% Colors
%
% \begin{macrocode}
\definecolor{mDarkBrown}{HTML}{604c38}
\definecolor{mDarkTeal}{HTML}{23373b}
\definecolor{mLightBrown}{HTML}{EB811B}
\definecolor{mLightGreen}{HTML}{14B03D}
% \end{macrocode}
%
% Base Colors
%
% \begin{macrocode}
\setbeamercolor{normal text}{%
fg=mDarkTeal,
bg=black!2
}
\setbeamercolor{alerted text}{%
fg=mLightBrown
}
\setbeamercolor{example text}{%
fg=mLightGreen
}
% \end{macrocode}
%
% Derived Colors
%
% \begin{macrocode}
\setbeamercolor{titlelike}{use=normal text, parent=normal text}
\setbeamercolor{structure}{%
fg=normal text.fg
}
% \end{macrocode}
%
% Frame titles and plain slides
%
% \begin{macrocode}
\setbeamercolor{frametitle}{use=palette primary, parent=palette primary}
% \end{macrocode}
%
% The “primary” palette should be used for the most important navigational
% elements, and possibly of other elements.
% The metropolis color theme uses it for frame titles and slides.
%
% \begin{macrocode}
\setbeamercolor{palette primary}{%
use=normal text,
fg=normal text.bg,
bg=normal text.fg
}
% \end{macrocode}
%
% Progress bar and title separator
%
% \begin{macrocode}
\setbeamercolor{title separator}{use=progress bar, parent=progress bar}
\setbeamercolor{progress bar}{%
use=alerted text,
fg=alerted text.fg,
bg=normal text.bg!50!fg
}
% \end{macrocode}
%
% Blocks
%
% \begin{macrocode}
\if@beamer@metropolis@blockbg
\setbeamercolor{block title}{%
use=normal text,
fg=normal text.fg,
bg=normal text.bg!80!fg
}
\else
\setbeamercolor{block title}{use=normal text, parent=normal text}
\fi
\setbeamercolor{block title alerted}{%
use={block title, alerted text},
bg=block title.bg,
fg=alerted text.fg
}
\setbeamercolor{block title example}{%
use={block title, example text},
bg=block title.bg,
fg=example text.fg
}
\setbeamercolor{block body alerted}{use=block body, parent=block body}
\setbeamercolor{block body example}{use=block body, parent=block body}
\setbeamercolor{block body}{
use={block title, normal text},
bg=block title.bg!50!normal text.bg
}
% \end{macrocode}
%
% Footnotes
%
% \begin{macrocode}
\setbeamercolor{footnote}{fg=normal text.fg!90}
\setbeamercolor{footnote mark}{fg=.}
\mode<all>
% \end{macrocode}
%
% \iffalse
%</package>
% \fi
%
% \Finale
\endinput

View File

@ -1,156 +0,0 @@
% Beamer mtheme
%
% Copyright 2014 Matthias Vogelgesang
% Licensed under CC-BY-SA 4.0 International.
%
\ProvidesPackage{beamercolorthememetropolis}
% Options
% =======
% Option: blockbg
% applies a gray background to blocks
\newif\if@beamer@metropolis@blockbg
\@beamer@metropolis@blockbgfalse
\DeclareOptionBeamer{blockbg}{
\@beamer@metropolis@blockbgtrue
}
% Option: ...
\DeclareOptionBeamer*{%
\PackageWarning{beamercolorthememetropolis}{Unknown option `\CurrentOption'}%
}
\ProcessOptionsBeamer
% Color definitions
% =================
%
% See http://paletton.com/#uid=7050t0kkJkJsntwoyp6gYgoddc4
%
\definecolor{mDarkBrown}{HTML}{604c38}
\definecolor{mDarkTeal}{HTML}{23373b}
\definecolor{mLightBrown}{HTML}{EB811B}
\definecolor{mLightGreen}{HTML}{14B03D}
% Base colors
% ===========
%
% The metropolis color theme is defined in terms of three fundamental styles:
%
% - normal text (dark fg, light bg)
% - alerted text (colored fg, should be visible against dark or light)
% - example text (colored fg, should be visible against dark or light)
%
% An easy way to customize the theme is to redefine these colors using
%
% \setbeamercolor{ ... }{ fg= ... , bg= ... }
%
% in your preamble.
%
\setbeamercolor{normal text}{%
fg=mDarkTeal,
bg=black!2
}
\setbeamercolor{alerted text}{%
fg=mLightBrown
}
\setbeamercolor{example text}{%
fg=mLightGreen
}
% Derived colors
% ==============
%
% These colors are all defined in terms of the above and will update their
% appearance if `normal text`, `alerted text`, or `example text` is customized.
%
% You may also redefine these in your preamble for greater control over the
% customization. Beamer colors not defined here are inherited from
% `beamercolorthemedefault.sty`
%
% Reset titles and structure to normal text
\setbeamercolor{titlelike}{use=normal text, parent=normal text}
\setbeamercolor{structure}{%
% This would be parent=normal text, but the inheritance is overriden by the
% explicity color definition for structure in `beamercolorthemedefault.sty`
fg=normal text.fg
}
% Frame titles and `\plain` slides
\setbeamercolor{frametitle}{use=palette primary, parent=palette primary}
\setbeamercolor{palette primary}{%
% The “primary” palette should be used for the most important navigational
% elements, and possibly of other elements.
% The metropolis color theme uses it for frame titles and `\plain` slides.
use=normal text,
fg=normal text.bg,
bg=normal text.fg
}
% Progress bar and title separator
\setbeamercolor{title separator}{use=progress bar, parent=progress bar}
\setbeamercolor{progress bar}{%
use=alerted text,
fg=alerted text.fg,
bg=normal text.bg!50!fg
}
% Blocks
\if@beamer@metropolis@blockbg
\setbeamercolor{block title}{%
use=normal text,
fg=normal text.fg,
bg=normal text.bg!80!fg
}
\else
\setbeamercolor{block title}{use=normal text, parent=normal text}
\fi
\setbeamercolor{block title alerted}{%
use={block title, alerted text},
bg=block title.bg,
fg=alerted text.fg
}
\setbeamercolor{block title example}{%
use={block title, example text},
bg=block title.bg,
fg=example text.fg
}
\setbeamercolor{block body alerted}{use=block body, parent=block body}
\setbeamercolor{block body example}{use=block body, parent=block body}
\setbeamercolor{block body}{
use={block title, normal text},
bg=block title.bg!50!normal text.bg
}
% Footnotes
\setbeamercolor{footnote}{fg=normal text.fg!90}
\setbeamercolor{footnote mark}{fg=.}
\mode<all>

View File

@ -0,0 +1,128 @@
% \iffalse meta-comment
%
% Copyright (C) 2015 by Matthias Vogelgesang <matthias.vogelgesang@gmail.com>
% ---------------------------------------------------------------------------
% Licensed under CC-BY-SA 4.0 International.
%
% The initial template comes from the HSRM beamer theme by Benjamin Weiss,
% which you can find at https://github.com/benjamin-weiss/hsrmbeamertheme.
% ---------------------------------------------------------------------------
%
% The Current Maintainer of this work is Matthias Vogelgesang.
%
% This work consists of the files beamerfontthememetropolis.dtx and
% beamerfontthememetropolis.ins and the derived filebase
% beamerfontthememetropolis.sty.
%
% \fi
%
% \iffalse
%<*driver>
\ProvidesFile{beamerfontthememetropolis.dtx}
%</driver>
%<package>\NeedsTeXFormat{LaTeX2e}
%<package>\ProvidesPackage{beamerfontthememetropolis}
%<*package>
[2015/06/12 1.0.0 A Modern Beamer Font Theme]
%</package>
%
%<*driver>
\documentclass{ltxdoc}
\usepackage{beamerfontthememetropolis}
\EnableCrossrefs
\CodelineIndex
\RecordChanges
\begin{document}
\DocInput{beamerfontthememetropolis.dtx}
\PrintChanges
\PrintIndex
\end{document}
%</driver>
% \fi
%
% \CheckSum{0}
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
% Digits \0\1\2\3\4\5\6\7\8\9
% Exclamation \! Double quote \" Hash (number) \#
% Dollar \$ Percent \% Ampersand \&
% Acute accent \' Left paren \( Right paren \)
% Asterisk \* Plus \+ Comma \,
% Minus \- Point \. Solidus \/
% Colon \: Semicolon \; Less than \<
% Equals \= Greater than \> Question mark \?
% Commercial at \@ Left bracket \[ Backslash \\
% Right bracket \] Circumflex \^ Underscore \_
% Grave accent \` Left brace \{ Vertical bar \|
% Right brace \} Tilde \~}
%
%
% \changes{1.0.0}{2015/06/12}{Initial Stable Release.}
%
% \DoNotIndex{\newcommand,\newenvironment}
%
%
% \StopEventually{}
%
% \subsection{Font Theme}
%
% \iffalse
%<*package>
% \fi
%
% Font Definitions
%
% \begin{macrocode}
\RequirePackage[no-math]{fontspec}
\defaultfontfeatures{Mapping=tex-text}
\setsansfont[BoldItalicFont={Fira Sans Italic},%
ItalicFont={Fira Sans Light Italic},%
BoldFont={Fira Sans}]{Fira Sans Light}
\setmonofont{Fira Mono}
\newfontfamily\ExtraLight{Fira Sans ExtraLight}
\newfontfamily\Light{Fira Sans Light}
\newfontfamily\Book{Fira Sans}
\newfontfamily\Medium{Fira Sans Medium}
\AtBeginEnvironment{tabular}{%
\setsansfont[BoldFont={Fira Sans},%
Numbers={Monospaced}]{Fira Sans Light}%
}
% \end{macrocode}
%
% Font Assignment
%
% \begin{macrocode}
\setbeamerfont{title}{family=\Book, size=\Large}
\setbeamerfont{author}{family=\ExtraLight, size=\small}
\setbeamerfont{date}{family=\ExtraLight, size=\small}
\setbeamerfont{section title}{family=\Book, size=\Large}
\setbeamerfont{block title}{family=\Book, size=\normalsize}
\setbeamerfont{block title alerted}{family=\Book,size=\normalsize}
\setbeamerfont{subtitle}{family=\Light, size=\fontsize{12}{14}}
\setbeamerfont{frametitle}{family=\Book, size=\large}
\setbeamerfont{caption}{size=\small}
\setbeamerfont{caption name}{family=\Book}
\setbeamerfont{description item}{family=\Book}
\setbeamerfont{page number in head/foot}{size=\scriptsize}
% \end{macrocode}
%
% Bibliograpy
%
% \begin{macrocode}
\setbeamerfont{bibliography entry author}{family=\Light, size=\normalsize}
\setbeamerfont{bibliography entry title}{family=\Book, size=\normalsize}
\setbeamerfont{bibliography entry location}{family=\Light, size=\normalsize}
\setbeamerfont{bibliography entry note}{family=\Light, size=\small}
\linespread{1.15}
% \end{macrocode}
%
% \iffalse
%</package>
% \fi
%
% \Finale
\endinput

View File

@ -1,49 +0,0 @@
% Beamer mtheme
%
% Copyright 2014 Matthias Vogelgesang
% Licensed under CC-BY-SA 4.0 International.
%
% The initial template comes from the HSRM beamer theme by Benjamin Weiss, which
% you can find at https://github.com/hsrmbeamertheme/hsrmbeamertheme.
%
\ProvidesPackage{beamerfontthememetropolis}
\RequirePackage[no-math]{fontspec}
\defaultfontfeatures{Mapping=tex-text}
\setsansfont[BoldItalicFont={Fira Sans Italic}, ItalicFont={Fira Sans Light Italic}, BoldFont={Fira Sans}]{Fira Sans Light}
\setmonofont{Fira Mono}
\newfontfamily\ExtraLight{Fira Sans ExtraLight}
\newfontfamily\Light{Fira Sans Light}
\newfontfamily\Book{Fira Sans}
\newfontfamily\Medium{Fira Sans Medium}
\AtBeginEnvironment{tabular}{\setsansfont[BoldFont={Fira Sans}, Numbers={Monospaced}]{Fira Sans Light}}
\setbeamerfont{title}{family=\Book, size=\Large}
\setbeamerfont{author}{family=\ExtraLight, size=\small}
\setbeamerfont{date}{family=\ExtraLight, size=\small}
\setbeamerfont{section title}{family=\Book, size=\Large}
\setbeamerfont{block title}{family=\Book, size=\normalsize}
\setbeamerfont{block title alerted}{family=\Book,size=\normalsize}
\setbeamerfont{subtitle}{family=\Light, size=\fontsize{12}{14}}
\setbeamerfont{frametitle}{family=\Book, size=\large}
\setbeamerfont{caption}{size=\small}
\setbeamerfont{caption name}{family=\Book}
\setbeamerfont{description item}{family=\Book}
\setbeamerfont{page number in head/foot}{size=\scriptsize}
\setbeamerfont{bibliography entry author}{family=\Light, size=\normalsize}
\setbeamerfont{bibliography entry title}{family=\Book, size=\normalsize}
\setbeamerfont{bibliography entry location}{family=\Light, size=\normalsize}
\setbeamerfont{bibliography entry note}{family=\Light, size=\small}
\linespread{1.15}

View File

@ -1,103 +1,170 @@
% Beamer mtheme
% \iffalse meta-comment
%
% Copyright 2014 Matthias Vogelgesang
% Copyright (C) 2015 by Matthias Vogelgesang <matthias.vogelgesang@gmail.com>
% ---------------------------------------------------------------------------
% Licensed under CC-BY-SA 4.0 International.
%
% The initial template comes from the HSRM beamer theme by Benjamin Weiss, which
% you can find at https://github.com/hsrmbeamertheme/hsrmbeamertheme.
% The initial template comes from the HSRM beamer theme by Benjamin Weiss,
% which you can find at https://github.com/benjamin-weiss/hsrmbeamertheme.
% ---------------------------------------------------------------------------
%
% The Current Maintainer of this work is Matthias Vogelgesang.
%
% This work consists of the files beamerthemem.dtx and beamerthemem.ins
% and the derived filebase beamerthemem.sty.
%
% \fi
%
% \iffalse
%<*driver>
\ProvidesFile{beamerthemem.dtx}
%</driver>
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<package>\ProvidesPackage{beamerthemem}
%<*package>
[2015/06/12 1.0.0 A Modern Beamer Theme]
%</package>
%
%<*driver>
\documentclass{ltxdoc}
\usepackage{beamerthemem}
\EnableCrossrefs
\CodelineIndex
\RecordChanges
\begin{document}
\DocInput{beamerthemem.dtx}
\PrintChanges
\PrintIndex
\end{document}
%</driver>
% \fi
%
% \CheckSum{0}
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
% Digits \0\1\2\3\4\5\6\7\8\9
% Exclamation \! Double quote \" Hash (number) \#
% Dollar \$ Percent \% Ampersand \&
% Acute accent \' Left paren \( Right paren \)
% Asterisk \* Plus \+ Comma \,
% Minus \- Point \. Solidus \/
% Colon \: Semicolon \; Less than \<
% Equals \= Greater than \> Question mark \?
% Commercial at \@ Left bracket \[ Backslash \\
% Right bracket \] Circumflex \^ Underscore \_
% Grave accent \` Left brace \{ Vertical bar \|
% Right brace \} Tilde \~}
%
%
% \changes{1.0.0}{2015/06/12}{Initial Stable Release.}
%
% \DoNotIndex{\newcommand,\newenvironment}
%
\ProvidesPackage{beamerthemem}
% Options & customization
% =======================
%
% To use any of options below, call them when invoking `mtheme` in the
% preamble of your slides:
% \StopEventually{}
%
% \usetheme[<options>]{m}
% \subsection{Main Theme}
%
% Option: usetitleprogressbar
% adds a thin progress bar underneath each frame title
% \iffalse
%<*package>
% \fi
%
%
% Options
%
% \begin{macrocode}
\newif\if@useTitleProgressBar
\@useTitleProgressBarfalse
\DeclareOptionBeamer{usetitleprogressbar}{
\@useTitleProgressBartrue
}
% Option: usetotalslideindicator
% formats slide numbering as #current/#total
% \end{macrocode}
%
% usetotalslideindicator
%
% \begin{macrocode}
\newif\if@useTotalSlideIndicator
\@useTotalSlideIndicatorfalse
\DeclareOptionBeamer{usetotalslideindicator}{
\@useTotalSlideIndicatortrue
}
% Option: noslidenumbers
% omits slide numbering entirely
% \end{macrocode}
%
% noslidenumbers
%
% \begin{macrocode}
\newif\if@noSlideNumbers
\@noSlideNumbersfalse
\DeclareOptionBeamer{noslidenumbers}{
\@noSlideNumberstrue
}
% Option: nosectionslide
% omits the dedicated slide at the start of each new section
% \end{macrocode}
%
% nosectionslide
%
% \begin{macrocode}
\newif\if@noSectionSlide
\@noSectionSlidefalse
\DeclareOptionBeamer{nosectionslide}{
\@noSectionSlidetrue
}
% Option: protectframetitle
% applies \protect to \insertframetitle to allow \cite, \ref, etc.
% \end{macrocode}
%
% protectframetitle
%
% \begin{macrocode}
\newif\if@protectFrameTitle
\@protectFrameTitlefalse
\DeclareOptionBeamer{protectframetitle}{
\@protectFrameTitletrue
}
% Option: nooffset
% turns off extra space used to vertically center content on frames
% \end{macrocode}
%
% nooffset
%
% \begin{macrocode}
\newlength{\@mtheme@voffset}
\setlength{\@mtheme@voffset}{2em}
\DeclareOptionBeamer{nooffset}{
\setlength{\@mtheme@voffset}{0em}
}
% Option: blockbg
% applies a gray background to blocks (via color theme `metropolis`)
% \end{macrocode}
%
% blockbg
%
% \begin{macrocode}
\DeclareOptionBeamer{blockbg}{
\PassOptionsToPackage{blockbg}{beamercolorthememetropolis}%
}
% Option: ...
% \end{macrocode}
%
% Unknown option error handling
%
% \begin{macrocode}
\DeclareOptionBeamer*{
\PackageWarning{beamerthemem}{Unknown option `\CurrentOption'}%
}
\ProcessOptionsBeamer
% Customize: \mthemetitleformat
% formats the main title, section titles, and frame titles
% \end{macrocode}
%
% mthemetitleformat
%
% \begin{macro}{\mthemetitleformat}
% \begin{macrocode}
\def\mthemetitleformat#1{\scshape #1}
% \end{macrocode}
% \end{macro}
%
% \begin{macrocode}
\mode<presentation>
%{{{ --- Packages ---------------------
% \end{macrocode}
%
% Packages
%
% \begin{macrocode}
\RequirePackage{etoolbox}
\RequirePackage{tikz}
\RequirePackage{pgfplots}
@ -112,24 +179,35 @@
\xetexorluatexfalse
\fi
\fi
\usetikzlibrary{backgrounds}
\usetikzlibrary{calc}
\usecolortheme{metropolis}
\ifxetexorluatex
\usefonttheme{metropolis}
\else
\PackageWarning{beamerthemem}{You need to compile with XeLaTeX or LuaLaTeX for the Fira fonts.}
\fi
%}}}
%{{{ --- Titlepage --------------------
% \end{macrocode}
%
% Make Titlepage
%
% \begin{macro}{\maketitle}
% \begin{macrocode}
\def\maketitle{\ifbeamer@inframe\titlepage\else\frame[plain]{\titlepage}\fi}
% \end{macrocode}
% \end{macro}
%
% Define Titlepage
%
% \begin{macro}{\titlepage}
% \begin{macrocode}
\def\titlepage{\usebeamertemplate{title page}}
% \end{macrocode}
% \end{macro}
%
% Set beamer title page template
%
% \begin{macrocode}
\setbeamertemplate{title page}
{
\begin{minipage}[b][\paperheight]{\textwidth}
@ -210,13 +288,26 @@
\vspace*{\@mtheme@voffset}
\end{minipage}
}
%}}}
%{{{ --- Progressbar ------------------
% \end{macrocode}
%
% Progressbar
%
% \begin{macrocode}
\RequirePackage{calc}
% \end{macrocode}
%
% \begin{macro}{\inserttotalframenumber}
% \begin{macrocode}
\def\inserttotalframenumber{100} % prevent \progressbar@percent from getting too big on first compile
% \end{macrocode}
% \end{macro}
%
% \begin{macrocode}
\newlength{\progressbar@percent}
% \end{macrocode}
%
% \begin{macro}{\progressbar}
% \begin{macrocode}
\newcommand{\progressbar}[1]{%
\setlength{\progressbar@percent}{%
#1 * \ratio{\insertframenumber pt}{\inserttotalframenumber pt}%
@ -227,16 +318,28 @@
\draw[fg, fill=fg] (0,0) rectangle (\progressbar@percent, 0.4pt);
\end{tikzpicture}%
}
%}}}
%{{{ --- Commands ---------------------
% \end{macrocode}
% \end{macro}
%
% Commands
%
% \begin{macro}{\insertsectionHEAD}
% \begin{macrocode}
\newcommand{\insertsectionHEAD}{%
\expandafter\insertsectionHEADaux\insertsectionhead}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\insertsectionHEADaux}
% \begin{macrocode}
\newcommand{\insertsectionHEADaux}[3]{\mthemetitleformat{#3}}%
% \end{macrocode}
% \end{macro}
%
% Create a plain frame with dark background
%
% \begin{macro}{\plain}
% \begin{macrocode}
\newcommand{\plain}[2][]{%
\begingroup
\setbeamercolor{background canvas}{use=palette primary,parent=palette primary}
@ -251,26 +354,33 @@
\end{frame}
\endgroup
}
%}}}
%{{{ --- Itemize ----------------------
% \end{macrocode}
% \end{macro}
%
% Itemize tweaks
%
% \begin{macrocode}
\setlength{\leftmargini}{1em}
% Actually one level should be enough but ...
\setlength{\leftmarginii}{1em}
\setlength{\leftmarginiii}{1em}
% \end{macrocode}
%
% \begin{macro}{\itemBullet}
% \begin{macrocode}
\newcommand{\itemBullet}{∙}
% \end{macrocode}
% \end{macro}
%
% \begin{macrocode}
\setbeamertemplate{itemize item}{\itemBullet}
\setbeamertemplate{itemize subitem}{\itemBullet}
\setbeamertemplate{itemize subsubitem}{\itemBullet}
\setlength{\parskip}{0.5em}
%}}}
%{{{ --- Sections ---------------------
% \end{macrocode}
%
% Sections
%
% \begin{macrocode}
\setbeamertemplate{section page}
{
\vspace{2em}
@ -283,9 +393,11 @@
\end{minipage}
\par
}
% \end{macrocode}
%
% Insert frame with section title at every section start
%
% \begin{macrocode}
\if@noSectionSlide\else%
\AtBeginSection[]
{
@ -296,16 +408,18 @@
\fi
}
\fi
%}}}
%{{{ --- Captions ---------------------
% \end{macrocode}
%
% Captions
%
% \begin{macrocode}
\setbeamertemplate{caption label separator}{: }
\setbeamertemplate{caption}[numbered]
%}}}
%{{{ --- Footline/footnote ------------
% \end{macrocode}
%
% Footline/footnote
%
% \begin{macrocode}
\usenavigationsymbolstemplate{}
\setbeamertemplate{footline}
{%
@ -322,17 +436,17 @@
\fi%
\end{beamercolorbox}%
}
\setbeamertemplate{footnote}
{%
\parindent 0em\noindent%
\raggedright
\usebeamercolor{footnote}\hbox to 0.8em{\hfil\insertfootnotemark}\insertfootnotetext\par%
}
%}}}
%{{{ --- Frametitle -------------------
% \end{macrocode}
%
% Frametitle
%
% \begin{macrocode}
\setbeamertemplate{frametitle}{%
\nointerlineskip
\begin{beamercolorbox}[wd=\paperwidth,leftskip=0.3cm,rightskip=0.3cm,ht=2.5ex,dp=1.5ex]{frametitle}
@ -351,13 +465,14 @@
\fi
\vspace{\@mtheme@voffset}
}
%}}}
%{{{ --- pgfplots ---------------------
%{{{ Colors
% \end{macrocode}
%
% pgfplots
%
% Colors
%
% TolColors from http://www.r-bloggers.com/the-paul-tol-21-color-salute/
% \begin{macrocode}
\definecolor{TolColor1}{HTML}{332288} % dark purple
\definecolor{TolColor2}{HTML}{6699CC} % dark blue
\definecolor{TolColor3}{HTML}{88CCEE} % light blue
@ -370,10 +485,11 @@
\definecolor{TolColor10}{HTML}{AA4466} % light pink
\definecolor{TolColor11}{HTML}{882255} % dark pink
\definecolor{TolColor12}{HTML}{AA4499} % light purple
%}}}
%{{{ Color cycles
% \end{macrocode}
%
% Color cycles
%
% \begin{macrocode}
\pgfplotscreateplotcyclelist{mbarplot cycle}{%
{draw=TolColor2, fill=TolColor2!70},
{draw=TolColor7, fill=TolColor7!70},
@ -388,17 +504,17 @@
{draw=TolColor3, fill=TolColor3!70},
{draw=TolColor5, fill=TolColor5!70},
}
\pgfplotscreateplotcyclelist{mlineplot cycle}{%
{TolColor2, mark=*, mark size=1.5pt},
{TolColor7, mark=square*, mark size=1.3pt},
{TolColor4, mark=triangle*, mark size=1.5pt},
{TolColor6, mark=diamond*, mark size=1.5pt},
}
%}}}
%{{{ Styles
% \end{macrocode}
%
% Styles
%
% \begin{macrocode}
\pgfplotsset{
compat=1.9,
mbaseplot/.style={
@ -466,16 +582,39 @@
1000 sep={}
},
}
%}}}
% \end{macrocode}
%
%
% \begin{macrocode}
\mode<all>
%{{{ misc
% \end{macrocode}
%
% misc
%
% \begin{macrocode}
\let\otp\titlepage
% \end{macrocode}
%
% \begin{macro}{\titlepage}
% \begin{macrocode}
\renewcommand{\titlepage}{\otp\addtocounter{framenumber}{-1}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\mreducelistspacing}
% \begin{macrocode}
\newcommand{\mreducelistspacing}{\vspace{-\topsep}}
% \end{macrocode}
% \end{macro}
%
% \begin{macrocode}
\linespread{1.15}
% \end{macrocode}
%}}}
%
% \iffalse
%</package>
% \fi
%
% \Finale
\endinput

7
build_dtx.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
mkdir -p .temptex
xelatex -shell-escape -output-directory .temptex mtheme.dtx
pythontex .temptex/mtheme.dtx
xelatex -shell-escape -output-directory .temptex mtheme.dtx
cp .temptex/mtheme.pdf ./mtheme.pdf

187
mtheme.dtx Normal file
View File

@ -0,0 +1,187 @@
%%
%% This is file `mtheme.sty',
%%
%% Copyright (C) 2015 by Matthias Vogelgesang <matthias.vogelgesang@gmail.com>
%% ---------------------------------------------------------------------------
%% Licensed under CC-BY-SA 4.0 International.
%%
%% The initial template comes from the HSRM beamer theme by Benjamin Weiss,
%% which you can find at https://github.com/benjamin-weiss/hsrmbeamertheme.
%% ---------------------------------------------------------------------------
%%
\documentclass{ltxdoc}
\EnableCrossrefs
\CodelineIndex
\RecordChanges
%\OnlyDescription
\usepackage{setspace}
\onehalfspacing
\usepackage{fontspec}
\setmainfont[BoldItalicFont={Fira Sans Italic},%
ItalicFont={Fira Sans Light Italic},%
BoldFont={Fira Sans}]{Fira Sans Light}
\setmonofont{Fira Mono}
\defaultfontfeatures{Ligatures=TeX}
\usepackage{pythontex}
\usepackage{enumitem}
\setlist[itemize]{noitemsep}
\setlist[enumerate]{noitemsep}
\usepackage{xcolor}
\definecolor{mDarkBrown}{HTML}{604c38}
\definecolor{mDarkTeal}{HTML}{23373b}
\definecolor{mLightBrown}{HTML}{EB811B}
\definecolor{mLightGreen}{HTML}{14B03D}
\definecolor{mBackground}{HTML}{FFFFFF}
\usepackage{listings}
\lstset{%
language=[LaTeX]{TeX},
basicstyle=\ttfamily,
keywordstyle=\color{mLightBrown}\bfseries,
commentstyle=\color{mLightGreen},
stringstyle=\color{mLightGreen},
backgroundcolor=\color{mBackground},
numbers=none,
numberstyle=\tiny\ttfamily,
stepnumber=2,
showspaces=false,
showstringspaces=false,
showtabs=false,
frame=none,
framerule=1pt,
tabsize=2,
rulesep=5em,
captionpos=b,
breaklines=true,
breakatwhitespace=false,
framexleftmargin=0em,
framexrightmargin=0em,
xleftmargin=0em,
xrightmargin=0em,
aboveskip=1em,
belowskip=1em,
morekeywords={usetheme,institute,maketitle,mthemetitleformat,plain,setbeamercolor},
}
\lstMakeShortInline|
\usepackage[colorlinks=true,
linkcolor=mLightBrown,
menucolor=mLightBrown,
pagecolor=mLightBrown,
urlcolor=mLightBrown]{hyperref}
\GetFileInfo{beamerthemem.dtx}
\title{Modern Beamer Presentations\\with the\\\textsc{mtheme} package}
\author{Matthias Vogelgesang \\ \url{matthias.vogelgesang@gmail.com}}
\date{\fileversion~from \filedate}
\begin{document}
\maketitle
\section{Introduction}
Beamer is an awesome way to make presentations with LaTeX. But the stock themes do not necessarily look particularly nice and the custom themes often scream “Beamer” at first sight. The goal of \textsc{mtheme} is to provide a modern Beamer theme with minimal visual noise. It provides section slides with a neat progress bar and
It is intended to be used with \href{https://www.mozilla.org/en-US/styleguide/products/firefox-os/typeface/}{Fira Sans}, a gorgeous typeface commissioned by Mozilla and designed by \href{http://www.carrois.com/fira-3-1/}{Carrois}. Hence to get the best results you should have installed the Fira typeface and use XeTeX to typeset your slides. Nevertheless this is no hard dependency. The theme also works fine with pdfTeX and the Computer Modern typeface.
The codebase is maintained on \href{https://github.com/matze/mtheme}{GitHub}. So if you have issues, find mistakes in the manual or want to contribute to make the theme even better get in contact there.
\section{Getting Started}
To get started with the theme is very simple. The following code shows a minimal example of a Beamer presentation using the \textsc{mtheme}.
\begin{lstlisting}
\documentclass[10pt]{beamer}
\usetheme{m} % load mtheme
\title{A modern beamer theme} % define title
\date{\today} % define date
\author{Matthias Vogelgesang} % define author
\institute{Institute} % define institute
\begin{document}
\maketitle % create titlepage
\section{First Section} % create section
\begin{frame}{First Frame} % first frame
Lorem ipsum dolor sit amet, ...
\end{frame}
\begin{frame}{Second Frame} % second frame
Lorem ipsum dolor sit amet, ...
\end{frame}
\end{document}
\end{lstlisting}
\section{Known Issues}
\section{Changelog}
\section{License}
The theme itself is licensed under a \href{http://creativecommons.org/licenses/by-sa/4.0/}{Creative Commons Attribution-ShareAlike 4.0 International License}. This means that if you change the theme and re-distribute it, you must retain the copyright notice header and license it under the same CC-BY-SA license. This does not affect the presentation that you create with the theme.
\section{Contributors}
\begin{pycode}
import sys
import requests
import json
LOGIN = None
try:
with open('../login.json', 'r') as f:
login_data = json.load(f)
if (login_data['user'] and login_data['password']):
LOGIN = (login_data['user'],
login_data['password'])
except:
print("Couldn't load login data.")
sys.exit()
def apiRequestLeft():
resp = requests.get('https://api.github.com/rate_limit',
auth=LOGIN)
if(resp.ok):
data = json.loads(resp.content)
return data['rate']['remaining']
else:
return 0
if not (apiRequestLeft):
print("No API requests left to load contributors list. Do you have " +
"saved your login information in 'login.json'?")
sys.exit()
resp = requests.get('https://api.github.com/repos/matze/mtheme/contributors',
auth=LOGIN)
print("\\begin{itemize}")
if(resp.ok):
data = json.loads(resp.content)
extracted_data = ((c['login'], c['html_url'], c['url']) for c in data)
for user_name, html_url, url in extracted_data:
resp = requests.get(url, auth=LOGIN)
if(resp.ok):
user_data = json.loads(resp.content)
try:
name = user_data['name']
except:
name = ""
else:
if not (apiRequestLeft):
name = "Couldn't load name. API request limit exceeded."
else:
"Couldn't load name."
print(" \\item \\href{%s}{%s} %s" % (html_url, user_name, name))
else:
print(" \\item Couldn't load contributors.")
print("\\end{itemize}")
\end{pycode}
\section{Implementation}
\DocInput{beamerthemem.dtx}
\DocInput{beamerfontthememetropolis.dtx}
\DocInput{beamercolorthememetropolis.dtx}
\end{document}

56
mtheme.ins Normal file
View File

@ -0,0 +1,56 @@
%% Copyright (C) 2015 by Matthias Vogelgesang <matthias.vogelgesang@gmail.com>
%% ---------------------------------------------------------------------------
%% Licensed under CC-BY-SA 4.0 International.
%%
%% The Current Maintainer of this work is Matthias Vogelgesang.
%%
%% This work consists of the files beamerthemem.dtx and beamerthemem.ins
%% and the derived filebase beamerthemem.sty.
%%
\input docstrip.tex
\keepsilent
\usedir{tex/latex/mtheme}
\preamble
This is a generated file
---------------------------------------------------------------------------
Copyright 2014 Matthias Vogelgesang
Licensed under CC-BY-SA 4.0 International.
The initial template comes from the HSRM beamer theme by Benjamin Weiss,
which you can find at https://github.com/benjamin-weiss/hsrmbeamertheme.
---------------------------------------------------------------------------
\endpreamble
\generate{\file{beamerthemem.sty}{%
\from{beamerthemem.dtx}{package}}
}
\generate{\file{beamerfontthememetropolis.sty}{%
\from{beamerfontthememetropolis.dtx}{package}}
}
\generate{\file{beamercolorthememetropolis.sty}{%
\from{beamercolorthememetropolis.dtx}{package}}
}
\obeyspaces
\Msg{**************************************************************}
\Msg{* *}
\Msg{* To finish the installation you have to move the following *}
\Msg{* files into a directory searched by TeX: *}
\Msg{* *}
\Msg{* beamerthemem.sty *}
\Msg{* beamerfontthememetropolis.sty *}
\Msg{* beamercolorthememetropolis.sty *}
\Msg{* *}
\Msg{* To produce the documentation run the file mtheme.dtx *}
\Msg{* through LaTeX. *}
\Msg{* *}
\Msg{* Happy TeXing! *}
\Msg{* *}
\Msg{**************************************************************}
\endbatchfile

BIN
mtheme.pdf Normal file

Binary file not shown.