branch: externals-release/org
commit bbcf95331838cf644416a951267922165ae41ae3
Author: Ihor Radchenko <[email protected]>
Commit: Ihor Radchenko <[email protected]>

    Account that latexmk requires perl to work
    
    * lisp/ob-latex.el (org-babel-latex-process-alist):
    * lisp/ox-latex.el (org-latex-pdf-process): Use latexmk when both
    latexmk and perl are available.  Apparently, latexmk on Windows may
    fail without manually installing perl.
    
    Link: 
https://www.reddit.com/r/orgmode/comments/1rben39/emacs_org_mode_export_to_pdf_fails_on_windows/
---
 lisp/ob-latex.el | 2 +-
 lisp/ox-latex.el | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/ob-latex.el b/lisp/ob-latex.el
index 7fcb76cd09..fc325f2594 100644
--- a/lisp/ob-latex.el
+++ b/lisp/ob-latex.el
@@ -133,7 +133,7 @@ exporting the literal LaTeX source."
         "you need to install the programs: latex and dvipng."
         :image-input-type "dvi" :image-output-type "png"
         :image-size-adjust (1.0 . 1.0) :latex-compiler
-         ,(if (executable-find "latexmk")
+         ,(if (and (executable-find "latexmk") (executable-find "perl"))
               '("latexmk -f -pdf -latex -interaction=nonstopmode 
-output-directory=%o %f")
             '("latex -interaction nonstopmode -output-directory %o %f"
               "latex -interaction nonstopmode -output-directory %o %f"
diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index d134b164f5..b4d1ada8d5 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -1455,7 +1455,7 @@ A better approach is to use a compiler suit such as 
`latexmk'."
   :package-version '(Org . "9.0"))
 
 (defcustom org-latex-pdf-process
-  (if (executable-find "latexmk")
+  (if (and (executable-find "latexmk") (executable-find "perl"))
       '("latexmk -f -pdf -%latex -interaction=nonstopmode -output-directory=%o 
%f")
     '("%latex -interaction nonstopmode -output-directory %o %f"
       "%latex -interaction nonstopmode -output-directory %o %f"

Reply via email to