use pandoc

1.introduce

Pandoc is a swiss-army knife for coverting files from one markup format into
another, it can convert documents in markdown to HTML or pdf. To see more, knock
this link

2. use

install missing packages on fedora:

su -c 'yum install texlive-titlesec'
su -c 'yum install texlive-titling'
su -c 'yum install texlive-lastpage'

generate pdf file:

pandoc test.md -o test.pdf

using latex to generate pdf file:

pandoc --latex-engine=xelatex  test.md -o test.pdf

generate pdf file by specify template:

pandoc --latex-engine=xelatex --template=/home/dennis/template.latex test.md -o test.pdf

3.reference