emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Matthew Leifer <msleifer@gmail.com>
To: emacs-orgmode <emacs-orgmode@gnu.org>
Cc: Bruno Tavernier <tavernier.bruno@gmail.com>
Subject: Re: Re: [PATCH] Compiling multiple times the LaTeX output
Date: Wed, 6 Oct 2010 21:39:17 +0100	[thread overview]
Message-ID: <AANLkTinkq36YBdxa6MBqeqzy7NuJoe6rizE6vtNs99ik@mail.gmail.com> (raw)
In-Reply-To: <87mxqrek7p.fsf@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 4674 bytes --]

That is odd.  texi2dvi should default to using regular latex.  You usually
have to pass a -p option or use the alias texi2pdf in order to use pdflatex.
 It might be that you have a LATEX environment variable set.  In any case,
you can alter this behaviour by setting the LATEX environment variable, e.g.
setting the variable LATEX=xelatex will make texi2dvi use xelatex instead of
regular latex.

Finally, regarding .eps files, note that the latest version of pdflatex can
handle .eps graphics without having to go through the latex->dvips->ps2pdf
route so it might be worth your while upgrading.  Failing that, you can put
\usepackage{epstopdf} in your preamble and then older versions of pdflatex
will work just fine.

Best,

Matt Leifer

On 6 October 2010 10:36, Bruno Tavernier <tavernier.bruno@gmail.com> wrote:

> Just tried the texi2dvi command that is nice, one problem though, it
> only makes use of pdflatex.
>
> In certain situations, I like to use latex+ps2pdf (some journals ask for
> .eps image file) or xelatex when mixing several fonts and writing in
> UTF-8 is mandatory, for example French + Japanese, Chinese, Hindi, etc.
>
> Currently I used the function below that I hook to the org-export-latex
> process.
>
> AFAIK, providing one use few packages, a .tex file to be used with
> pdflatex can be similar to one to be used with xelatex. The content of
> the document (UTF-8 characters) will make the difference.
>
> To circumvent this problem, considering pdflatex as the default option,
> I add to the org file a:
> "#+LATEX_CMD: xelatex" or "#+LATEX_CMD: latex"
>
> Note: bibtex and glossaries compilation are detected by their call,
> e.g. \bibliography
>
> How about introducing a "#+LATEX_CMD:" option in org-mode? (and default
> to pdflatex)
>
> ,----
> | ; Perform a 2 or 3 xe/pdf/latex compilation
> | ; tex: tex + (glossaries) + (bibtex + tex) + tex
> |
> | (defun my-auto-tex-cmd ()
> |   "Automatically select the tex command to apply."
> |   (let ((texcmd) (bibtexcmd) (glossariescmd) (dvi2pdfcmd))
> |     ; default command
> |     (setq texcmd "pdflatex -interaction nonstopmode %f;")
> |     ; latex -> .dvi (for .eps images)
> |     (if (string-match "LATEX_CMD: latex" (buffer-string))
> |       (progn
> |         (setq texcmd "latex -interaction nonstopmode %f;")
> |         (setq dvi2pdfcmd "dvips %b.dvi; ps2pdf %b.ps"))
> |       ; xelatex -> .pdf
> |       (if (string-match "LATEX_CMD: xelatex" (buffer-string))
> |         (setq texcmd "xelatex -interaction nonstopmode %f;")))
> |     ; first tex compilation command
> |     (setq org-latex-to-pdf-process (list texcmd))
> |     ; look for glossaries call
> |     (if (string-match "\\\\makeglossaries" (buffer-string))
> |       (progn
> |         (setq glossariescmd "makeindex -s %b.ist -t %b.glg -o %b.gls
> %b.glo;")
> |         (setq org-latex-to-pdf-process
> |               (nconc org-latex-to-pdf-process (list glossariescmd)))))
> |     ; look for bibtex call
> |     (if (string-match "\\\\bibliography" (buffer-string))
> |       (progn
> |         (setq bibtexcmd (concat "bibtex %b; " texcmd))
> |         (setq org-latex-to-pdf-process
> |               (nconc org-latex-to-pdf-process (list bibtexcmd)))))
> |     ; last tex compilation command
> |     (setq org-latex-to-pdf-process
> |         (nconc org-latex-to-pdf-process (list texcmd)))
> |     ; dvi -> pdf
> |     (if dvi2pdfcmd
> |       (setq org-latex-to-pdf-process
> |             (nconc org-latex-to-pdf-process (list dvi2pdfcmd))))))
> |
> | (add-hook 'org-export-latex-after-initial-vars-hook 'my-auto-tex-cmd)
> `----
>
>
> That also allow for customisation of the export of packages, for instance:
>
> ,----
> | ; Default packages
> | (setq org-export-latex-packages-alist
> |       '(("" "graphicx" t)
> |       ("" "longtable" nil)
> |       ("" "amssymb" t)
> |       ("" "color" t)
> |       ("pdfborder=0" "hyperref" nil)
> |       ("" "float" nil)))
> |
> | ; Custom packages
> | (defun my-auto-tex-parameters ()
> |   "Automatically select the tex packages."
> |   ; Default pdflatex
> |   (setq org-export-latex-default-packages-alist
> |       '(("AUTO" "inputenc" t)))
> |   ; Look for xelatex call
> |   (if (string-match "LATEX_CMD: xelatex" (buffer-string))
> |       (setq org-export-latex-default-packages-alist
> |           '(("" "fontspec" t))))
> |
> | (add-hook 'org-export-latex-after-initial-vars-hook
> 'my-auto-tex-parameters)
> `----
>
>
> --
> Bruno
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>

[-- Attachment #1.2: Type: text/html, Size: 5917 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

  reply	other threads:[~2010-10-06 20:39 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-29 14:25 Compiling multiple times the LaTeX output Sébastien Vauban
2010-09-29 15:17 ` Noorul Islam K M
2010-09-30 13:27   ` [PATCH] " Sébastien Vauban
2010-09-30 15:39     ` Nick Dokos
2010-09-30 16:55       ` Sébastien Vauban
2010-10-01 15:32         ` Thomas S. Dye
2010-10-01 21:17           ` Sébastien Vauban
2010-10-04  7:41             ` Carsten Dominik
2010-10-04 10:36               ` Scot Becker
2010-10-05 12:46               ` Sébastien Vauban
2010-10-05 14:17                 ` Carsten Dominik
2010-10-05 14:30                 ` Matthew Leifer
2010-10-05 15:02                   ` Indraneel Majumdar
2010-10-05 16:26                   ` Carsten Dominik
2010-10-05 18:55                     ` Achim Gratz
2010-10-05 21:12                       ` Carsten Dominik
2010-10-06  8:21                     ` Sébastien Vauban
2010-10-05 18:24                   ` Achim Gratz
2010-10-01 16:12         ` Nick Dokos
2010-10-06  9:36           ` Bruno Tavernier
2010-10-06 20:39             ` Matthew Leifer [this message]
2010-10-07  2:09               ` Bruno Tavernier
2010-10-13  7:49               ` Olivier Schwander
2010-10-13 12:34                 ` Carsten Dominik
2010-10-06 21:54             ` 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=AANLkTinkq36YBdxa6MBqeqzy7NuJoe6rizE6vtNs99ik@mail.gmail.com \
    --to=msleifer@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=tavernier.bruno@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).