Convert your markdown file to PDF
markdownをpdfに変換するスクリプトです
$ markdown2pdf.sh your-markdown-file --output output.pdf
The "--output" option is optional. For example,
$ markdown2pdf.sh README.md
will generate README.pdf from README.md.
The generated pdf is avaiable at https://github.com/yoshimoto/markdown2pdf/blob/main/README.pdf.
$ markdown2pdf.sh --help
usage:
$0 [OPTIONS] INPUT
-o, --output FILENAME
The filename for output pdf file
-g, --geometry GEOMETRY
Page geometry. Supported GEOMETRYs are "tight", "normal". (default: "tight")
--layout LAYOUT
Page layout. Supported LAYOUTs are
- "2x1" (two-up, side-by side)
- "normal"
default is "normal"
-2
Alias of --layout 2x1
--highlightstyle STYLE
Style of syntax highlight. Supported STYLEs are "tango", "haddock", "kate", etc.
See pandoc's manual for details.
--toc
Generate table of content
~/.markdown2pdf
# optioins for luatex
luatexjapresetoptions=hiragino-pron
# "tight", "normal"
geometry=tight
Add the following line in your ~/.markdown2pdf:
luatexjapresetoptions=hiragino-pron
Use --highlight-style STYLE option. Note that markdown2pdf.sh just passes the STYLE to pandoc with --highlight-style=“STYLE” internally. See pandoc’s manual for details.
markdown2pdf.sh is just wrapping the following command line utilities:
- pandoc
- lulatex
- pdfjam
If you have any issues, please make sure first that the above utilities are installed and configured correctly.