Skip to content

Instantly share code, notes, and snippets.

@matze
Created December 3, 2012 11:45
Show Gist options
  • Save matze/4194445 to your computer and use it in GitHub Desktop.
Save matze/4194445 to your computer and use it in GitHub Desktop.
Pandoc template
TEMPLATE = template.tex
STYLESHEET = style.css
MD = $(wildcard *.md)
TEX = $(patsubst %.md,%.tex,$(MD))
HTML = $(patsubst %.md,%.html,$(MD))
PDF = $(patsubst %.md,%.pdf,$(MD))
.PHONY: clean pdf html
all: pdf html
html: $(HTML)
pdf: $(PDF)
%.html: %.md $(STYLESHEET)
pandoc $< -s -S -c $(STYLESHEET) -o $@
%.pdf: %.tex
pdflatex $<
%.tex: %.md $(TEMPLATE)
pandoc $< -s --template=$(TEMPLATE) -o $@
clean:
rm -f $(TEX) $(HTML) $(PDF) *.log *.aux *.blg *.bbl *.out
/* --- Reset ------------------------------------------------------ */
body, div, dl, dt, dd, ul, ol, li,
h1, h2, h3, h4, h5, h6,
pre, form, fieldset, input, textarea,
p, blockquote, th, td {
margin: 0;
padding: 0;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
fieldset, img {
border: 0;
}
address, caption, cite, dfn, th, var {
font-style: normal;
font-weight: normal;
}
caption, th {
text-align: left;
}
h1, h2, h3, h4, h5, h6 {
font-size: 100%;
font-weight: normal;
}
q:before, q:after {
content: '';
}
abbr, acronym {
border: 0;
}
/* --- Main ------------------------------------------------------- */
html {
font-family: "Droid Serif", serif;
}
body {
max-width: 800px;
text-align: left;
margin-top: 24px;
margin-left: auto;
margin-right: auto;
line-height: 1.5em;
}
p {
margin-bottom: 24px;
}
h1, h2, h3, h4, h5, h6 {
margin-bottom: 24px;
font-family: "Droid Sans", sans-serif;
font-weight: bold;
}
h1 {
font-size: 1.5em;
line-height: 1em;
margin-top: 2em;
padding-bottom: 0.5em;
border-bottom: 2px dotted #bbb;
}
h2 {
font-size: 1.375em;
line-height: 1.0909em;
}
h3 {
font-size: 1.25em;
line-height: 1.2em;
}
h4 {
font-size: 1.125em;
line-height: 1.333em;
}
h5, h6 {
font-size: 1em;
line-height: 1.5em;
}
h1 > a {
color: #555;
text-decoration: none;
}
a {
color: #8e3557;
text-decoration: none;
}
a:hover {
color: #88a33e;
}
h1:hover :after,
h2:hover :after,
h3:hover :after,
h4:hover :after,
h5:hover :after,
h6:hover :after {
content: " \2191";
}
pre {
margin-bottom: 24px;
line-height: 1.2em;
font-size: large;
}
code {
font-family: "Inconsolata", monospace;
}
ul, ol {
list-style-position: inside;
padding-left: 1em;
text-indent: -1em;
margin-left: 0;
margin-bottom: 24px;
}
li + li {
margin-top: 0.1em;
}
ul ul,
ol ol {
margin: 0 0 0 24px;
}
table {
width: 100%;
margin-bottom: 24px;
}
th {
color: #555;
font-family: 'Droid Sans', sans-serif;
font-weight: bold;
border-bottom: 1px dotted #bbb;
}
td, th {
padding: 2px;
}
dl {
margin-bottom: 24px;
}
dt {
font-style: italic;
}
dd {
margin-top: 12px;
padding-left: 1em;
}
.title {
font-size: xx-large;
color: #555;
}
.author {
font-size: 1.25em;
font-weight: normal;
}
\documentclass[ngerman,
parskip=half]{scrartcl}
% --- Preamble -----------------------------------------------------------------
\usepackage[utf8]{inputenc}
\usepackage[german]{babel}
\usepackage{graphicx, xcolor}
\usepackage{tikz}
\usepackage{lmodern}
\usepackage{textcomp}
\usepackage[sc,
osf]{mathpazo}
\usepackage{booktabs}
\usepackage{csquotes}
\usepackage{hyperref}
\definecolor{link-color}{RGB}{64,63,51}
\definecolor{cite-color}{named}{magenta}
% --- Font adjustment
\linespread{1.05}
\setkomafont{disposition}{\fontseries{sbc}\sffamily}
% --- hyperref
\hypersetup{
colorlinks=true,
linkcolor=link-color,
citecolor=cite-color
}
% --- TikZ basics
\usetikzlibrary{matrix}
\usetikzlibrary{arrows}
\usetikzlibrary{snakes}
$if(title)$
\title{$title$}
\author{$author$}
$endif$
\begin{document}
$if(title)$
\maketitle
$endif$
$body$
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment