pypandoc
pypandoc copied to clipboard
make sure pypandoc works with latex engines other than pdflatex
Hi, I am following the documentation to convert md file to pdf using below code, I am using python 3.6 on windows. I encounter below error to select a different --pdf-engine or install pdflatex\r\n'.
I do not want to install other dependency, Please assist. Thanks
output = pypandoc.convert(input, 'pdf', outputfile='paper.pdf', extra_args=['-V geometry:margin=1.5cm'])
Traceback (most recent call last):
File "C:/Users/star/Desktop/pdf_report/pypan.py", line 16, in
Also I tried with paramter --pdf-engine=xelatex'
output = pypandoc.convert(input, 'pdf', outputfile='paper.pdf', extra_args=['-V geometry:margin=1.5cm', '--pdf-engine=xelatex'])
https://pandoc.org/MANUAL.html#creating-a-pdf
@starhh Does it work with extra_args=['-V geometry:margin=1.5cm', '--pdf-engine=xelatex']
or extra_args=['-V geometry:margin=1.5cm', '--pdf-engine=/usr/bin/xelatex']
(or wherever your xelatex is installed)?
You need to separate the parameters, so:
extra_args=['-V geometry:margin=1.5cm', '--pdf-engine=/usr/bin/xelatex']
becomes:
extra_args=['-V', 'geometry:margin=1.5cm', '--pdf-engine', '/usr/bin/xelatex']
I am using downlaod_pandoc(), but there is no method provided to download pdf-engine.
Pandoc died with exitcode "41" during conversion: pandoc: pdflatex not found. pdflatex is needed for pdf output.