diff --git a/.gitignore b/.gitignore index f2afe1f..2bb9588 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,6 @@ -demo.pdf -mtheme.pdf +# Temporary files -*.fls +.latex-cache *.acn *.acr *.alg @@ -10,6 +9,7 @@ mtheme.pdf *.blg *.dvi *.fdb_latexmk +*.fls *.glg *.glo *.gls @@ -34,6 +34,8 @@ mtheme.pdf *.vrb *.xdy *.tdo -*.sty -.temptex + +# Output + +*.sty diff --git a/Makefile b/Makefile index 0548d79..af10e24 100644 --- a/Makefile +++ b/Makefile @@ -1,65 +1,75 @@ -TEXMFHOME = $(shell kpsewhich -var-value=TEXMFHOME) +INS = source/beamerthemem.ins +PACKAGE_SRC = $(wildcard source/*.dtx) +PACKAGE_STY = $(notdir $(PACKAGE_SRC:%.dtx=%.sty)) +DEMO_SRC = demo/demo.tex demo/demo.bib +DEMO_PDF = demo/demo.pdf +DOC_SRC = doc/metropolistheme.dtx +DOC_PDF = doc/metropolistheme.pdf + +CTAN_CONTENT = $(INS) $(PACKAGE_SRC) $(DOC_PDF) + +TEXMFHOME = $(shell kpsewhich -var-value=TEXMFHOME) INSTALL_DIR = $(TEXMFHOME)/tex/latex/mtheme -DOC_DIR = $(TEXMFHOME)/doc/latex/mtheme -TEMP_DIR = .temptex +DOC_DIR = $(TEXMFHOME)/doc/latex/mtheme +CACHE_DIR := $(shell pwd)/.latex-cache -INS = mtheme.ins -DEMO_SRC = demo.tex -DEMO_PDF = demo.pdf -DOC_SRC = mtheme.dtx -DOC_PDF = mtheme.pdf -DTX = $(wildcard *.dtx) -STY = $(patsubst %.dtx,%.sty,$(wildcard beamer*.dtx pgfplotsthemetol.dtx)) -CTAN_CONTENT = $(INS) $(DTX) $(DOC_PDF) - -TEXC := latexmk -xelatex -output-directory=$(TEMP_DIR) +COMPILE_TEX := latexmk -xelatex -output-directory=$(CACHE_DIR) +export TEXINPUTS:=$(shell pwd):$(shell pwd)/source:${TEXINPUTS} DOCKER_IMAGE = latex-image DOCKER_CONTAINER = latex-container +.PHONY: all sty doc demo clean install uninstall ctan clean-cache clean-sty ctan-version docker-run docker-build docker-rm -.PHONY: sty doc demo ctan clean install uninstall docker-run docker-build docker-rm +all: sty doc -all: sty doc demo - -$(STY): $(DTX) $(INS) - @latex $(INS) - -$(DEMO_PDF): $(STY) $(DEMO_SRC) - $(TEXC) $(DEMO_SRC) - @cp $(TEMP_DIR)/$(DEMO_PDF) . - -$(DOC_PDF): $(DOC_SRC) $(DTX) - @$(TEXC) $(DOC_SRC) - @cp $(TEMP_DIR)/$(DOC_PDF) . - -sty: $(STY) +sty: $(PACKAGE_STY) doc: $(DOC_PDF) demo: $(DEMO_PDF) -ctan: $(CTAN_CONTENT) - @mkdir -p mtheme - @cp $(CTAN_CONTENT) mtheme/ - @zip -q mtheme-$(shell grep -A1 ProvidesPackage < beamerthemem.dtx | grep -P -o '\d\.\d\.\d').zip mtheme/* - @rm -rf mtheme +clean: clean-cache clean-sty -clean: - @git clean -xfd - -install: $(STY) $(DOC_PDF) +install: $(PACKAGE_STY) $(DOC_PDF) @mkdir -p $(INSTALL_DIR) - @cp $(STY) $(INSTALL_DIR) + @cp $(PACKAGE_STY) $(INSTALL_DIR) @mkdir -p $(DOC_DIR) @cp $(DOC_PDF) $(DOC_DIR) uninstall: - @rm -f $(addprefix $(INSTALL_DIR)/, $(STY)) - @rm -f $(DOC_DIR)/$(DOC_PDF) + @rm -f $(addprefix $(INSTALL_DIR)/, $(PACKAGE_STY)) @rmdir $(INSTALL_DIR) + @rm -f $(DOC_DIR)/$(notdir $(DOC_PDF)) @rmdir $(DOC_DIR) +ctan: $(CTAN_CONTENT) ctan-version + @zip mtheme-$(shell date "+%Y-%m-%d").zip $(CTAN_CONTENT) + +clean-cache: + @rm -f $(CACHE_DIR)/* + +clean-sty: + @rm -f $(PACKAGE_STY) + +ctan-version: + @sed -i '' -- 's@\(ProvidesPackage.*\[\)[0-9/]*@\1$(shell date "+%Y/%m/%d")@' $(PACKAGE_SRC) + +$(CACHE_DIR): + @mkdir -p $(CACHE_DIR) + +$(PACKAGE_STY): $(PACKAGE_SRC) $(INS) | $(CACHE_DIR) clean-cache + @cd $(dir $(INS)) && latex -output-directory=$(CACHE_DIR) $(notdir $(INS)) + @cp $(addprefix $(CACHE_DIR)/,$(PACKAGE_STY)) . + +$(DOC_PDF): $(DOC_SRC) $(PACKAGE_STY) | $(CACHE_DIR) clean-cache + @cd $(dir $(DOC_SRC)) && $(COMPILE_TEX) $(notdir $(DOC_SRC)) + @cp $(CACHE_DIR)/$(notdir $(DOC_PDF)) $(DOC_PDF) + +$(DEMO_PDF): $(DEMO_SRC) $(PACKAGE_STY) | $(CACHE_DIR) clean-cache + @cd $(dir $(DEMO_SRC)) && $(COMPILE_TEX) $(notdir $(DEMO_SRC)) + @cp $(CACHE_DIR)/$(notdir $(DEMO_PDF)) $(DEMO_PDF) + docker-run: docker-build docker run --rm=true --name $(DOCKER_CONTAINER) -i -t -v `pwd`:/data $(DOCKER_IMAGE) make diff --git a/README.md b/README.md index ede08ba..df0617b 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,50 @@ -## Beamer mtheme +## Metropolis + +Metropolis is a simple, modern Beamer theme suitable for anyone to use. It tries to minimize noise and maximize space for content; the only visual flourish it offers is an (optional) progress bar added to each slide. The core design principles of the theme were described in a blog post [here](http://bloerg.net/2014/09/20/a-modern-beamer-theme.html). -The *mtheme* is a Beamer theme with minimal visual noise. The core design principles -of the theme were described in a [blog post](http://bloerg.net/2014/09/20/a-modern-beamer-theme.html). Not convinced? Have a look at the [demo slides](demo.pdf). ![Sample](http://i.imgur.com/Bxu52fz.png) -For further information take a look at the [manual](mtheme.pdf). + +## Installation + +Installing Metropolis, like any Beamer theme, involves four easy steps: + +1. **Download the source** with a `git clone` of the [Metropolis repository](https://github.com/matze/mtheme) or as a [zip archive](https://github.com/matze/mtheme/archive/master.zip) of the latest development version. + +2. **Compile the style files** by running `make sty` inside the downloaded + directory. (Or run LaTeX directly on `source/metropolistheme.ins`.) + +3. **Move the resulting `*.sty` files** to the folder containing your presentation. To use Metropolis with many presentations, run `make install` or move the `*.sty` files to a folder in your TeX path instead. + +4. **Use the theme for your presentation** by declaring `\usetheme{m}` in + the preamble of your Beamer document. + + +## Usage + +The following code shows a minimal example of a Beamer presentation using Metropolis. + +```latex +\documentclass{beamer} +\usetheme{m} % Use metropolis theme +\title{A minimal example} +\date{\today} +\author{Matthias Vogelgesang} +\institute{Centre for Modern Beamer Themes} +\begin{document} + \maketitle + \section{First Section} + \begin{frame}{First Frame} + Hello, world! + \end{frame} +\end{document} +``` + +Detailed information on using Metropolis can be found in the [manual](doc/metropolistheme.pdf). + ## License -The theme itself is licensed under a [Creative Commons Attribution-ShareAlike -4.0 International License](http://creativecommons.org/licenses/by-sa/4.0/). 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. +The theme itself is licensed under a [Creative Commons Attribution-ShareAlike 4.0 International License](http://creativecommons.org/licenses/by-sa/4.0/). 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. diff --git a/demo.pdf b/demo.pdf deleted file mode 100644 index ee73c7e..0000000 Binary files a/demo.pdf and /dev/null differ diff --git a/demo.bib b/demo/demo.bib similarity index 100% rename from demo.bib rename to demo/demo.bib diff --git a/demo/demo.pdf b/demo/demo.pdf new file mode 100644 index 0000000..be08755 Binary files /dev/null and b/demo/demo.pdf differ diff --git a/demo.tex b/demo/demo.tex similarity index 100% rename from demo.tex rename to demo/demo.tex diff --git a/logo/logo.pdf b/demo/logo.pdf similarity index 100% rename from logo/logo.pdf rename to demo/logo.pdf diff --git a/logo/logo.svg b/demo/logo.svg similarity index 100% rename from logo/logo.svg rename to demo/logo.svg diff --git a/mtheme.dtx b/doc/metropolistheme.dtx similarity index 75% rename from mtheme.dtx rename to doc/metropolistheme.dtx index 5499759..a445a92 100644 --- a/mtheme.dtx +++ b/doc/metropolistheme.dtx @@ -86,66 +86,103 @@ \newcommand{\themename}{\textsc{metropolis}\xspace} \GetFileInfo{beamerthemem.dtx} -\title{Modern Beamer Presentations\\with the\\\themename package} +\title{Modern Beamer Presentations with the \themename{} package} \author{Matthias Vogelgesang \\ \url{matthias.vogelgesang@gmail.com}} \date{v0.x.x} \begin{document} \maketitle +\tableofcontents \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 \themename 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 +Beamer is an awesome way to make presentations with LaTeX, but its theme +selection is surprisingly sparse. The stock themes share an aesthetic that is +now overused and can be a little cluttered, and the few distinctive custom +themes available are often specialized for a particular corporate or +institutional brand. + +The goal of \themename{} is to provide a simple, modern Beamer theme suitable +for anyone to use. It tries to minimize noise and maximize space for content; +the only visual flourish it offers is an (optional) progress bar added to each +slide or to the section slides. + +By default, \themename{} uses \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. +\href{http://www.carrois.com/fira-3-1/}{Carrois}. For best results, you will +need the Fira typeface installed and use Xe\LaTeX{} to typeset your slides. +However, \themename{} can also be used other typefaces and \LaTeX{} build +systems. -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 touch there. +\themename's codebase is maintained on \href{https://github.com/matze/mtheme} +{GitHub}. If you have issues, find mistakes in the manual or want to help make +the theme even better, please get in touch there. The +\href{https://github.com/matze/mtheme/graphs/contributors} +{full list of contributors} already contains over a dozen names! \section{Getting Started} -\subsection{Installation} +\subsection{Installing from GitHub} -The \themename theme uses Make as build system. Hence the installation is very -straight forward. Simply type -\begin{lstlisting} -$ make -$ make install -\end{lstlisting} -in the top directory and all the files will be created and installed on your -computer. The complete list of make rules is as follows: +Installing \themename{}, like any Beamer theme, involves four easy steps: +\begin{description} + \item[Download the source] with a |git clone| of the + \href{https://github.com/matze/mtheme}{\themename{} repository} or as a + \href{https://github.com/matze/mtheme/archive/master.zip}{zip archive} + of the latest development version. + + \item[Compile the style files] by running |make sty| inside the downloaded + directory. (Or run \LaTeX{} directly on |source/metropolistheme.ins|.) + + \item[Move the resulting |*.sty| files] to the folder containing your + presentation. To use \themename{} with many presentations, run + |make install| or move the |*.sty| files to a folder in your \TeX{} path + instead. + + \item[Use the theme for your presentation] by declaring |\usetheme{m}| in + the preamble of your Beamer document. +\end{description} + +\themename{} uses the Make build system to offer the following installation +options for advanced users: \begin{description} - \item[all] \hfill \\ - Build the theme, the manual and the demo presentation. - \item[install] \hfill \\ - Install the theme into your local texmf folder. - \item[uninstall] \hfill \\ - Remove the theme from your local texmf folder. - \item[sty] \hfill \\ - Creat the package files. - \item[doc] \hfill \\ - Build the documentation. - \item[demo] \hfill \\ - Build the demo presentation. - \item[demo-min] \hfill \\ - Build the minimal demo presentation. - \item[ctan] \hfill \\ - Create a package for CTAN distribution. + \item[|make sty|] builds the theme style files. + \item[|make doc|] builds this documentation manual. + \item[|make demo|] builds a demo presentation to test the features of + \themename{}. + \item[|make all|] builds the theme, manual, and demo presentation. + \item[|make clean|] removes the files generated by |make all|. + \item[|make install|] installs the theme into your local texmf folder. + \item[|make uninstall|] removes the theme from your local texmf folder. + \item[|make ctan|] creates a package for CTAN distribution. \end{description} +\subsection{A Minimal Example} + +The following code shows a minimal example of a Beamer presentation using \themename. + +\begin{lstlisting} +\documentclass{beamer} +\usetheme{m} % Use metropolis theme +\title{A minimal example} +\date{\today} +\author{Matthias Vogelgesang} +\institute{Centre for Modern Beamer Themes} +\begin{document} + \maketitle + \section{First Section} + \begin{frame}{First Frame} + Hello, world! + \end{frame} +\end{document} +\end{lstlisting} + + \subsection{Dependencies} \begin{itemize} @@ -172,29 +209,7 @@ $ pandoc -t beamer --latex-engine=xelatex -V theme:m -o output.pdf input.md \end{lstlisting} -\subsection{A Minimal Example} -To get started with the theme is very simple. The following code shows a -minimal example of a Beamer presentation using \themename. - -\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{Customization} \subsection{Package options} @@ -344,11 +359,6 @@ license it under the same CC-BY-SA license. This does not affect the presentation that you create with the theme. -\section{Contributors} - -For a full list of contributors please visit the -\href{https://github.com/matze/mtheme/graphs/contributors}{GitHub Repository}. - \section{Implementation} diff --git a/doc/metropolistheme.pdf b/doc/metropolistheme.pdf new file mode 100644 index 0000000..d26d113 Binary files /dev/null and b/doc/metropolistheme.pdf differ diff --git a/Dockerfile b/docker/Dockerfile similarity index 100% rename from Dockerfile rename to docker/Dockerfile diff --git a/getFiraFont.sh b/docker/getFiraFont.sh similarity index 100% rename from getFiraFont.sh rename to docker/getFiraFont.sh diff --git a/mtheme.pdf b/mtheme.pdf deleted file mode 100644 index 84df53e..0000000 Binary files a/mtheme.pdf and /dev/null differ diff --git a/beamercolorthememetropolis.dtx b/source/beamercolorthememetropolis.dtx similarity index 98% rename from beamercolorthememetropolis.dtx rename to source/beamercolorthememetropolis.dtx index ed41371..571b397 100644 --- a/beamercolorthememetropolis.dtx +++ b/source/beamercolorthememetropolis.dtx @@ -13,8 +13,7 @@ % \ProvidesFile{beamercolorthememetropolis.dtx} %<*package> \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{beamercolorthememetropolis} - [2015/06/12 A Modern Beamer Color Theme] +\ProvidesPackage{beamercolorthememetropolis}[2015/06/12 Metropolis color theme] % % \documentclass{ltxdoc} % \usepackage{beamercolorthememetropolis} diff --git a/beamerfontthememetropolis.dtx b/source/beamerfontthememetropolis.dtx similarity index 96% rename from beamerfontthememetropolis.dtx rename to source/beamerfontthememetropolis.dtx index 81e10ab..432f955 100644 --- a/beamerfontthememetropolis.dtx +++ b/source/beamerfontthememetropolis.dtx @@ -13,8 +13,7 @@ % \ProvidesFile{beamerfontthememetropolis.dtx} %<*package> \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{beamerfontthememetropolis} - [2015/06/12 A Modern Beamer Font Theme] +\ProvidesPackage{beamerfontthememetropolis}[2015/06/12 Metropolis font theme] % % \documentclass{ltxdoc} % \usepackage{beamerfontthememetropolis} diff --git a/beamerinnerthememetropolis.dtx b/source/beamerinnerthememetropolis.dtx similarity index 99% rename from beamerinnerthememetropolis.dtx rename to source/beamerinnerthememetropolis.dtx index c916a96..2a86cfe 100644 --- a/beamerinnerthememetropolis.dtx +++ b/source/beamerinnerthememetropolis.dtx @@ -13,8 +13,7 @@ % \ProvidesFile{beamerinnerthememetropolis.dtx} %<*package> \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{beamerinnerthememetropolis} - [2015/06/12 A Modern Beamer Theme] +\ProvidesPackage{beamerinnerthememetropolis}[2015/06/12 Metropolis inner theme] % % \documentclass{ltxdoc} % \usepackage{beamerinnerthememetropolis} diff --git a/beamerouterthememetropolis.dtx b/source/beamerouterthememetropolis.dtx similarity index 98% rename from beamerouterthememetropolis.dtx rename to source/beamerouterthememetropolis.dtx index f46bf6f..aee9493 100644 --- a/beamerouterthememetropolis.dtx +++ b/source/beamerouterthememetropolis.dtx @@ -13,8 +13,7 @@ % \ProvidesFile{beamerouterthememetropolis.dtx} %<*package> \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{beamerouterthememetropolis} - [2015/06/12 A Modern Beamer Theme] +\ProvidesPackage{beamerouterthememetropolis}[2015/06/12 Metropolis outer theme] % % \documentclass{ltxdoc} % \usepackage{beamerouterthememetropolis} diff --git a/beamerthemem.dtx b/source/beamerthemem.dtx similarity index 98% rename from beamerthemem.dtx rename to source/beamerthemem.dtx index 543843f..84e5d0f 100644 --- a/beamerthemem.dtx +++ b/source/beamerthemem.dtx @@ -13,8 +13,7 @@ % \ProvidesFile{beamerthemem.dtx} %<*package> \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{beamerthemem} - [2015/06/12 A Modern Beamer Theme] +\ProvidesPackage{beamerthemem}[2015/06/12 Metropolis Beamer theme] % % \documentclass{ltxdoc} % \usepackage{beamerthemem} diff --git a/mtheme.ins b/source/beamerthemem.ins similarity index 100% rename from mtheme.ins rename to source/beamerthemem.ins diff --git a/pgfplotsthemetol.dtx b/source/pgfplotsthemetol.dtx similarity index 100% rename from pgfplotsthemetol.dtx rename to source/pgfplotsthemetol.dtx