A small script to convert markdown to pdf using pandoc with custom settings
sudo pacman -S pandoc ttf-dejavu texlive-coresudo apt install pandoc fonts-dejavu texlive-xetexYou can probably figure it out yourself, based on the two commands above
- Download the md2pdf file:
wget https://raw.githubusercontent.com/RubixDev/md2pdf/main/md2pdf.sh - Replace 'YOUR NAME HERE' at the top with your actual name. This will appear in the header of the exported PDFs:
sed -i 's/YOUR NAME HERE/<name>/g' md2pdf.sh - Rename it to
md2pdfwithout.sh:
mv md2pdf.sh md2pdf - Make the file executable:
chmod +x md2pdf - Move the file to
/usr/local/bin
sudo mv md2pdf /usr/local/bin/
Alternatively, you can also use the automatic install script, which asks for your name (which will appear in the header of the PDFs) and places the file in /usr/local/bin, which should be in your PATH.
wget https://raw.githubusercontent.com/RubixDev/md2pdf/main/install.sh
bash install.sh
rm install.shbash -c "$(curl -fsSL https://raw.githubusercontent.com/RubixDev/md2pdf/main/install.sh)"or
bash -c "$(wget -O- https://raw.githubusercontent.com/RubixDev/md2pdf/main/install.sh)"md2pdf <input file> <output file> \
-l|--left-head [header left text] \
-c|--center-head [header center text] \
-r|--right-head [header right text] \
-n|--name-location [left|center|right] \
--preserve-tex-l,-c,-rand their long counterparts control the text to appear in the head of each page-nor--name-locationfollowed by one ofleft,centerorrightcontrols where to place the name in the head- By default it will be placed left
- The name can be overwritten by the previously mentioned flags
- If anything else is provided, the name will not be displayed
- The
--preserve-texoption keeps the generated.texfile
md2pdf README.md README.pdfmd2pdf README.md README.pdf -l " "md2pdf README.md README.pdf -l 29.08.2021 -n rightmd2pdf README.md README.pdf \
--center-head "Text with spaces" \
--right-head 29.08.2021 \
--name-location left


