Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make sure pypandoc works with latex engines other than pdflatex #152

Open
starhh opened this issue Feb 22, 2018 · 4 comments
Open

make sure pypandoc works with latex engines other than pdflatex #152

starhh opened this issue Feb 22, 2018 · 4 comments
Labels
feature Request for Features

Comments

@starhh
Copy link

starhh commented Feb 22, 2018

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
output = pypandoc.convert(input, 'pdf', outputfile='demo.pdf')
File "C:\Users\star\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pypandoc_init_.py", line 69, in convert
outputfile=outputfile, filters=filters)
File "C:\Users\star\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pypandoc_init_.py", line 325, in _convert_input
'Pandoc died with exitcode "%s" during conversion: %s' % (p.returncode, stderr)
RuntimeError: Pandoc died with exitcode "47" during conversion: b'pdflatex not found. Please select a different --pdf-engine or install pdflatex\r\n'

@starhh
Copy link
Author

starhh commented Feb 22, 2018

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

@jankatins
Copy link
Contributor

@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)?

@jankatins jankatins changed the title Pandoc died with exitcode "47" make sure pypandoc works with latex engines other than pdflatex Apr 29, 2018
@GeoSpark
Copy link

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']

@jankatins jankatins added the feature Request for Features label Apr 13, 2020
@ylz-at
Copy link

ylz-at commented May 28, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Request for Features
Projects
None yet
Development

No branches or pull requests

4 participants