emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Feature request: an org user variable for which "latex" command to run
@ 2009-04-22 14:47 Scot Becker
  2009-04-22 16:47 ` [PATCH] Make pdf command and args customizable. [was: Feature request: an org user variable for which "latex" command to run] Nick Dokos
  2009-04-23  4:48 ` Feature request: an org user variable for which "latex" command to run Carsten Dominik
  0 siblings, 2 replies; 4+ messages in thread
From: Scot Becker @ 2009-04-22 14:47 UTC (permalink / raw)
  To: Org-mode ml

All,

org-latex.el currently runs the passes this to the shell when running
the `C-c C-e p' or `C-c C-e d' (process via LaTeX to PDF) commands:

"pdflatex -interaction nonstopmode %s"

But a person (like this person) might want to use a different shell
command to invoke latex, in particular LuaTeX, or XeTeX, two
unicode-aware successors to pdflatex which also output pdf files.

I use xelatex for it's unicode compatibility and font handling, and
I'd love to be able to use the speedy C-c C-e d command to get myself
from .org file to visible PDF---like all the other kids on my street.

I note that emacs already has a variable 'latex-run-command' used by
latex-mode for invoking latex with C-c C-b.  You will know better than
I the relative advantages and disadvantages to reusing it.  However
(1) it is still set to 'latex' out of the box, and so could require
user changes on some systems to get it to process to a PDF and not to
a DVI (though not on TeXLive 2008, where latex -> pdflatex). (2) It
seems a refined (i.e. complex) system:  latex-mode uses
'latex-run-command' as its 'tex-command' to process the contents of a
buffer.  What it passes to the shell is the value of
'latex-run-command' + 'tex-start-options' + 'tex-start-commands' and
finally the filename (though it can be inserted elsewhere with a '*',
not org's typical '%s'), at least that's as far as I understand it.

Perhaps we don't need to be so clever.  Maybe just an
'org-latex-to-pdf-command' variable,  with the default as above?

Thanks,
Scot

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] Make pdf command and args customizable. [was: Feature request: an org user variable for which "latex" command to run]
  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
  2009-04-23  4:48 ` Feature request: an org user variable for which "latex" command to run Carsten Dominik
  1 sibling, 0 replies; 4+ messages in thread
From: Nick Dokos @ 2009-04-22 16:47 UTC (permalink / raw)
  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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: Feature request: an org user variable for which "latex" command to run
  2009-04-22 14:47 Feature request: an org user variable for which "latex" command to run Scot Becker
  2009-04-22 16:47 ` [PATCH] Make pdf command and args customizable. [was: Feature request: an org user variable for which "latex" command to run] Nick Dokos
@ 2009-04-23  4:48 ` Carsten Dominik
  2009-04-23  8:18   ` Scot Becker
  1 sibling, 1 reply; 4+ messages in thread
From: Carsten Dominik @ 2009-04-23  4:48 UTC (permalink / raw)
  To: Scot Becker; +Cc: David Moffat, Org-mode ml

This is now implemented, please check the variable
`org-latex-to-pdf-process'.

Nick, I used a a modified version of your patch, to make the whole
process configurable, and to make it possible to include a BibTeX run.

Thanks to all who have contributed to this discussion.

- Carsten

On Apr 22, 2009, at 4:47 PM, Scot Becker wrote:

> All,
>
> org-latex.el currently runs the passes this to the shell when running
> the `C-c C-e p' or `C-c C-e d' (process via LaTeX to PDF) commands:
>
> "pdflatex -interaction nonstopmode %s"
>
> But a person (like this person) might want to use a different shell
> command to invoke latex, in particular LuaTeX, or XeTeX, two
> unicode-aware successors to pdflatex which also output pdf files.
>
> I use xelatex for it's unicode compatibility and font handling, and
> I'd love to be able to use the speedy C-c C-e d command to get myself
> from .org file to visible PDF---like all the other kids on my street.
>
> I note that emacs already has a variable 'latex-run-command' used by
> latex-mode for invoking latex with C-c C-b.  You will know better than
> I the relative advantages and disadvantages to reusing it.  However
> (1) it is still set to 'latex' out of the box, and so could require
> user changes on some systems to get it to process to a PDF and not to
> a DVI (though not on TeXLive 2008, where latex -> pdflatex). (2) It
> seems a refined (i.e. complex) system:  latex-mode uses
> 'latex-run-command' as its 'tex-command' to process the contents of a
> buffer.  What it passes to the shell is the value of
> 'latex-run-command' + 'tex-start-options' + 'tex-start-commands' and
> finally the filename (though it can be inserted elsewhere with a '*',
> not org's typical '%s'), at least that's as far as I understand it.
>
> Perhaps we don't need to be so clever.  Maybe just an
> 'org-latex-to-pdf-command' variable,  with the default as above?
>
> Thanks,
> Scot
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Feature request: an org user variable for which "latex" command to run
  2009-04-23  4:48 ` Feature request: an org user variable for which "latex" command to run Carsten Dominik
@ 2009-04-23  8:18   ` Scot Becker
  0 siblings, 0 replies; 4+ messages in thread
From: Scot Becker @ 2009-04-23  8:18 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: David Moffat, Org-mode ml

> and to make it possible to include a BibTeX run.

Thanks for that, too.  I forgot that I'd need that too, to be able to
use C-c C-e, and process all the way to a PDF viewer.

Scot

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-04-23  8:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-22 14:47 Feature request: an org user variable for which "latex" command to run Scot Becker
2009-04-22 16:47 ` [PATCH] Make pdf command and args customizable. [was: Feature request: an org user variable for which "latex" command to run] Nick Dokos
2009-04-23  4:48 ` Feature request: an org user variable for which "latex" command to run Carsten Dominik
2009-04-23  8:18   ` Scot Becker

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).