diff --git a/tex-buf.el b/tex-buf.el --- a/tex-buf.el +++ b/tex-buf.el @@ -798,9 +798,9 @@ name 'TeX-command-next (if (and TeX-PDF-via-dvips-ps2pdf TeX-PDF-mode) - "Dvips" + TeX-PDF-via-dvips-ps2pdf TeX-command-Show))) - (list "Dvips" TeX-command-Show)) + (list TeX-PDF-via-dvips-ps2pdf TeX-command-Show)) (cdr (assoc (expand-file-name (concat name ".idx")) LaTeX-idx-changed-alist))) "Index") @@ -988,6 +988,7 @@ (setq TeX-sentinel-function (lambda (_process name) (message (concat name ": done.")))) + (TeX-run-set-command name command) (if TeX-process-asynchronous (let ((process (start-process name buffer TeX-shell TeX-shell-command-option command))) @@ -1020,7 +1021,6 @@ (defun TeX-run-format (name command file) "Create a process for NAME using COMMAND to format FILE with TeX." - (TeX-run-set-command name command) (let ((buffer (TeX-process-buffer-name file)) (process (TeX-run-command name command file))) ;; Hook to TeX debuger. @@ -1212,7 +1212,6 @@ Run command in a buffer (in comint-shell-mode) so that it accepts user interaction. If you return to the file buffer after the TeX run, Error parsing on \\[next-error] should work with a bit of luck." - (TeX-run-set-command name command) (require 'comint) (let ((default TeX-command-default) (buffer (TeX-process-buffer-name file)) @@ -1363,7 +1362,7 @@ (message (concat name ": formatted " (TeX-current-pages))) (if (with-current-buffer TeX-command-buffer (and TeX-PDF-via-dvips-ps2pdf TeX-PDF-mode)) - (setq TeX-command-next "Dvips") + (setq TeX-command-next TeX-PDF-via-dvips-ps2pdf) (setq TeX-command-next TeX-command-Show)))) (defun TeX-current-pages () @@ -1423,7 +1422,7 @@ t) (if (with-current-buffer TeX-command-buffer (and TeX-PDF-via-dvips-ps2pdf TeX-PDF-mode)) - (setq TeX-command-next "Dvips") + (setq TeX-command-next TeX-PDF-via-dvips-ps2pdf) (setq TeX-command-next TeX-command-Show)) nil)) @@ -1516,7 +1515,7 @@ (TeX-current-pages)) (if (with-current-buffer TeX-command-buffer (and TeX-PDF-via-dvips-ps2pdf TeX-PDF-mode)) - (setq TeX-command-next "Dvips") + (setq TeX-command-next TeX-PDF-via-dvips-ps2pdf) (setq TeX-command-next TeX-command-Show))) ((re-search-forward "^\\(?:LaTeX Warning: Citation\\|\ Package natbib Warning:.*undefined citations\\)" nil t) @@ -1524,7 +1523,7 @@ (TeX-current-pages)) (if (with-current-buffer TeX-command-buffer (and TeX-PDF-via-dvips-ps2pdf TeX-PDF-mode)) - (setq TeX-command-next "Dvips") + (setq TeX-command-next TeX-PDF-via-dvips-ps2pdf) (setq TeX-command-next TeX-command-Show))) ((re-search-forward "Package longtable Warning: Table widths have \ changed\\. Rerun LaTeX\\." nil t) @@ -1553,7 +1552,7 @@ (TeX-current-pages) add-info))) (if (with-current-buffer TeX-command-buffer (and TeX-PDF-via-dvips-ps2pdf TeX-PDF-mode)) - (setq TeX-command-next "Dvips") + (setq TeX-command-next TeX-PDF-via-dvips-ps2pdf) (setq TeX-command-next TeX-command-Show))) (t (message "%s%s%s" name ": problems after " (TeX-current-pages)) diff --git a/tex.el b/tex.el --- a/tex.el +++ b/tex.el @@ -153,6 +153,8 @@ :help "Convert DVI file to PostScript") ("Ps2pdf" "ps2pdf %f" TeX-run-ps2pdf nil t :help "Convert PostScript file to PDF") + ("Dvipdfmx" "dvipdfmx %d " TeX-run-command nil t + :help "Convert DVI file to PDF") ("Index" "makeindex %s" TeX-run-index nil t :help "Run makeindex to create index file") ("Xindy" "texindy %s" TeX-run-command nil t @@ -268,6 +270,7 @@ '( ; Add the following line if you want to use htlatex (tex4ht) ; ("\\`htlatex" ("html")) + ("\\`dvipdfmx" "pdf") ) "List of regexps and file extensions.