Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pandoc for Windows: pdflatex not found

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.

like image 782
tennis Avatar asked Mar 24 '15 18:03

tennis


People also ask

What is the Pdflatex command?

The pdftex command uses the equivalent of the plain TeX format, and the pdflatex command uses the equivalent of the LaTeX format. To generate formats, use the -ini switch. The pdfinitex and pdfvirtex commands are pdfTeX's analogues to the initex and virtex commands.

Does Pandoc need LaTeX?

By default, pandoc will use LaTeX to create the PDF, which requires that a LaTeX engine be installed (see --pdf-engine below). Alternatively, pandoc can use ConTeXt, roff ms, or HTML as an intermediate format.


Video Answer


1 Answers

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
like image 146
boardtc Avatar answered Dec 16 '22 13:12

boardtc