summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2016-11-08 11:48:35 +0100
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2016-11-08 11:48:35 +0100
commit398ec426859e4689597e2190233ba1609427702d (patch)
treeda3b8965c192d4aa2b240320d8da2b6071cb745e
parent8dc2d7767811f7d754328da0398e49718bd797de (diff)
parent120f8c09f460c55131eb8d99685732ee88f538ae (diff)
downloadorg-mode-398ec426859e4689597e2190233ba1609427702d.tar.gz
Merge branch 'maint'
-rw-r--r--lisp/org.el39
-rw-r--r--lisp/ox-latex.el9
2 files changed, 26 insertions, 22 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 4ce2498..9bf49f7 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -4085,7 +4085,7 @@ All available processes and theirs documents can be found in
:image-output-type "png"
:image-size-adjust (1.0 . 1.0)
:latex-compiler ("latex -interaction nonstopmode -output-directory %o %f")
- :image-converter ("dvipng -fg %F -bg %B -D %D -T tight -o %b.png %f"))
+ :image-converter ("dvipng -fg %F -bg %B -D %D -T tight -o %o%b.png %f"))
(dvisvgm
:programs ("latex" "dvisvgm" "gs")
:description "dvi > svg"
@@ -4095,7 +4095,7 @@ All available processes and theirs documents can be found in
:image-output-type "svg"
:image-size-adjust (1.7 . 1.5)
:latex-compiler ("latex -interaction nonstopmode -output-directory %o %f")
- :image-converter ("dvisvgm %f -n -b min -c %S -o %b.svg"))
+ :image-converter ("dvisvgm %f -n -b min -c %S -o %o%b.svg"))
(imagemagick
:programs ("latex" "convert" "gs")
:description "pdf > png"
@@ -4107,7 +4107,7 @@ All available processes and theirs documents can be found in
:image-size-adjust (1.0 . 1.0)
:latex-compiler ("pdflatex -interaction nonstopmode -output-directory %o %f")
:image-converter
- ("convert -density %D -trim -antialias %f -quality 100 %b.png")))
+ ("convert -density %D -trim -antialias %f -quality 100 %o%b.png")))
"Definitions of external processes for LaTeX previewing.
Org mode can use some external commands to generate TeX snippet's images for
previewing or inserting into HTML files, e.g., \"dvipng\". This variable tells
@@ -22756,28 +22756,27 @@ it for output.
`default-directory' is set to SOURCE directory during the whole
process."
- (let* ((source-name (file-name-nondirectory source))
- (base-name (file-name-sans-extension source-name))
+ (let* ((base-name (file-name-base source))
(full-name (file-truename source))
(out-dir (file-name-directory source))
(time (current-time))
(err-msg (if (stringp err-msg) (concat ". " err-msg) "")))
(save-window-excursion
- (let ((default-directory (file-name-directory full-name)))
- (pcase process
- ((pred functionp) (funcall process (shell-quote-argument source)))
- ((pred consp)
- (let ((log-buf (and log-buf (get-buffer-create log-buf)))
- (spec (append spec
- `((?b . ,(shell-quote-argument base-name))
- (?f . ,(shell-quote-argument source-name))
- (?F . ,(shell-quote-argument full-name))
- (?o . ,(shell-quote-argument out-dir))))))
- (dolist (command process)
- (shell-command (format-spec command spec) log-buf))))
- (_ (error "No valid command to process %S%s" source err-msg)))))
- ;; Check for process failure.
- (let ((output (concat out-dir base-name "." ext)))
+ (pcase process
+ ((pred functionp) (funcall process (shell-quote-argument source)))
+ ((pred consp)
+ (let ((log-buf (and log-buf (get-buffer-create log-buf)))
+ (spec (append spec
+ `((?b . ,(shell-quote-argument base-name))
+ (?f . ,(shell-quote-argument source))
+ (?F . ,(shell-quote-argument full-name))
+ (?o . ,(shell-quote-argument out-dir))))))
+ (dolist (command process)
+ (shell-command (format-spec command spec) log-buf))))
+ (_ (error "No valid command to process %S%s" source err-msg))))
+ ;; Check for process failure. Output file is expected to be
+ ;; located in the same directory as SOURCE.
+ (let ((output (expand-file-name (concat base-name "." ext) out-dir)))
(unless (org-file-newer-than-p output time)
(error (format "File %S wasn't produced%s" output err-msg)))
output)))
diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index b917355..879c64e 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -3611,10 +3611,15 @@ produced."
(when org-latex-remove-logfiles
(mapc #'delete-file
(directory-files
- (file-name-directory texfile) t
+ ;; Assume auxiliary files are created in current
+ ;; directory instead of ".tex" file directory, which
+ ;; may differ.
+ default-directory
+ nil
(concat (regexp-quote (file-name-base outfile))
"\\(?:\\.[0-9]+\\)?\\."
- (regexp-opt org-latex-logfiles-extensions)))))
+ (regexp-opt org-latex-logfiles-extensions))
+ t)))
(let ((warnings (org-latex--collect-warnings log-buf)))
(message (concat "PDF file produced"
(cond