From 38592e254b569e04cf42408b733d7de96fb768c9 Mon Sep 17 00:00:00 2001 From: Benjamin Weiss Date: Fri, 12 Jun 2015 10:24:24 +0200 Subject: [PATCH] added contributors section As I was not able to get pythontex running with latexmk, I wrote a simple build script. It uses a hidden folder for the intermediate files. The folder is added to .gitignore --- .gitignore | 2 ++ package/build.sh | 7 +++++++ package/mtheme.dtx | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+) create mode 100755 package/build.sh diff --git a/.gitignore b/.gitignore index 2d7b963..5739e3c 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,5 @@ demo.pdf *.vrb *.xdy *.tdo + +package/.temptex diff --git a/package/build.sh b/package/build.sh new file mode 100755 index 0000000..fcc0f43 --- /dev/null +++ b/package/build.sh @@ -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 diff --git a/package/mtheme.dtx b/package/mtheme.dtx index 282672b..d1d65e3 100644 --- a/package/mtheme.dtx +++ b/package/mtheme.dtx @@ -24,6 +24,9 @@ ItalicFont={Fira Sans Light Italic},% BoldFont={Fira Sans}]{Fira Sans Light} \setmonofont{Fira Mono} +\defaultfontfeatures{Ligatures=TeX} + +\usepackage{pythontex} \usepackage{enumitem} \setlist[itemize]{noitemsep} @@ -118,6 +121,35 @@ To get started with the theme is very simple. The following code shows a minimal 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 httplib +import json + +URL = 'api.github.com' +REQ = '/repos/matze/mtheme/contributors' +USER_AGENT = ("curl/7.13.2 " + + "(i386-pc-linux-gnu) " + + "libcurl/7.13.2 " + + "OpenSSL/0.9.7e" + + "zlib/1.2.2" + + "libidn/0.5.13") +HEADERS = {"User-Agent": USER_AGENT} + +conn = httplib.HTTPSConnection(URL) +conn.request('GET', REQ, None, HEADERS) +resp = conn.getresponse() + +print('\\begin{itemize}') +if resp.status == 200: + data = json.loads(resp.read()) + for name, url in ((c['login'], c['html_url']) for c in data): + print(" \\item \\href{%s}{%s}" % (url, name)) +else: + print(" \\item Couldn't get contributors") +print('\\end{itemize}') +\end{pycode} + \section{Implementation} \DocInput{beamerthemem.dtx} \DocInput{beamerfontthememetropolis.dtx}