Mdtopdf
๐ณ Pandoc docker image for converting markdown to PDF using TeX typesetting
Install / Use
/learn @p1ass/MdtopdfREADME
mdtopdf ๐ณ
mdtopdf is the pandoc docker image for converting markdown to PDF using TeX typesetting.
Examples
You can see example markdown file and converted PDF file from the link below๐

Getting Started
- Pull docker image.
$ docker pull plass/mdtopdf
โ ๏ธ This docker image size is 1.68GB. I recommend pulling it using the fast Internet connection.
- Generate PDF file.
$ docker run -it --rm -v "`pwd`":/workdir plass/mdtopdf mdtopdf INPUT.md
Windows (PowerShell) : Replace `pwd` to ${pwd}
fish shell : Replace `pwd` to (pwd)
Advanced Usages
Generate PDF file on save
$ docker run -it --rm -v "`pwd`":/workdir plass/mdtopdf w-mdtopdf INPUT.md
Set alias
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 w-mdtopdf='docker run -it --rm -v "`pwd`":/workdir plass/mdtopdf w-mdtopdf'" >> ~/.bash_profile
$ source ~/.bash_profile
$ mdtopdf INPUT.md
$ w-mdtopdf INPUT.md
zsh : Modify .zshrc instead of .bash_profile.
Ubuntu : Modify .bashrc instead of .bash_profile.
If you're using Docker for Windows, setting alias is a bit tricky. Use following command.
> echo 'Function mdtopdf {Param($file) docker run -it --rm -v ${pwd}:/workdir plass/mdtopdf mdtopdf $(Get-ChildItem $file -Name)}' >> $PROFILE
> echo 'Function mdtopdf {Param($file) docker run -it --rm -v ${pwd}:/workdir plass/mdtopdf w-mdtopdf $(Get-ChildItem $file -Name)}' >> $PROFILE
> . $PROFILE
> mdtopdf INPUT.md
> w-mdtopdf INPUT.md
Generate tex file from markdown
$ docker run -it --rm -v "`pwd`":/workdir plass/mdtopdf mdtotex INPUT.md
Generate html file from markdown
$ docker run -it --rm -v "`pwd`":/workdir plass/mdtopdf mdtohtml INPUT.md
Generate docx file from markdown
$ docker run -it --rm -v "`pwd`":/workdir plass/mdtopdf mdtodocx INPUT.md
