From mboxrd@z Thu Jan 1 00:00:00 1970 From: Omid Subject: Re: How to get BibTeX to work with Org mode LaTeX export? Date: Sat, 18 May 2013 04:40:24 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b5d5c125efdb304dcfa0f7f Return-path: Received: from eggs.gnu.org ([208.118.235.92]:32776) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UdchT-0005CE-Gy for emacs-orgmode@gnu.org; Sat, 18 May 2013 04:41:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UdchN-0007BN-N0 for emacs-orgmode@gnu.org; Sat, 18 May 2013 04:41:11 -0400 Received: from mail-wi0-x236.google.com ([2a00:1450:400c:c05::236]:50711) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UdchN-0007B8-Cj for emacs-orgmode@gnu.org; Sat, 18 May 2013 04:41:05 -0400 Received: by mail-wi0-f182.google.com with SMTP id c10so903442wiw.9 for ; Sat, 18 May 2013 01:41:04 -0700 (PDT) In-Reply-To: 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: Yury Bulka Cc: emacs-orgmode@gnu.org --047d7b5d5c125efdb304dcfa0f7f Content-Type: text/plain; charset=ISO-8859-1 - The \bibliographystyle and \bibliography commands are at the end of the document. - The question is about how to get Org mode to do the whole job, as there is a command for it which is supposed to do exactly that but it doesn't. On Sat, May 18, 2013 at 4:28 AM, Yury Bulka wrote: > I believe you should put the \bibliographystyle and \bibliography commands > at the end of the document before \end{document}. > > Next, to compile the file, you should first run pdflatex YOURFILE.tex, > then run bibtex YOURFILE (without extension or with .aux), and then again > pdflatex, possibly twice. > > This can be done by first exporting to LaTeX and then compiling manually. > > I think you can also adjust the variable `org-latex-to-pdf-process' in > order to include a bibtex command (not tested yet) in the org pdf export > procedure. > > Good luck! > > > 2013/5/18 Omid > >> I have posted a question to tex.stackexchange.com on "How to get BibTeX >> to work with Org mode LaTeX export?" Here is a link to it: >> http://tex.stackexchange.com/questions/114864/how-to-get-bibtex-to-work-with-org-mode-latex-export. >> I thought this mailing list might be the best place to ask for help about >> it. Thanks in advance for your time. >> >> For ease of reference, here is the question again: >> >> I am trying to get Emacs (24.3.1), Org-mode (8.0.3, from ELPA) and BibTeX >> (from TeX Live 2012) to work together. I have followed the instructions >> under the Bibliography section in >> http://orgmode.org/worg/org-tutorials/org-latex-export.html but after >> exporting the document to LaTeX, compiling to PDF, and opening the result >> (with key sequence C-c C-e l o in the latest Org mode) I see a question >> mark instead of a citation (i.e., [?]) which means that the reference was >> not resolved by LaTeX. In fact, checking the Org PDF LaTeX Output buffer, I >> see the following warning: >> >> LaTeX Warning: Citation `Tappert77' on page 3 undefined on input line 43. >> >> No file org-bib-test.bbl. >> [3] (.//org-bib-test.aux) >> >> LaTeX Warning: There were undefined references. >> >> It looked to me that probably Org-mode was looking for a .bib file with >> the same base name as the .org file but renaming the .bib file and updating >> the \bibliography line did not solve the problem. >> >> Here are two minimal .org and .bib files that together can be used to >> reproduce the behavior described above: >> >> org-bib-test.org >> >> * Tests >> ** Test1 slide >> - This is test1 \cite{Tappert77}. >> >> \bibliographystyle{plain} >> \bibliography{org-bib-test-refs} >> >> The following, using #+LATEX_HEADER, gives the same result: >> >> org-bib-test.org >> >> #+LATEX_HEADER: \bibliographystyle{plain} >> #+LATEX_HEADER: \bibliography{org-bib-test-refs} >> >> * Tests >> ** Test1 slide >> - This is test1 \cite{Tappert77}. >> >> org-bib-test-refs.bib >> >> @incollection {Tappert77, >> AUTHOR = {Tappert, Fred D.}, >> TITLE = {The parabolic approximation method}, >> BOOKTITLE = {Wave propagation and underwater acoustics ({W}orkshop, >> {M}ystic, {C}onn., 1974)}, >> PAGES = {224--287. Lecture Notes in Phys., Vol. 70}, >> PUBLISHER = {Springer}, >> ADDRESS = {Berlin}, >> YEAR = {1977}, >> MRCLASS = {76.41 (86.41)}, >> } >> >> Currently I am using the following ugly hack to get the references >> resolved: I generate the .bbl file from the .bib file (using a minimal .tex >> file) and then I \include the resulting .bbl file directly in my .org file. >> This is rather cumbersome and of course requires that I regenerate the .bbl >> file every time I make a change to the .bib file. Although this process can >> be automated in Emacs by writing a lisp function to encapsulate these >> actions, I'd rather solve the problem than streamline a hack. >> >> I have checked the .tex file generated by Org mode. It does have the >> following necessary lines exported in it: >> >> \bibliographystyle{plain} >> \bibliography{org-bib-test-refs} >> >> -Omid >> > > --047d7b5d5c125efdb304dcfa0f7f Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
- The \bibliographystyle and \bibliography commands are a= t the end of the document.
- The question is about how to get Org mode t= o do the whole job, as there is a command for it which is supposed to do ex= actly that but it doesn't.


On Sat,= May 18, 2013 at 4:28 AM, Yury Bulka <yurkobb@gmail.com> wro= te:
I believe yo= u should put the \bibliographystyle and \bibliography commands at the end o= f the document before \end{document}.

Next, to compile the file, you should first run pdflatex YOURFILE= .tex, then run bibtex YOURFILE (without extension or with .aux), and then a= gain pdflatex, possibly twice.

This can be done by first exporting to LaTeX and then compil= ing manually.

I think you can also adjust the varia= ble `org-latex-to-pdf-process' in order to include a bibtex command (no= t tested yet) in the org pdf export procedure.

Good luck!


2013/5/18 Omid <= omidlink@gmail.com>
I have posted a question to tex.stackexchange.com on "How t= o get=20 BibTeX to work with Org mode LaTeX export?" Here is a link to it: http://tex.stackexchange.= com/questions/114864/how-to-get-bibtex-to-work-with-org-mode-latex-export. I thought this mailing list might be the best place to ask for help abo= ut it. Thanks in advance for your time.

For ease of reference, here is the question again:

I am t= rying to get Emacs (24.3.1), Org-mode (8.0.3, from ELPA) and BibTeX (from T= eX Live 2012) to work together. I have followed the instructions under the = Bibliography section in http://orgmode.org/worg/org-tutorial= s/org-latex-export.html but after exporting the document to LaTeX, comp= iling to PDF, and opening the result (with key sequence C-c C-e l o in the = latest Org mode) I see a question mark instead of a citation (i.e., [?]) wh= ich means that the reference was not resolved by LaTeX. In fact, checking t= he Org PDF LaTeX Output buffer, I see the following warning:

LaTeX Warning: Citation `Tappert77' on page 3 undefined on input li= ne 43.

No file org-bib-test.bbl.
[3] (.//org-bib-test.aux)
LaTeX Warning: There were undefined references.

It looked to me th= at probably Org-mode was looking for a .bib file with the same base name as= the .org file but renaming the .bib file and updating the \bibliography li= ne did not solve the problem.

Here are two minimal .org and .bib files that together can be used to r= eproduce the behavior described above:

org-bib-test.org

* Tests
** Test1 sl= ide
=A0 =A0- This is test1 \cite{Tappert77}.

\bibliographystyle{plain}
\bibliography{org-bib-test-refs}

Th= e following, using #+LATEX_HEADER, gives the same result:

org-bib-test.org

#+L= ATEX_HEADER: \bibliographystyle{plain}
#+LATEX_HEADER: \bibliography{org-bib-test-refs}

* Tests
** Test1= slide
=A0 =A0- This is test1 \cite{Tappert77}.

org-bib-test-refs= .bib

@incollection {Tappert77,
AUTHOR =3D {Tappert, Fred D.},
= TITLE =3D {The parabolic approximation method},
BOOKTITLE =3D {Wave propagation and underwater acoustics ({W}orkshop,
= =A0 =A0 =A0 =A0 =A0 =A0 =A0 {M}ystic, {C}onn., 1974)},
PAGES =3D {224--2= 87. Lecture Notes in Phys., Vol. 70},
PUBLISHER =3D {Springer},
ADDRE= SS =3D {Berlin},
YEAR =3D {1977},
MRCLASS =3D {76.41 (86.41)},
}

Currently I am= using the following ugly hack to get the references resolved: I generate t= he .bbl file from the .bib file (using a minimal .tex file) and then I \inc= lude the resulting .bbl file directly in my .org file. This is rather cumbe= rsome and of course requires that I regenerate the .bbl file every time I m= ake a change to the .bib file. Although this process can be automated in Em= acs by writing a lisp function to encapsulate these actions, I'd rather= solve the problem than streamline a hack.

I have checked the .tex file generated by Org mode. It does have the fo= llowing necessary lines exported in it:

\bibliographystyle{plain}\bibliography{org-bib-test-refs}

-Omid


--047d7b5d5c125efdb304dcfa0f7f--