Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting font in pandoc to generate pdf using MiKTeX

I am new to pandoc and using it to convert set of markdown files into pdf. I would like to change the default fonts for the pdf.

The documentation gives an example to set the fonts

pandoc -N --template=mytemplate.tex --variable mainfont=Georgia --variable 
sansfont=Arial --variable monofont="Bitstream Vera Sans Mono" --variable 
fontsize=12pt --variable version=1.10 README --latex-engine=xelatex --toc 
-o example14.pdf

however this uses xelatex and it is recommended to use MiKTeX.

I have tried the above with MiKTeX, but without any success.

Is there a way to set the font, I am using Windows 8 with MiKTeX

like image 787
resp78 Avatar asked Sep 02 '14 11:09

resp78


1 Answers

MiKTeX is a TeX distribution that includes the LaTeX macro package (including the pdflatex and xelatex engines). (Its support for the ConTeXt macro package is apparently not so good though.) If you need unicode support, pdflatex is not such a great choice, so you might want to use xelatex instead.

Use pandoc -D latex to look at the template, save that as myTemplate.tex, modify the file and use for example:

pandoc --template myTemplate.tex --latex-engine xelatex -o output.pdf input.md
like image 167
mb21 Avatar answered Sep 30 '22 04:09

mb21