emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: "Alan E. Davis" <lngndvs@gmail.com>
Cc: Julian Burgos <julian@hafro.is>,
	nicholas.dokos@hp.com, emacs-orgmode@gnu.org
Subject: Re: problems with LaTex/BibTex
Date: Sat, 31 Mar 2012 00:20:28 -0400	[thread overview]
Message-ID: <4074.1333167628@alphaville> (raw)
In-Reply-To: Message from "Alan E. Davis" <lngndvs@gmail.com> of "Fri\, 30 Mar 2012 18\:15\:57 PDT." <CAF-1L2TqSpt=yKo6-Hz0ffma1mJMsXdzBBfX3jt1E=CUKFQ+-w@mail.gmail.com>

Alan E. Davis <lngndvs@gmail.com> wrote:

> I would have a use for this.  I am curious, though...
> 
> Suppose I use this as a standard init-file declaration for org-latex-to-pdf-process .  Does that
> mean that bibtex will always be run, every time, during the generation of PDFs via LaTex export?  
> 

I believe so.

I think the best way to deal with the mess of programs that you have to
run for complicated latex productions (at least on linux) is to use
texi2dvi, which is supposed to figure out these dependencies and run the
"correct" sequence of programs the "correct" number of times (it does
this by parsing error messages in the log file, I believe).

The trouble is that, as currently distributed, texi2dvi has a bug that
causes an error with recent versions of egrep.  That's why the
default value of org-latex-to-pdf-process is not texi2dvi. C-h v
org-latex-to-pdf-process RET for more details.

You might try it and see if you get the error: try ``texi2dvi --pdf somefile.tex''
The symptom is the message

egrep: Invalid range end

If you get the error, then you can forget about texi2dvi for now.

OTOH, if you are willing to live with the consequences of actually
fixing the bug in your version of texi2dvi, that's pretty easy. The
danger is that you are going to pull an update which might revert
texi2dvi to its unpatched state. But if you have patched it once, it's
easy to patch it again.

The change is around line 1713 of /usr/bin/texi2dvi. The original says

  echo "$command_line_filename" | $EGREP '^(/|[A-z]:/)' >&6 \
  || command_line_filename="./$command_line_filename"

and the fixed version is

  echo "$command_line_filename" | $EGREP '^(/|[A-Za-z]:/)' >&6 \
  || command_line_filename="./$command_line_filename"

just changing the egrep pattern.

The fixed version is not exactly equivalent to the original version
but the difference is academic, unless you run Windows and you have
lots of drives.

FWIW, I've fixed my texi2dvi as above, and have set org-latex-to-pdf-process
to a custom shell command: texi2dvi --pdf --batch %f.

Org provides a texi2dvi customize option for org-latex-to-pdf-process
that also sets the build mode to ``clean'' which gets rid of the extra
files that a latex run produces, but I prefer leaving all the "junk"
files around and clean them up once at the end.

Nick

> Alan
> 
> On Fri, Mar 30, 2012 at 4:54 AM, Julian Burgos <julian@hafro.is> wrote:
> 
>     Yes! That was it.  Thanks!!
> 
>     On fös 30.mar 2012 08:05, suvayu ali wrote:
>    
>         Hey Julian,
>        
>         On Fri, Mar 30, 2012 at 03:41, Julian Burgos<julian@hafro.is>  wrote:
>        
>             The "References.bib" is a BibTex file in the same folder as the test file.
>              The citations were entered using RefTex with no problem.  But when
>             exporting to pdf, I get the following message in the minibuffer:
>             "Exporting to PDF...done, with some errors: [undefined citations]".  The
>             pdf produced had, of course, question marks where the citations should be.
>        
>         Did you customise your org-latex-to-pdf-process to include bibtex? I use
>         something like this:
>        
>         (setq org-latex-to-pdf-process '("pdflatex -interaction nonstopmode %b"
>                                         "/usr/bin/bibtex %b"
>                                         "pdflatex -interaction nonstopmode %b"
>                                         "pdflatex -interaction nonstopmode %b"))
> 
>     --
>     Julian Mariano Burgos, PhD
>     Hafrannsóknastofnunin/Marine Research Institute
>     Skúlagata 4, 121 Reykjavík, Iceland
>     Sími/Telephone : +354-5752037
>     Bréfsími/Telefax:  +354-5752001
>     Netfang/Email: julian@hafro.is
> 
> 
> ----------------------------------------------------
> Alternatives:
> 
> ----------------------------------------------------

  reply	other threads:[~2012-03-31  4:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-30  1:41 problems with LaTex/BibTex Julian Burgos
2012-03-30  8:05 ` suvayu ali
2012-03-30 11:54   ` Julian Burgos
2012-03-31  1:15     ` Alan E. Davis
2012-03-31  4:20       ` Nick Dokos [this message]
2012-04-25 11:21       ` Eric Fraga
2012-04-25 15:59         ` Mikhail Titov

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  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=4074.1333167628@alphaville \
    --to=nicholas.dokos@hp.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=julian@hafro.is \
    --cc=lngndvs@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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