1. Install pandoc
Download and install from pandoc. After the installation, you will get pandoc, an executable file.
2. Install Tex(On Mac OS)
Download and install from mactex.
3. Add Tex bins to Env
Open ~/.bash_profile add following line at the bottom.
export PATH=$PATH:/Library/TeX/texbin
Then execute .bash_profile.
$ source ~/.bash_profile
4. Generate pdf from md
$ pandoc name.md -o name.pdf
Then we are done! open your name.pdf file now.
5. Convert other file types
See the demos of pandoc