emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Making an index in latex export --- surprisingly difficult


From: Robert Goldman
Subject: Re: [O] Making an index in latex export --- surprisingly difficult
Date: Thu, 28 Apr 2011 06:04:37 -0500
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9

On 4/28/11 Apr 28 -4:28 AM, Eric S Fraga wrote:
> Robert Goldman <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]