emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric S Fraga <e.fraga@ucl.ac.uk>
To: rpgoldman@sift.info
Cc: emacs-orgmode@gnu.org
Subject: Re: Making an index in latex export --- surprisingly difficult
Date: Thu, 28 Apr 2011 12:52:00 +0100	[thread overview]
Message-ID: <87iptyegpr.fsf@ucl.ac.uk> (raw)
In-Reply-To: <4DB949C5.7020107@sift.info> (Robert Goldman's message of "Thu, 28 Apr 2011 06:04:37 -0500")

Robert Goldman <rpgoldman@sift.info> 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
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"))

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


> 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
: using Org-mode version 7.5 (release_7.5.209.g1a687)

  reply	other threads:[~2011-04-28 11:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-26 21:09 Making an index in latex export --- surprisingly difficult Robert Goldman
2011-04-26 21:26 ` Suvayu Ali
2011-04-26 21:44   ` Robert Goldman
2011-04-28  9:28     ` Eric S Fraga
2011-04-28 11:04       ` Robert Goldman
2011-04-28 11:52         ` Eric S Fraga [this message]
2011-04-26 21:52 ` Nick Dokos
2011-04-26 21:58   ` Robert Goldman
2011-04-26 23:14     ` Nick Dokos
2011-04-27  1:32       ` Robert Goldman
2011-04-27  6:35     ` Nick Dokos
2011-04-27  7:38       ` Thomas S. Dye
2011-05-09  6:08       ` Tom Dye

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:

  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=87iptyegpr.fsf@ucl.ac.uk \
    --to=e.fraga@ucl.ac.uk \
    --cc=emacs-orgmode@gnu.org \
    --cc=rpgoldman@sift.info \


* 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


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).