emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] problems with LaTex/BibTex


From: Nick Dokos
Subject: Re: [O] problems with LaTex/BibTex
Date: Sat, 31 Mar 2012 00:20:28 -0400

Alan E. Davis <address@hidden> 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 <address@hidden> 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<address@hidden>  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: address@hidden
> 
> 
> ----------------------------------------------------
> Alternatives:
> 
> ----------------------------------------------------



reply via email to

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