Pandoc for Windows: pdflatex not found
Asked Answered
D

1

14

I receive the error: pdflatex not found when I try to convert a .tex or .md file to .pdf. I have downloaded MikTex and have the associated LaTex packages. These don't seem to include pdflatex, although I do see pdftex. Are these not interchangeable? Can anyone guide me in figuring this out? Thank you.

Delft answered 24/3, 2015 at 18:34 Comment(2)
I tried more directly the command: 'pdftex test.tex' but It spit out errors with \documentclass, \usepackage, and then did not build the PDF. It seems that it does not accept the standard LaTex formatting, which was built directly from Pandoc. How do I deal with this?\Delft
Did you install the packages from the installer and then run the setup utility? I didn't run setup and thought I had MikTex installed but it turns out there's another executable to install the packages that the installer program just downloads for you.Cristycriswell
S
26

I was getting the same error, this is how I solved it:

  1. Install MiKTeX
  2. Relogin/restart to reset the PATH for MiKTeX
  3. At the PowerShell command line type
    • pandoc "my file name.md" --pdf-engine=xelatex -o "my file name.pdf"
  4. MiKTeX now prompts you to to install several packages when you run this command at the first time, this may need several minutes.
  5. Your pdf should now be created including the Maths converted from the Latex notation.
  6. The command line output may include messages like:
    • miktex-dvipdfmx: major issue: So far, no MiKTeX administrator has checked for updates.
    • xelatex: major issue: So far, no MiKTeX administrator has checked for updates.
  7. The cause is if MiKTeX was installed for all users the the system wide MiKTeX update check is pending.
    • To get rid of the warning message, you have to switch to MiKTeX administrator mode and then check for MiKTeX updates.
    • Right click C:\ProgramData\Microsoft\Windows\Start Menu\Programs\MiKTeX 2.9\MiKTeX Console and Run as Administrator, On Overview page click Check for updates
Sheryllshetland answered 14/3, 2020 at 20:45 Comment(2)
Typora uses pandoc to export PDF on my computer, and I need to install nothing (e.g., MiKTeX).Elise
This was a long solution, but worked like a charm, for me I had to remove --pdf-engine=xelatex needed to use default engineHendecagon

© 2022 - 2024 — McMap. All rights reserved.