Code Monkey home page Code Monkey logo

arabica's Introduction

arabica

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.

Thanks

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.

Features

  1. 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/)
  2. 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/)
  3. 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/.
  4. State-of-the-art technology stack and low tech debt at the same time.

Preview

Default title page Default info page Default example page
Default title page Default info page Default example page

Examples

Go to ./examples/ to view a list of complete example book projects.

Install

Preconditions

  1. Install TeX Live or any alternative LaTeX distribution.
  2. Install pandoc.

Clone

  1. Go to your templates directory: cd /path/to/your/templates/.
  2. Clone (or download) this repository git clone https://github.com/qualiacode/arabica.git
  3. Done!

Use

Optional: copy, paste, rename, delete

  1. 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/
  2. Go to your project directory: cd /path/to/your/projects/projectname/
  3. Delete all the files you do not need e.g. ./examples: rm -vrf examples/*

Set metadata

  1. Go to ./settings/00_01_metadata.yaml
  2. Set your (meta)data, the more the better.
  3. It is a good idea to add at least one author, a title and a year.
  4. Enclose your values ((meta)data) in single quotes: '()(meta)data)'.
  5. If you want to leave a value undefined enter a tilde.
  6. Example:
title: &title 'Short title'

subtitle: &subtitle ~

author: &author
  - 'Jane Roe'
  - 'John Doe'

year: '2018'

Set variables

  1. You can leave the defaults and you will be fine most of the time.
  2. If you want to change things, then the same rules as in Metadata settings apply.
  3. Go to ./settings/00_01_settings.yaml.
  4. Set your settings.
  5. Example:
classoption:
  - 'twoside'
  - 'twocolumn'
  - 'parskip=full'

custom_title_page: false

...

toc: true

Collect

  1. Do your research, collect your bibliographic data.
  2. Go to ./bib/
  3. Save your bibliographic data in Bib(La)TeX format (.bib) in the file ./bib/.references.bib.
  4. Go to ./settings/00_01_settings.yaml.
  5. Refer to your .bib file by adding the corresponding path of your .bib file as value to the corresponding key.
  6. Example (default):
bibliography: './bib/references.bib'
  1. 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}
}
  1. In this example your cite key for this bibliographic entry is Cantor1984.

Select

  1. Go to CSL
  2. Dowload your desired citation style language file e.g. chicago-author-date-de.csl.
  3. Save your .csl fiile to: ./csl/
  4. Go to ./settings/00_01_settings.yaml.
  5. Refer to your .csl file by adding the corresponding path of your .csl file as value to the corresponding key.
  6. Example (default):
csl: './csl/chicago-author-date-de.csl'

Write

  1. Go to ./core/ and write you markdown files.
  2. 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.
  3. A good example:
01_introduction.md
02_mainpart.md
03_conclusion.md

Cite

  1. Cite your sources by adding your refercences via [@citekey] to your markdown file(s) where ever you need them.
  2. Example:
„Cantor once said: ‚Wenn zwei wohldefinirte Mannigfaltigkeiten ...‘ [@Cantor1984]“

Run

  1. 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
  1. Done!

  2. Alternatively you can omit the long path in the --template option by copying the arabica.latex template located at ./controls/arabica.latex to the default directory of your pandoc templates located at ~/.pandoc/templates/.

  3. 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
  1. For debugging puproses you can produce a .tex file by runing pandoc with
-o ./output/projectname.tex
  1. 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.

  2. 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.

Enjoy

  1. Go to ./output/ and enjoy your results.

Other

  1. To read out your current default template execute: pandoc -D latex > default.latex.

License

MIT License

Copyright (c) 2018 Martin Maga

Go to ./LICENSE.md.

References and Credits

  1. Plot graphics: Gnuplot
  2. Blind text: Jasper Van der Jeugt lorem-markdownum
  3. Bug fix by Marco Torchiano @ StackExchange see Pandoc issue 1023.
  4. Atom editor
  5. Better Bib(La)TeX for Zotero
  6. CSL
  7. git
  8. KOMA-Script
  9. LaTeX
  10. Markdown
  11. Pandoc
  12. Pandoc-citeproc
  13. Pandoc-crossref
  14. TeXLive
  15. XeTeX
  16. YAML
  17. Zotero
  18. zotero-citations
  19. zotero-picker
  20. zotfile.

arabica's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

arabica's Issues

openBinaryFile: does not exist

Hi Martin,
thank you so much for your last commit :)
When I executed pandoc with the options in arabica wiki, I had the following error message

kpathsea:make_tex: Invalid filename \'Libertinus Serif\', contains \' \'
kpathsea:make_tex: Invalid filename \'Libertinus Serif\', contains \' \'
kpathsea:make_tex: Invalid filename \'Libertinus Serif\', contains \' \'
Error producing PDF.
! Package fontspec Error: The font "Libertinus Serif" cannot be found.

For immediate help type H <return>.
 ...                                              
                                                  
l.108     \setsansfont

Deleting Libertinus Serif/Sans/Mono/Math in 00_00_setting.yaml seems to resolve it, but I have onother error message
pandoc: ./output/projectname.pdf: openBinaryFile: does not exist (No such file or directory)

How can I resolve?

regards Igor

Getting error with defaults

Good day, I cloned the project and I'm getting a strange error I have not been able to sort out, I would really appreciate any pointers, here is my output

Microsoft Windows [Version 10.0.22621.1992]
(c) Microsoft Corporation. All rights reserved.

C:\Users\Erik>pandoc -s -o ./output/projectname.pdf --data-dir=C:\Users\Erik\Downloads\arabica-master --filter pandoc-crossref --pdf-engine=xelatex --top-level-division=chapter --number-sections C:\Users\Erik\Downloads\arabica-master\core\01_01_frontmatter_thanks.md C:\Users\Erik\Downloads\arabica-master\settings\00_00_settings.yaml C:\Users\Erik\Downloads\arabica-master\metadata\00_00_metadata.yaml --template C:\Users\Erik\Downloads\arabica-master\controls\arabica.latex
Error producing PDF.
! Argument of \str_uppercase:n has an extra }.
<inserted text>
                \par
l.208   \setmainlanguage[]{}


C:\Users\Erik>

Thanks in advance

! Undefined control sequence.

Hi @periodicpoint ,
after a long time I resumed an old job written with your amazing arabica.
When I tried to generate a new output.pdf, the terminal returned an error to me. So I though maybe I don't remember or I made some mistake and I decided to repeat step by step your example but terminal returned the same error.
This is the code
pandoc -s -o ./output/projectname.pdf --data-dir=/vp59m/Scrivania/arabica-master/ --filter pandoc-crossref --filter pandoc-citeproc --pdf-engine=xelatex --top-level-division=chapter --number-sections --template ./controls/arabica.latex ./core/*.md ./settings/*.yaml ./metadata/*.yaml [WARNING] Could not parse YAML metadata at line 469 column 1: Duplicate key in mapping: Scalar (Pos {posByteOffset = 10884, posCharOffset = 10860, posLine = 395, posColumn = 0}) (SUnknown Nothing "ccicons") Error producing PDF. ! Undefined control sequence. l.205 \subject
Any idea how I could fix it?
regards Igor

error producing pdf

Hi all! I followed step by step the amazing wiki but shell returns this error
Error producing PDF. ! Missing \endcsname inserted. <to be read again> \TU\textasciitilde l.86 \usetikzlibrary{\textasciitilde{}}
Any ideas?
cheers Igor

Makeing mainmatter one column

Hi,

Any advice for making the layout one column rather than two?
SImply removing '- 'twocolumn' from the class option in settings/00_00_settings.yaml
doesn't seem to make a difference...

Tom

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.