First of all, I'm a beginner to emacs, who has just begun the tutorial and reading the manuals. Therefore kindly bear with me if the given details may be somewhat lacking.

  1. On win 10, I have installed the latest version of the complete Tex Live-environment (default path C:/texlive); I can create and preview *.tex-files with the included editor Texworks without issues. (if relevant: Ghostscript 9.56.1 is installed in C:/program files/gs)

  2. I would like to use Gnu-Emacs as LaTex-editor instead. Thanks to the manuals, I have managed to install the latest version 27.2 into C:/user/documents/emacs) and via ELPA the latest version of the required package auctex-package. Everything seems to have installed fine.

  3. I have loaded the included circ.tex. All attempts to create/ preview a pdf-file - I have really tried each and every of the command-options in the preview-menu - fail.

  4. I have made a screenshot, can it be added it here?

Error-message translated freely from German: 'The command "pdflatex" has either not been spelled correctly or cannot be found. Tex output ended as expected with Code 1 etc. LateX: LateX found no preview images.'

So i suspect that Emacs/ auctex probably cannot find pdflatex.exe by itself in c:/texlive. And if so, that I have to help them find it by somehow loading the required path(s) into one of the Emacs ini-files (.init.el and/ or .emacs)?

In case more information should be needed and if there is a way to post the screenshot, please let me know.

Thank you very kindly!

  • Use the command window to find out where texbin is and add it to your path. Then see this emacs.stackexchange.com/questions/37291/… how to add it in emacs. That page shows how to for linux/Mac, but you should write it for win 10.
    – Ian
    Commented Jul 23, 2022 at 8:03

2 Answers 2


I suggest you don't try to adjust the PATH in your Emacs init file and change it within your OS instead. There are plenty of guides on the net, I'm quoting from this site.

Windows 10

  1. In Search, search for and then select: System (Control Panel)
  2. Click the Advanced system settings link.
  3. Click Environment Variables. In the section System Variables find the PATH environment variable and select it. Click Edit. If the PATH environment variable does not exist, click New.
  4. In the Edit System Variable (or New System Variable) window, specify the value of the PATH environment variable. Click OK. Close all remaining windows by clicking OK.

Add C:/program files/gs and C:/texlive/2022/bin/win32 also to PATH so Emacs and AUCTeX can find the binaries.

I also suggest you add C:/user/documents/emacs/bin to PATH in case you want to start Emacs from a CLI.

Finally, you can define and/or set the variable HOME to a directory of your choice and put your init file there. This will make Emacs store it files (from ELPA for instance) under %HOME%/.emacs.d/elpa.


Thank you both very much, that worked like a charm! Arash: I just realized after another night of wild googling that I had already literally 'messed' with the Win-environment variables, but tragically overlooked to append the /win32 to C:/texlive/2022/bin So once again, the devil has proven to lurk in the details. ;-) Happy to have asked in the right forum, all have a pleasant day!

  • 1
    It sounds like the problem was pilot error (an oversight). If you don't think the question and answer are likely to help others then maybe delete the question. But of course keep it if you think it might help.
    – Drew
    Commented Jul 24, 2022 at 14:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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