repos/md2pdf

pandoc wrapper for converting markdown to pdf
Commits Files Refs README
README.md (54 lines)

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.

  • User wide:
$ cp ./md2pdf $HOME/.local/bin
  • System wide:
# cp ./md2pdf /usr/bin
   1 # Markdown to PDF
   2 
   3 This is a markdown to pdf wrapper for [pandoc](https://pandoc.org/), its main
   4 purpose is to generate a similar PDF to the one generated with
   5 [Obsidian](https://obsidian.md/) by default.
   6 
   7 ## Example output
   8 
   9 ![pdf](https://user-images.githubusercontent.com/64109770/235328806-cb7bd0aa-0b7e-44d3-b162-aa50a482d3a7.gif)
  10 
  11 ## Usage
  12 
  13 ```sh
  14 $ md2pdf
  15 md2pdf [OPTIONS] <input>.md
  16 OPTIONS:
  17   -H, --style <file>.tex
  18   -l, --lua-filter <file>.lua
  19   -o, --output <file>
  20 ```
  21 
  22 ## Dependencies
  23 
  24 This is a [Pandoc](https://pandoc.org/) wrapper, so pandoc is the main
  25 dependency. For generating the PDF pandoc mainly uses latex packages, so having
  26 latex installed is required, in particular if you have Arch Linux the following
  27 latex packages are recommended for a general build without errors:
  28 
  29 ```console
  30 sudo pacman -S texlive-fontsextra texlive-fontsrecommended texlive-langother
  31 texlive-latexextra texlive-binextra texlive-plaingeneric texlive-formatsextra
  32 ```
  33 
  34 The included `style.tex` file uses external fonts, for the base text and
  35 sections titles the font [Inter](https://github.com/rsms/inter) is used (which
  36 is similar to [Helvetica](https://en.wikipedia.org/wiki/Helvetica)) and [Fira
  37 math](https://github.com/firamath/firamath) for the math fonts. Of course the
  38 fonts are optional since latex already includes base fonts.
  39 
  40 ## Installation
  41 
  42 If you want to install this script to your system, copy the executable to
  43 `$HOME/.local/bin` or to `/usr/bin` if you want to install it user-wide or
  44 system-wide respectively.
  45 
  46 - User wide:
  47 ```console
  48 $ cp ./md2pdf $HOME/.local/bin
  49 ```
  50 
  51 - System wide:
  52 ```console
  53 # cp ./md2pdf /usr/bin
  54 ```