From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: [PATCH] Make pdf command and args customizable. [was: Feature request: an org user variable for which "latex" command to run] Date: Wed, 22 Apr 2009 12:47:49 -0400 Message-ID: <8198.1240418869@alphaville.usa.hp.com> References: Reply-To: nicholas.dokos@hp.com Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LwfdO-0004rB-BA for emacs-orgmode@gnu.org; Wed, 22 Apr 2009 12:49:18 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LwfdI-0004qp-LZ for emacs-orgmode@gnu.org; Wed, 22 Apr 2009 12:49:16 -0400 Received: from [199.232.76.173] (port=53916 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LwfdI-0004qm-Gg for emacs-orgmode@gnu.org; Wed, 22 Apr 2009 12:49:12 -0400 Received: from g1t0026.austin.hp.com ([15.216.28.33]:18344) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LwfdI-0005pZ-3O for emacs-orgmode@gnu.org; Wed, 22 Apr 2009 12:49:12 -0400 In-Reply-To: Message from Scot Becker of "Wed, 22 Apr 2009 15:47:59 BST." List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Scot Becker Cc: Org-mode ml Here's a patch to make the command and its arguments customizable. The patch organizes the customization groups as follows: org-export -> org-export-latex -> org-export-pdf I don't know if Carsten will want to apply it, but even if he does, he might want to tweak the customization groups differently. Nick Add variables for the pdf command and its args and create appropriate customization tree structure. --- lisp/org-latex.el | 25 +++++++++++++++++++------ 1 files changed, 19 insertions(+), 6 deletions(-) diff --git a/lisp/org-latex.el b/lisp/org-latex.el index 9371b24..c56690d 100644 --- a/lisp/org-latex.el +++ b/lisp/org-latex.el @@ -292,16 +292,25 @@ only postscript files can be included." (defgroup org-export-pdf nil "Options for exporting Org-mode files to PDF, via LaTeX." - :tag "Org Export LaTeX" - :group 'org-export-latex - :group 'org-export) + :tag "Org Export PDF" + :group 'org-export-latex) (defcustom org-export-pdf-remove-logfiles t "Non-nil means, remove the logfiles produced by PDF production. These are the .aux, .log, .out, and .toc files." - :group 'org-export-latex + :group 'org-export-pdf :type 'boolean) +(defcustom org-export-pdf-command "pdflatex" + "Command to produce PDF." + :group 'org-export-pdf + :type 'string) + +(defcustom org-export-pdf-command-args "-interaction nonstopmode" + "Command args for org-export-pdf-command." + :group 'org-export-pdf + :type 'string) + ;;; Autoload functions: ;;;###autoload @@ -550,9 +559,13 @@ when PUB-DIR is set, use this as the publishing directory." (pdffile (concat base ".pdf"))) (and (file-exists-p pdffile) (delete-file pdffile)) (message "Processing LaTeX file...") - (shell-command (format "pdflatex -interaction nonstopmode %s" + (shell-command (format "%s %s %s" + org-export-pdf-command + org-export-pdf-command-args (shell-quote-argument file))) - (shell-command (format "pdflatex -interaction nonstopmode %s" + (shell-command (format "%s %s %s" + org-export-pdf-command + org-export-pdf-command-args (shell-quote-argument file))) (message "Processing LaTeX file...done") (if (not (file-exists-p pdffile)) -- 1.5.4.3