Pandoc can be used to generate PDFs cleanly from markdown (with embedded LaTeX)
pandoc -o nameOfOutputFile.pdf nameOfInputFile.md
- pandoc. This is available pre-built in most operating system's repositories.
- LaTeX, TeX Live specifically. Again available pre-built in most operating system's repositories.
On Debian (Ubuntu etc.):
sudo apt-get update
sudo apt-get install texlive
sudo apt-get install pandoc