[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: “exec-path” alone or “PATH” alone is unable to call up SumatraPDF

From: Óscar Fuentes
Subject: Re: “exec-path” alone or “PATH” alone is unable to call up SumatraPDF
Date: Mon, 18 Dec 2017 16:11:06 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

"" <> writes:

> I construct a latex editing environment by "windows7 + Emacs25.3 +
> auctex + Miktex+SumatraPDF". The package auctex is installed by ELPA
> of Emacs. As I don't want the content of environment variable "Path"
> of my windows7 operating system changed, I put the following codes in
> "init.el":
> ;; Put the path of SumatraPDF.exe in the Emacs variable "exec-path":
> (setq exec-path (append '("E:/tex/SumatraPDF") exec-path))
> ;; Put the path of Miktex in the Emacs variable "PATH":
> (setenv "PATH" (concat "E:/tex/miktex/miktex/bin" ";" (getenv "PATH")))
> ;; define tex complier
> (setq-default TeX-engine 'xetex)
> (setq TeX-command-default "XeLaTeX")
> ;; define PDF viewer
> (setq TeX-PDF-mode t)
> (setq TeX-view-program-selection '((output-pdf "SumatraPDF")))
> After this, my tex documents can be complied successfully when
> clicking the button "Run LaTex" on the Emacs tool bar, but SumatraPDF
> does not work when clicking the button "Run Viewer".
> Then I move the the path of SumatraPDF.exe from "exec-path" to "PATH",
> SumatraPDF.exe does not work eigher. I have to put the path of
> SumatraPDF.exe both in "PATH" and in "exec-path". SumatraPDF.exe does
> work this time.
> So why is that "exec-path" alone or "PATH" alone is unable to call up 
> SumatraPDF?

Probably auctex uses `executable-find' for checking the existence of the
viewer (SumatraPDF in this case) before executing it. `executable-find'
uses `exec-path'.

You don't need PATH/exec-path for executing the pdf reader. Something
like this:

(setq TeX-output-view-style
          (cons (list "^pdf$" "." "\"c:/path/to/sumatraPDF.exe\" %o")

should do the trick.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]