md2pdf

pandoc wrapper for converting markdown to pdf
Index Commits Files Refs README

Markdown to PDF

This is a markdown to pdf wrapper for pandoc, its main purpose is to generate a similar PDF to the one generated with Obsidian by default.

Example output

pdf

Usage

$ md2pdf
md2pdf [OPTIONS] <input>.md
OPTIONS:
  -H, --style <file>.tex
  -l, --lua-filter <file>.lua
  -o, --output <file>

Dependencies

This is a Pandoc wrapper, so pandoc is the main dependency. For generating the PDF pandoc mainly uses latex packages, so having latex installed is required, in particular if you have Arch Linux the following latex packages are recommended for a general build without errors:

sudo pacman -S texlive-fontsextra texlive-fontsrecommended texlive-langother
texlive-latexextra texlive-binextra texlive-plaingeneric texlive-formatsextra

The included style.tex file uses external fonts, for the base text and sections titles the font Inter is used (which is similar to Helvetica) and Fira math for the math fonts. Of course the fonts are optional since latex already includes base fonts.

Installation

If you want to install this script to your system, copy the executable to $HOME/.local/bin or to /usr/bin if you want to install it user-wide or system-wide respectively.

$ cp ./md2pdf $HOME/.local/bin
# cp ./md2pdf /usr/bin