came across on windows 10 the following error message

Running `LaTeX' on `test_latex' with ``pdflatex  -file-line-error   -interaction=nonstopmode "test_latex.tex"''
**'pdflatex' is not recognized as an internal or external command,
operable program or batch file.**

however, i do add the executable to the exec-path in init.el , as below:

(when (system-is-windows)
  (setq exec-path '(
            "C:/Users/user/AppData/Local/Programs/MiKTeX 2.9/miktex/bin/x64")

and the path "C:/Users/user/AppData/Local/Programs/MiKTeX 2.9/miktex/bin/x64" is also added to environment PATH variable.

Any help/hint is much appreciated!

  • the value of (executable-find "latex") should be a valid file. If not you should consider checking your MikTeX installation. – gigiair Feb 12 at 19:48
  • Your exec path is wrong, it must end with ;%PATH%. Probably it is no need of that, but I am not a MiKTeX user. – gigiair Feb 12 at 19:57
  • Thank you @gigiair. – YiC Feb 13 at 16:32

I figured it out - it turned out that there is (setenv "PATH" "C:/Users/user/") at the beginning of the .init file. commented out this line and works fine now. It basically overwrote the windows environment PATH variable. (It also broke my Spyder launch).

I forgot why I added that line in the first place. but adding the path "C:/Users/user/AppData/Local/Programs/MiKTeX 2.9/miktex/bin/x64" to the windows environment PATH variable is one way to let Emacs know where to find tex related .exe

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.