From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Sebastien Vauban" Subject: Re: [new exporter] Windows / LaTeX export Date: Mon, 22 Oct 2012 22:29:46 +0200 Message-ID: <804nlm6yit.fsf@somewhere.org> References: <87ehkqbe32.fsf@Rainer.invalid> <87d30a5o21.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Hi Nicolas, Nicolas Goaziou wrote: > Achim Gratz 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