From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robert Goldman Subject: Re: Making an index in latex export --- surprisingly difficult Date: Thu, 28 Apr 2011 06:04:37 -0500 Message-ID: <4DB949C5.7020107@sift.info> References: <4DB73482.5010608@sift.info> <20110426142604.50d24b2d@bhishma.homelinux.net> <4DB73CA5.2010608@sift.info> <87d3k6g1xv.fsf@ucl.ac.uk> Reply-To: rpgoldman@sift.info Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([140.186.70.92]:39505) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QFP1W-0007O4-Sq for emacs-orgmode@gnu.org; Thu, 28 Apr 2011 07:04:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QFP1V-0001iQ-DX for emacs-orgmode@gnu.org; Thu, 28 Apr 2011 07:04:42 -0400 Received: from mpls.sift.info ([75.146.46.193]:36506) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QFP1V-0001iI-8E for emacs-orgmode@gnu.org; Thu, 28 Apr 2011 07:04:41 -0400 In-Reply-To: <87d3k6g1xv.fsf@ucl.ac.uk> 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org, e.fraga@ucl.ac.uk On 4/28/11 Apr 28 -4:28 AM, Eric S Fraga wrote: > Robert Goldman writes: > > [...] > >> I looked at that thread and unfortunately it petered out (partly because >> it went off into a different direction to solve an easier problem with >> conflicting style files). >> >> The last message from Eric Fraga states: >> >>> Oh well, there goes that theory. The web link you gave yesterday >>> would seem to indicate that the problem is present if you invoke the >>> bibtex command from another directory and this does not appear to be >>> the case here. Very strange. >> >> It's not actually invoking the bibtex command from another directory, >> AFAICT, but invoking the bibtex command on an argument that is an >> /absolute/ pathname. This is now forbidden for makeindex and bibtex (I >> don't know if it's permitted for pdflatex or not, but I suspect it is, >> since the pdflatex part of the export process is working --- pdflatex >> may not honor openout_any=p). > > If the file is indeed in the /current/ directory, then a simple fix may > be to use %b for the file argument to makeindex? I have no problems > with bibtex using > > ,---- > | org-latex-to-pdf-process is a variable defined in `org-latex.el'. > | Its value is ("pdflatex %f" "bibtex %b" "pdflatex %f" "pdflatex %f") > `---- > > Note the use of %b instead of %o or %f. I've never used makeindex so > cannot be sure this would work. > No, actually this does not work, since the expansion of %b is still an absolute pathname, rather than a relative pathname. The only difference is that the file extension is removed. Here's a snippet from my *trace-output* buffer when I trace the shell-command function: command="makeindex -o /Users/rpg/obtw/obtw-trunk/memos/plan-representation/manual.ind /Users/rpg/obtw/obtw-trunk/memos/plan-representation/manual.idx" The entry from my org-latex-to-pdf-process is: "makeindex -o %b.ind %b.idx" So using the basename is orthogonal to the underlying problem, which is that absolute pathnames are always used. When I restore the openout_any = p setting, I see: rpg% makeindex -o /Users/rpg/obtw/obtw-trunk/memos/plan-representation/manual.ind /Users/rpg/obtw/obtw-trunk/memos/plan-representation/manual.idx makeindex: Not writing to /Users/rpg/obtw/obtw-trunk/memos/plan-representation/manual.ind (openout_any = p). Can't create output index file /Users/rpg/obtw/obtw-trunk/memos/plan-representation/manual.ind. Note that this isn't something one needs any org-mode testing to verify --- you can just figure out what %b will expand to, and test interactively with the shell using makeindex or bibtex, if you have a recent texlive, with the paranoid settings. The only "solution" I know (aside from disabling the texmf.cnf security setting) would be to have org ensure that its CWD is the document directory when running these programs and use relative pathnames. I don't know that this solution is compatible with correct use of EXPORT_FILE_NAME, however.... This seems like a very crippling security setting -- it would break many plausible uses of the tex suite when they are run under program control (I could easily imagine scenarios with make that would result in the use of absolute pathnames, too); I'm surprised it was made. Best, r