emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [new exporter] Windows / LaTeX export


From: Sebastien Vauban
Subject: Re: [O] [new exporter] Windows / LaTeX export
Date: Mon, 22 Oct 2012 22:29:46 +0200
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2.50 (windows-nt)

Hi Nicolas,

Nicolas Goaziou wrote:
> Achim Gratz <address@hidden> writes:
>
>> The new exporter fires off LaTeX with an absolute path for the file to
>> export. If you happen to use a native Emacs, but the LaTeX from Cygwin that
>> will fail because it expects a POSIX path. Would it be possible to change
>> things so that a relative path is used as in the old exporter
>
> It should be so in the latest commit. Does it fix the problem?

The same type of problem exists for `org-latex-to-pdf-process': contrarily to
what I'd thought from reading the doc, the argument %b is NOT (only) the base
name, but the full name without the file extension; hence, the problem under
Cygwin Emacs with /cygdrive/c type of paths which are sent (via LaTeXMK or
directly) to PDFLaTeX.

Hence, my current (ugly) workaround to support PDFLaTeX and XeTeX in both
Windows and Cygwin versions of Emacs:

--8<---------------cut here---------------start------------->8---
  ;; running a Cygwin version of Emacs
  (if (eq system-type 'cygwin)

      (progn
        ;; default (in Cygwin Emacs)
        (setq org-latex-to-pdf-process
              ;; use latexmk (if installed with LaTeX)
              (if (executable-find "latexmk")
                  '("latexmk -pdf $(cygpath -m %f) && rm -f %b.fdb_latexmk 
%b.fls %b.ilg %b.ind")
                '("pdflatex -interaction=nonstopmode -output-directory=%o 
$(cygpath -m %f)"
                  "pdflatex -interaction=nonstopmode -output-directory=%o 
$(cygpath -m %f)"
                  "pdflatex -interaction=nonstopmode -output-directory=%o 
$(cygpath -m %f)")))

        (when (string-match "^#\\+LATEX_CMD: xelatex" (buffer-string))
          (setq org-latex-to-pdf-process
                (if (executable-find "latexmk")
                    '("latexmk -pdf -pdflatex=xelatex $(cygpath -m %f) && rm -f 
%b.fdb_latexmk %b.fls %b.ilg %b.ind")
                  '("xelatex -interaction=nonstopmode -output-directory=%o 
$(cygpath -m %f)"
                    "xelatex -interaction=nonstopmode -output-directory=%o 
$(cygpath -m %f)"
                    "xelatex -interaction=nonstopmode -output-directory=%o 
$(cygpath -m %f)")))))

    ;; default (in Windows binary)
    (setq org-latex-to-pdf-process
          (if (executable-find "latexmk")
              '("latexmk -pdf %f && rm -f %b.fdb_latexmk %b.fls %b.ilg %b.ind")
            '("pdflatex -interaction=nonstopmode -output-directory=%o %f"
              "pdflatex -interaction=nonstopmode -output-directory=%o %f"
              "pdflatex -interaction=nonstopmode -output-directory=%o %f")))

    (when (string-match "^#\\+LATEX_CMD: xelatex" (buffer-string))
      (setq org-latex-to-pdf-process
            (if (executable-find "latexmk")
                '("latexmk -pdf -pdflatex=xelatex %f && rm -f %b.fdb_latexmk 
%b.fls %b.ilg %b.ind")
              '("xelatex -interaction=nonstopmode -output-directory=%o %f"
                "xelatex -interaction=nonstopmode -output-directory=%o %f"
                "xelatex -interaction=nonstopmode -output-directory=%o %f")))))
--8<---------------cut here---------------end--------------->8---

where I convert Cygwin paths to mixed Windows paths (mixed meaning: use
slashes instead of backslashes -- otherwise, the backslashes should be
escaped, which isn't the case).

Best regards,
  Seb

-- 
Sebastien Vauban




reply via email to

[Prev in Thread] Current Thread [Next in Thread]