mdtopdf is the pandoc docker image for converting markdown to PDF using TeX typesetting.
You can see example markdown file and converted PDF file from the link below👇
- Pull docker image.
$ docker pull plass/mdtopdf
- Generate PDF file.
$ docker run -it --rm -v `pwd`:/workdir plass/mdtopdf mdtopdf INPUT.md
$ docker run -it --rm -v `pwd`:/workdir plass/mdtopdf mdtopdf-2cols INPUT.md
$ docker run -it --rm -v `pwd`:/workdir plass/mdtopdf w-mdtopdf INPUT.md
$ docker run -it --rm -v `pwd`:/workdir plass/mdtopdf w-mdtopdf-2cols INPUT.md
You can decrease typing using alias
command as below,
$ echo "alias mdtopdf='docker run -it --rm -v `pwd`:/workdir plass/mdtopdf mdtopdf'" >> ~/.bash_profile
$ echo "alias mdtopdf-2cols='docker run -it --rm -v `pwd`:/workdir plass/mdtopdf mdtopdf-2cols'" >> ~/.bash_profile
$ echo "alias w-mdtopdf='docker run -it --rm -v `pwd`:/workdir plass/mdtopdf w-mdtopdf'" >> ~/.bash_profile
$ echo "alias w-mdtopdf-2cols='docker run -it --rm -v `pwd`:/workdir plass/mdtopdf w-mdtopdf-2cols'" >> ~/.bash_profile
$ source ~/.bash_profile
$ mdtopdf INPUT.md
$ mdtopdf-2cols INPUT.md
$ w-mdtopdf INPUT.md
$ w-mdtopdf-2cols INPUT.md
zsh : Modify .zshrc
instead of .bash_profile
.
Ubuntu : Modify .bashrc
instead of .bash_profile
.
$ docker run -it --rm -v `pwd`:/workdir plass/mdtopdf mdtotex INPUT.md
$ docker run -it --rm -v `pwd`:/workdir plass/mdtopdf mdtotex-2cols INPUT.md