AUCTeX's built-in support for SumatraPDF was improved with the
release of version 11.90. So make sure you have the latest
version installed, which can be easily done from ELPA.
You need to touch three areas:
Win10's PATH environment variable
This step is optional: Adjust the
PATH environment variable and
add the directory containing
SumatraPDF.exe to it.
Emacs and AUCTeX
You have to adjust two AUCTeX variables:
TeX-view-program-selection. In short, in
TeX-view-program-list you define the available viewers and in
TeX-view-program-selection, you associate the defined viewers
to the document types. If you have
SumatraPDF in your
you can skip this step. Otherwise, you have to hardcode the path to
the executable in
TeX-view-program-list by putting something
like this in your
(mode-io-correlate " -forward-search \"%b\" %n")
Now you associate
SumatraPDF as viewer for generated
TeX-view-program-selection. Again, put this line in
(setq TeX-view-program-selection '((output-pdf "SumatraPDF")))
Finally, make sure you have this line in your
Now restart Emacs.
Configuring SumatraPDF is easy. You need to add this line to
SumatraPDF preferences for inverse search:
"C:\path\to\emacs\bin\emacsclientw.exe" -n +%l "%f"
If you don't see the field for inverse search, open the file
SumatraPDF-settings.txt, search for
set it to
true. Restart SumatraPDF and try again.
Compiling your .tex file
.tex file, hit C-c C-t C-s and check the
message in the Minibuffer. Make sure it says
Tex-Source-Correlate mode enabled. Now hit C-c C-c
to compile the file and C-c C-v to change to SumatraPDF.