diff options
author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2017-03-08 09:33:09 +0100 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2017-03-08 09:33:09 +0100 |
commit | 2eda74285e082ccdb4d9413ae66606fce49a1368 (patch) | |
tree | 881e62eb5e10edc690fde8112868431a1d223291 | |
parent | 64a5f9a59602f234febeb9ec2391e71e26d17fb4 (diff) | |
download | org-mode-2eda74285e082ccdb4d9413ae66606fce49a1368.tar.gz |
Fix LaTeX and Beamer publishing processes
* lisp/ox-beamer.el (org-beamer-publish-to-pdf):
* lisp/ox-latex.el (org-latex-publish-to-pdf): Set default directory
prior to compiling the generated tex file.
Reported-by: Robert Klein <roklein@roklein.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/112388>
-rw-r--r-- | lisp/ox-beamer.el | 10 | ||||
-rw-r--r-- | lisp/ox-latex.el | 10 |
2 files changed, 14 insertions, 6 deletions
diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el index 0cbe2c7..82651d3 100644 --- a/lisp/ox-beamer.el +++ b/lisp/ox-beamer.el @@ -1122,9 +1122,13 @@ Return output file name." ;; working directory and then moved to publishing directory. (org-publish-attachment plist - (org-latex-compile - (org-publish-org-to - 'beamer filename ".tex" plist (file-name-directory filename))) + ;; Default directory could be anywhere when this function is + ;; called. We ensure it is set to source file directory during + ;; compilation so as to not break links to external documents. + (let ((default-directory (file-name-directory filename))) + (org-latex-compile + (org-publish-org-to + 'beamer filename ".tex" plist (file-name-directory filename)))) pub-dir)) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index 92aa02f..99715c4 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -3692,9 +3692,13 @@ Return output file name." ;; in working directory and then moved to publishing directory. (org-publish-attachment plist - (org-latex-compile - (org-publish-org-to - 'latex filename ".tex" plist (file-name-directory filename))) + ;; Default directory could be anywhere when this function is + ;; called. We ensure it is set to source file directory during + ;; compilation so as to not break links to external documents. + (let ((default-directory (file-name-directory filename))) + (org-latex-compile + (org-publish-org-to + 'latex filename ".tex" plist (file-name-directory filename)))) pub-dir)) |