Hi, all
When I try to preview on windows, the Ghostscript executable bundled with MiKTeX cannot be located since the path of MiKTeX contains a space. Thus when I open a tex buffer there will be an echoed message telling me ''c:/Program" is not a valid command.
I fixed this issue by making the following change:
(defcustom preview-gs-command
(or ;; The GS wrapper coming with TeX Live
(executable-find "rungs")
(let ((gs (executable-find "mgs")))
;; Check if mgs is functional for external non-MikTeX apps.
(when (and gs (= 0 (shell-command (concat (shell-quote-argument gs) " -q -dNODISPLAY -c quit"))))
(executable-find "GSWIN32C.EXE")
"*How to call gs for conversion from EPS. See also `preview-gs-options'."
I wrap the 'gs' variable with a 'shell-quote-argument' and voila! I hope this would be helpful for those who had the same issue.
Best regards,
James