emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Sebastien Vauban" <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org>
To: emacs-orgmode-mXXj517/zsQ@public.gmane.org
Subject: Re: [new exporter] Windows / LaTeX export
Date: Mon, 22 Oct 2012 22:29:46 +0200	[thread overview]
Message-ID: <804nlm6yit.fsf@somewhere.org> (raw)
In-Reply-To: 87d30a5o21.fsf@gmail.com

Hi Nicolas,

Nicolas Goaziou wrote:
> Achim Gratz <Stromeko-i47jiTeKxPI@public.gmane.org> 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

  parent reply	other threads:[~2012-10-22 20:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-22 17:40 [new exporter] Windows / LaTeX export Achim Gratz
2012-10-22 19:01 ` Nicolas Goaziou
2012-10-22 19:13   ` Achim Gratz
2012-10-22 20:29   ` Sebastien Vauban [this message]
2012-10-25 13:17     ` Nicolas Goaziou
2012-10-23 15:36   ` Achim Gratz
2012-10-25 13:19     ` Nicolas Goaziou
2012-10-25 13:52       ` Achim Gratz

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=804nlm6yit.fsf@somewhere.org \
    --to=wxhgmqzgwmuf-genee64ty+gs+fvcfc7uqw@public.gmane.org \
    --cc=emacs-orgmode-mXXj517/zsQ@public.gmane.org \
    /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).