emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: Scot Becker <scot.becker@gmail.com>
Cc: Org-mode ml <emacs-orgmode@gnu.org>
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	[thread overview]
Message-ID: <8198.1240418869@alphaville.usa.hp.com> (raw)
In-Reply-To: Message from Scot Becker <scot.becker@gmail.com> of "Wed, 22 Apr 2009 15:47:59 BST." <e0e1fe620904220747j64a717c0nb644d52551cc3399@mail.gmail.com>

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

  reply	other threads:[~2009-04-22 16:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-22 14:47 Feature request: an org user variable for which "latex" command to run Scot Becker
2009-04-22 16:47 ` Nick Dokos [this message]
2009-04-23  4:48 ` Carsten Dominik
2009-04-23  8:18   ` Scot Becker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8198.1240418869@alphaville.usa.hp.com \
    --to=nicholas.dokos@hp.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=scot.becker@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).