artikel-vorlage/Makefile

55 lines
1.5 KiB
Makefile
Raw Normal View History

2014-10-12 23:27:17 +02:00
# Verzeichnis, in dem sich dieses Mafile befindet
DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
vorlage: vorlage.pdf vorlage.html vorlage.docx vorlage.odt
2014-09-12 15:13:21 +02:00
# Artikel-Vorlage für Pandoc (LaTeX und HTML)
TEMPLATE=informationspraxis-artikel-vorlage
2014-10-12 23:27:17 +02:00
LATEX_OPTIONS=--template $(DIR)/$(TEMPLATE).tex
HTML_OPTIONS=--template $(DIR)/$(TEMPLATE).html
2014-09-12 15:13:21 +02:00
# Einstellungen zum PDF-Seitenlayout.
# Grundlagen siehe <https://en.wikibooks.org/wiki/LaTeX/Page_Layout>
# und <http://johnmacfarlane.net/pandoc/demo/example9/templates.html>
2014-10-12 23:27:17 +02:00
ENDNOTES=1
2014-09-12 15:13:21 +02:00
LATEX_OPTIONS+=-V fontfamily=arev
LATEX_OPTIONS+=-V fontsize=12pt
LATEX_OPTIONS+=-V papersize=a4paper
LATEX_OPTIONS+=-V documentclass=article
LATEX_OPTIONS+=-V headheight=20mm -V headsep=10mm
LATEX_OPTIONS+=-V footskip=20mm
LATEX_OPTIONS+=-V top=30mm -V bottom=40mm -V left=25mm -V right=25mm
2014-10-12 23:27:17 +02:00
LATEX_OPTIONS+=-V endnotes=$(ENDNOTES)
2014-09-12 15:13:21 +02:00
LATEX_OPTIONS+=-V lang=ngerman
LATEX_OPTIONS+=-V graphics=1
2014-09-12 14:36:30 +02:00
2014-09-12 15:13:21 +02:00
# Konvertierungsregeln von Markdown (Artikel) und YAML (Metadaten) nach HTML & PDF
2014-09-15 12:33:35 +02:00
.SUFFIXES: .md .html .tex .pdf .docx .odt
2014-09-12 15:13:21 +02:00
.PHONY: clean
2014-09-12 14:36:30 +02:00
.md.html:
2014-09-12 15:13:21 +02:00
cat $(patsubst %.md,%.yml,$<) $< | pandoc -s -S -t html5 $(HTML_OPTIONS) -o $@ -
2014-09-12 14:36:30 +02:00
.md.tex:
2014-09-12 15:13:21 +02:00
cat $(patsubst %.md,%.yml,$<) $< | pandoc -s -S $(LATEX_OPTIONS) -o $@ -
2014-09-12 14:36:30 +02:00
2014-10-12 23:27:17 +02:00
#.md.pdf:
# cat $(patsubst %.md,%.yml,$<) $< | pandoc -s -S $(LATEX_OPTIONS) -o $@ -
.tex.pdf:
yes "" | pdflatex $<
2014-09-12 15:13:21 +02:00
2014-09-15 12:33:35 +02:00
.md.docx:
cat $(patsubst %.md,%.yml,$<) $< | pandoc -s -S -o $@ -
2014-09-21 20:42:10 +02:00
.md.odt:
cat $(patsubst %.md,%.yml,$<) $< | pandoc -s -S -o $@ -
2014-09-12 15:13:21 +02:00
clean:
2014-09-16 14:37:32 +02:00
rm -f *.log *.aux *.toc *.out
2014-09-12 15:13:21 +02:00