From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: problems with LaTex/BibTex Date: Sat, 31 Mar 2012 00:20:28 -0400 Message-ID: <4074.1333167628@alphaville> References: <15186.85.197.227.93.1333071675.squirrel@www.hafro.is> <4F759F07.5040903@hafro.is> Reply-To: nicholas.dokos@hp.com Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:41766) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDpno-0003Ij-CO for emacs-orgmode@gnu.org; Sat, 31 Mar 2012 00:20:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SDpnl-0002vS-Lc for emacs-orgmode@gnu.org; Sat, 31 Mar 2012 00:20:35 -0400 Received: from g1t0027.austin.hp.com ([15.216.28.34]:31382) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDpnl-0002um-Eo for emacs-orgmode@gnu.org; Sat, 31 Mar 2012 00:20:33 -0400 In-Reply-To: Message from "Alan E. Davis" of "Fri\, 30 Mar 2012 18\:15\:57 PDT." 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: "Alan E. Davis" Cc: Julian Burgos , nicholas.dokos@hp.com, emacs-orgmode@gnu.org Alan E. Davis wrote: > I would have a use for this.=C2=A0 I am curious, though... >=20 > Suppose I use this as a standard init-file declaration for org-latex-to-p= df-process .=C2=A0 Does that > mean that bibtex will always be run, every time, during the generation of= PDFs via LaTex export?=C2=A0=C2=A0 >=20 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 somefil= e.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=3D"./$command_line_filename" and the fixed version is echo "$command_line_filename" | $EGREP '^(/|[A-Za-z]:/)' >&6 \ || command_line_filename=3D"./$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 >=20 > On Fri, Mar 30, 2012 at 4:54 AM, Julian Burgos wrote: >=20 > Yes! That was it. =C2=A0Thanks!! >=20 > On f=C3=B6s 30.mar 2012 08:05, suvayu ali wrote: >=20=20=20=20 > Hey Julian, >=20=20=20=20=20=20=20=20 > On Fri, Mar 30, 2012 at 03:41, Julian Burgos =C2= =A0wrote: >=20=20=20=20=20=20=20=20 > The "References.bib" is a BibTex file in the same folder as t= he test file. > =C2=A0The citations were entered using RefTex with no problem= . =C2=A0But when > exporting to pdf, I get the following message in the minibuff= er: > "Exporting to PDF...done, with some errors: [undefined citati= ons]". =C2=A0The > pdf produced had, of course, question marks where the citatio= ns should be. >=20=20=20=20=20=20=20=20 > Did you customise your org-latex-to-pdf-process to include bibtex= ? I use > something like this: >=20=20=20=20=20=20=20=20 > (setq org-latex-to-pdf-process '("pdflatex -interaction nonstopmo= de %b" > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "/usr/bin/bibtex %b" > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "pdflatex -interaction non= stopmode %b" > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "pdflatex -interaction non= stopmode %b")) >=20 > -- > Julian Mariano Burgos, PhD > Hafranns=C3=B3knastofnunin/Marine Research Institute > Sk=C3=BAlagata 4, 121 Reykjav=C3=ADk, Iceland > S=C3=ADmi/Telephone : +354-5752037 > Br=C3=A9fs=C3=ADmi/Telefax: =C2=A0+354-5752001 > Netfang/Email: julian@hafro.is >=20 >=20 > ---------------------------------------------------- > Alternatives: >=20 > ----------------------------------------------------