From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric S Fraga Subject: Re: Making an index in latex export --- surprisingly difficult Date: Thu, 28 Apr 2011 12:52:00 +0100 Message-ID: <87iptyegpr.fsf@ucl.ac.uk> References: <4DB73482.5010608@sift.info> <20110426142604.50d24b2d@bhishma.homelinux.net> <4DB73CA5.2010608@sift.info> <87d3k6g1xv.fsf@ucl.ac.uk> <4DB949C5.7020107@sift.info> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:37949) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QFPlP-0007BT-Q5 for emacs-orgmode@gnu.org; Thu, 28 Apr 2011 07:52:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QFPlO-0000Kr-JT for emacs-orgmode@gnu.org; Thu, 28 Apr 2011 07:52:07 -0400 Received: from vscane-b.ucl.ac.uk ([144.82.108.141]:47600) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QFPlO-0000Kk-8U for emacs-orgmode@gnu.org; Thu, 28 Apr 2011 07:52:06 -0400 In-Reply-To: <4DB949C5.7020107@sift.info> (Robert Goldman's message of "Thu, 28 Apr 2011 06:04:37 -0500") 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: rpgoldman@sift.info Cc: emacs-orgmode@gnu.org Robert Goldman writes: [...] >> 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: Okay, you are correct! I have sometimes used the following shell script in lieu of the sequence of commands: --8<---------------cut here---------------start------------->8--- #!/bin/sh -f # first argument should be base latex file name but may be absolute F=$1 B=$(basename $F) echo 'Original file: ' $F echo 'Base file: ' $B echo 'Invoked in dir: ' $PWD echo '--------------------------------- running pdflatex first ---------------------------------------------------' pdflatex $F echo '--------------------------------- running bibtex next -------------------------------------------------------' bibtex $B echo '--------------------------------- running pdflatex again (and again) ----------------------------------------' pdflatex $F pdflatex $F --8<---------------cut here---------------end--------------->8--- which is =/home/ucecesf/s/bin/org2pdf.sh= (for me). I then define #+begin_src emacs-lisp (setq org-latex-to-pdf-process '("/home/ucecesf/s/bin/org2pdf.sh %b")) #+end_src You could add a line of the form: makeindex -o ${B}.ind ${B}.idx to this script, probably before the bibtex line? Of course, this doesn't some any of the other problems, as you note below: [...] > 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.... Yes, the same applies to my simple script above: it assumes that the current directory *is* the one in which the files are. > 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. It does seem like a silly restriction. -- : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1 : using Org-mode version 7.5 (release_7.5.209.g1a687)