A sound and versatile pandoc LaTeX boilerplate to produce academic books (in PDF) utilising solely modular Markdown files, featuring YAML, KOMA-Script, BibLaTeX and CSL.
For typesetting an article please see the robusta boilerplate.
The arabica boilerplate is inspired by the pandoc latex template eisvogel by Wandmalfarbe and was built with the help of the following sources and tools: References and Credits. For other projects like the one at hand please see the list of user contributed templates at the pandoc wiki and the list of pandoc boilerplates at the pandoc wiki.
- Simple Your writing process is as simple as possible because you only need to write Markdown files and let the strong defaults of pandoc and LaTeX work for you. (see
./controls/
and./settings/
) - Configurable Your book projects are as configurable as possible because you can set your metadata and variables via YAML files and then reuse them if you want to. (see
./settings/
) - Modular Your book projects are as modular as possible because of strict separation of contents and presentation (style).
Your content live in separate directory (see
./core/
) where you can organise them intuitively. The pandoc template itself lives in./controls/
. - State-of-the-art technology stack and low tech debt at the same time.
Default title page | Default info page | Default example page |
---|---|---|
Go to ./examples/
to view a list of complete example book projects.
- Install TeX Live or any alternative LaTeX distribution.
- Install pandoc.
- Go to your templates directory:
cd /path/to/your/templates/
. - Clone (or download) this repository
git clone https://github.com/qualiacode/arabica.git
- Done!
- Copy the entire arabica boilerplate located at your own local templates directory and paste the entire arabica boilerplate to your directory of your own projects directory:
cp /path/to/your/templates/arabica/* /path/to/your/projects/projectname/
- Go to your project directory:
cd /path/to/your/projects/projectname/
- Delete all the files you do not need e.g.
./examples
:rm -vrf examples/*
- Go to
./settings/00_01_metadata.yaml
- Set your (meta)data, the more the better.
- It is a good idea to add at least one author, a title and a year.
- Enclose your values ((meta)data) in single quotes:
'()(meta)data)'
. - If you want to leave a value undefined enter a tilde.
- Example:
title: &title 'Short title'
subtitle: &subtitle ~
author: &author
- 'Jane Roe'
- 'John Doe'
year: '2018'
- You can leave the defaults and you will be fine most of the time.
- If you want to change things, then the same rules as in Metadata settings apply.
- Go to
./settings/00_01_settings.yaml
. - Set your settings.
- Example:
classoption:
- 'twoside'
- 'twocolumn'
- 'parskip=full'
custom_title_page: false
...
toc: true
- Do your research, collect your bibliographic data.
- Go to
./bib/
- Save your bibliographic data in
Bib(La)TeX
format (.bib
) in the file./bib/.references.bib
. - Go to
./settings/00_01_settings.yaml
. - Refer to your
.bib
file by adding the corresponding path of your.bib
file asvalue
to the correspondingkey
. - Example (default):
bibliography: './bib/references.bib'
- Example entry in your
.bib
file:
@article{Cantor1984,
langid = {german},
title = {Ein Beitrag zur Mannigfaltigkeitslehre},
volume = {1877},
doi = {10.1007/978-3-7091-9516-1_3},
journaltitle = {Über unendliche, lineare Punktmannigfaltigkeiten},
date = {1984},
pages = {25-44},
author = {Cantor, Georg}
}
- In this example your
cite key
for this bibliographic entry isCantor1984
.
- Go to CSL
- Dowload your desired citation style language file e.g.
chicago-author-date-de.csl
. - Save your
.csl
fiile to:./csl/
- Go to
./settings/00_01_settings.yaml
. - Refer to your
.csl
file by adding the corresponding path of your.csl
file asvalue
to the correspondingkey
. - Example (default):
csl: './csl/chicago-author-date-de.csl'
- Go to
./core/
and write you markdown files. - Organise them as you like but keep in mind that pandoc will append them sequentially, determined by the alpha-numeric ordering of your file names.
- A good example:
01_introduction.md
02_mainpart.md
03_conclusion.md
- Cite your sources by adding your refercences via
[@citekey]
to your markdown file(s) where ever you need them. - Example:
„Cantor once said: ‚Wenn zwei wohldefinirte Mannigfaltigkeiten ...‘ [@Cantor1984]“
- Execute pandoc with the following options:
pandoc \
-s \
-o ./output/projectname.pdf \
--data-dir=$HOME/path/to/your/projects/projectname/ \
--filter pandoc-crossref \
--filter pandoc-citeproc \
--pdf-engine=xelatex \
--top-level-division=chapter \
--number-sections \
--template $HOME/path/to/your/projects/projectname/controls/arabica.latex \
./core/*.md \
./settings/*.yaml \
./metadata/*.yaml
-
Done!
-
Alternatively you can omit the long path in the
--template
option by copying thearabica.latex
template located at./controls/arabica.latex
to the default directory of your pandoc templates located at~/.pandoc/templates/
. -
If you have copied the
arabica.latex
template into the directory of your default pandoc templates, then you can execute pandoc like this:
pandoc \
-s \
-o ./output/projectname.pdf \
--data-dir=$HOME/path/to/your/projects/projectname/ \
--filter pandoc-crossref \
--filter pandoc-citeproc \
--pdf-engine=xelatex \
--top-level-division=chapter \
--number-sections \
--template arabica.latex \
./core/*.md \
./settings/*.yaml \
./metadata/*.yaml
- For debugging puproses you can produce a
.tex
file by runing pandoc with
-o ./output/projectname.tex
-
Please note, though: the arabica boilerplate is designed to be used with the given directory structure respectively file structure indicated in BODYPLAN.md. Of particular importance are the metadata and settings files:
./metadata/00_01_metadata.yaml
./settings/00_02_settings.yaml
. -
The boilerplate should work even if you change its inner structure but keep in mind to change all the paths and variables accordingly. The
arabica.template
file may work as long as you provide some basic variables used in this template file.
- Go to
./output/
and enjoy your results.
- To read out your current default template execute:
pandoc -D latex > default.latex
.
MIT License
Copyright (c) 2018 Martin Maga
Go to ./LICENSE.md.
- Plot graphics: Gnuplot
- Blind text: Jasper Van der Jeugt lorem-markdownum
- Bug fix by Marco Torchiano @ StackExchange see Pandoc issue 1023.
- Atom editor
- Better Bib(La)TeX for Zotero
- CSL
- git
- KOMA-Script
- LaTeX
- Markdown
- Pandoc
- Pandoc-citeproc
- Pandoc-crossref
- TeXLive
- XeTeX
- YAML
- Zotero
- zotero-citations
- zotero-picker
- zotfile.