From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: latex exporting to different directory with v9.0 Date: Sat, 05 Nov 2016 23:54:43 +0100 Message-ID: <874m3lo7v0.fsf@nicolasgoaziou.fr> References: <36258fcb-bc34-6517-2bc6-919722c3e72f@pressure.to> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48609) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c39rJ-0005Iz-Gk for emacs-orgmode@gnu.org; Sat, 05 Nov 2016 18:54:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c39rG-00017s-7J for emacs-orgmode@gnu.org; Sat, 05 Nov 2016 18:54:45 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:43191) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c39rG-00016A-0r for emacs-orgmode@gnu.org; Sat, 05 Nov 2016 18:54:42 -0400 In-Reply-To: <36258fcb-bc34-6517-2bc6-919722c3e72f@pressure.to> (Alex Fenton's message of "Sat, 5 Nov 2016 12:54:20 +0100") 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@gnu.org Sender: "Emacs-orgmode" To: Alex Fenton Cc: Joon Ro , emacs-orgmode@gnu.org Hello, Alex Fenton writes: > One thing that has unfortunately stopped working is my setup for > exporting to pdf, putting all the intermediary (.tex, .aux, .bbl, > etc) and output files in a different directory to the source .org > files. My setup is basically > > project/ > - images/ > - out/ > > with all the .org files in the project base directory. A simple > publishing set-up exported .tex to out/ then called org-latex-compile. > > With 9.0, org-latex-compile hands off to org-compile-file, in which > (as documented) "`default-directory' is set to SOURCE directory during > the whole > process." This means, however, that all the image and bibliograpy > links in the .org files are now broken, since they point to > ./img/foo.png and not ../img/foo.png Honestly, I'm surprised it worked. I'm also surprised it could be related to `default-directory' set-up, since links are created during Org -> LaTeX conversion, whereas `org-compile-file' handles LaTeX -> PDF. What is that "simple publishing set-up" you are talking about? Not that there is not something fishy in `org-compile-file' at the moment (see, e.g., ), but I cannot see a way out without breaking some eggs. Basically, there are three directories to consider: source (".tex") directory, output (".pdf") directory, and working directory, i.e., probably ".org" file directory. The assumption for `org-compile-file', and before it, `org-latex-compile', is that source and output directories are the same. Hence `org-compile-file' returns an error when (concat out-dir tex-file.pdf) cannot be found. Now, according to `org-latex-pdf-process', some values do not care much about the working directory, e.g., "pdflatex -interaction nonstopmode -output-directory %o %f" but others clearly require the working directory to be the output directory (note the absence of output directory in the command below) "texi2dvi -p -b -V %f" As a consequence, if we do not set `default-directory' to the output directory, the latter is broken. Note that if we do, "%o" place-holder becomes useless as it is always "./". In a nutshell we can either set default-directory to source/output directory or leave it as-is. In all cases, it seems to break something anyway. I'm Cc'ing Joon Ro since he reported a related issue with `org-compile-file'. Comments welcome. Regards, -- Nicolas Goaziou