-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmd2pdf
More file actions
executable file
·38 lines (29 loc) · 940 Bytes
/
Copy pathmd2pdf
File metadata and controls
executable file
·38 lines (29 loc) · 940 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#! /bin/bash
if [ $# -lt 1 ]; then
echo "Convert markdown to pdf"
echo "Usage: $0 <markdown.md> [fontsize (default 14)]"
echo
echo "fontsize can be 8pt, 9pt, 10pt, 11pt, 12pt, 14pt, 17pt, 20pt"
exit
fi
FILE=$1
FONTSIZE="14pt"
if [ $# -gt 1 ]; then
FONTSIZE=`basename $2 pt`pt
echo $FONTSIZE
fi
#
# font sizes over 12pt are not supported by the standard latex article document class
# Instead, put the following line in pandoc.yaml
#
# documentclass: extarticle
#
# Possible sizes then are 8pt, 9pt, 10pt, 11pt, 12pt, 14pt, 17pt, 20pt
# According to https://stackoverflow.com/questions/23811002/from-markdown-to-pdf-how-to-change-the-font-size-with-pandoc
#
#
# English: lang=en
# Dutch: lang=nl
#
# alternative: geometry:margin=1cm
/usr/bin/pandoc --tab-stop=8 --metadata-file=${HOME}/scripts/pandoc.yaml -V lang=nl -V fontsize=${FONTSIZE} -V geometry:"left=2cm,top=1cm,bottom=1cm" -o `basename $FILE .md`.pdf $FILE