emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* problems with LaTex/BibTex
@ 2012-03-30  1:41 Julian Burgos
  2012-03-30  8:05 ` suvayu ali
  0 siblings, 1 reply; 7+ messages in thread
From: Julian Burgos @ 2012-03-30  1:41 UTC (permalink / raw)
  To: emacs-orgmode

Dear list,

I'm having some problems with LaTex exporting and reference lists.  This
is my a quick test:

-- start of org mode file --------------------------------

#+TITLE: This is a test
* Heading 1
  Some text, some text \cite{Steiniger2009a}.
* Heading 2
  Some other text \cite{Harrington2007}.

\bibliographystyle{plain}
\bibliography{References.bib}

-- end of org mode file --------------------------------

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.

I am using org mode 7.8.06 and Emacs 23.3.1 in Fedora 16 (not sure if that
makes any difference).

Any ideas?
Thanks,

Julian

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




Exporting to PDF...done, with some errors: [undefined citation]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: problems with LaTex/BibTex
  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
  0 siblings, 1 reply; 7+ messages in thread
From: suvayu ali @ 2012-03-30  8:05 UTC (permalink / raw)
  To: Julian Burgos; +Cc: emacs-orgmode

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

-- 
Suvayu

Open source is the future. It sets us free.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: problems with LaTex/BibTex
  2012-03-30  8:05 ` suvayu ali
@ 2012-03-30 11:54   ` Julian Burgos
  2012-03-31  1:15     ` Alan E. Davis
  0 siblings, 1 reply; 7+ messages in thread
From: Julian Burgos @ 2012-03-30 11:54 UTC (permalink / raw)
  To: suvayu ali; +Cc: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: problems with LaTex/BibTex
  2012-03-30 11:54   ` Julian Burgos
@ 2012-03-31  1:15     ` Alan E. Davis
  2012-03-31  4:20       ` Nick Dokos
  2012-04-25 11:21       ` Eric Fraga
  0 siblings, 2 replies; 7+ messages in thread
From: Alan E. Davis @ 2012-03-31  1:15 UTC (permalink / raw)
  To: Julian Burgos; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1559 bytes --]

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?

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

[-- Attachment #2: Type: text/html, Size: 2469 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: problems with LaTex/BibTex
  2012-03-31  1:15     ` Alan E. Davis
@ 2012-03-31  4:20       ` Nick Dokos
  2012-04-25 11:21       ` Eric Fraga
  1 sibling, 0 replies; 7+ messages in thread
From: Nick Dokos @ 2012-03-31  4:20 UTC (permalink / raw)
  To: Alan E. Davis; +Cc: Julian Burgos, nicholas.dokos, emacs-orgmode

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:
> 
> ----------------------------------------------------

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: problems with LaTex/BibTex
  2012-03-31  1:15     ` Alan E. Davis
  2012-03-31  4:20       ` Nick Dokos
@ 2012-04-25 11:21       ` Eric Fraga
  2012-04-25 15:59         ` Mikhail Titov
  1 sibling, 1 reply; 7+ messages in thread
From: Eric Fraga @ 2012-04-25 11:21 UTC (permalink / raw)
  To: Alan E. Davis; +Cc: Julian Burgos, emacs-orgmode

"Alan E. Davis" <lngndvs@gmail.com> writes:

> 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?

Yes but you can easily customise this variable on a per file basis.  If
you seldom use bibtex, have the default be to run pdflatex just
once.  Then, for any org file that needs bibtex, simply put in the
following line (or a variation thereof):

#+BIND: org-latex-to-pdf-process ("pdflatex %b" "bibtex %b" "pdflatex %b" "pdflatex %b")

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.1.50.1
: using Org-mode version 7.8.06 (release_7.8.06.181.g67694.dirty)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: problems with LaTex/BibTex
  2012-04-25 11:21       ` Eric Fraga
@ 2012-04-25 15:59         ` Mikhail Titov
  0 siblings, 0 replies; 7+ messages in thread
From: Mikhail Titov @ 2012-04-25 15:59 UTC (permalink / raw)
  To: 'Eric Fraga', 'Alan E. Davis'
  Cc: 'Julian Burgos', emacs-orgmode

> -----Original Message-----
> From: emacs-orgmode-bounces+mlt=gmx.us@gnu.org [mailto:emacs-orgmode-
> bounces+mlt=gmx.us@gnu.org] On Behalf Of Eric Fraga
> Sent: Wednesday, April 25, 2012 6:21 AM
> To: Alan E. Davis
> Cc: Julian Burgos; emacs-orgmode@gnu.org
> Subject: Re: [O] problems with LaTex/BibTex
> 
> "Alan E. Davis" <lngndvs@gmail.com> writes:
> 
> > 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?
> 
> Yes but you can easily customise this variable on a per file basis.  If
> you seldom use bibtex, have the default be to run pdflatex just
> once.  Then, for any org file that needs bibtex, simply put in the
> following line (or a variation thereof):
> 
> #+BIND: org-latex-to-pdf-process ("pdflatex %b" "bibtex %b" "pdflatex %b"
> "pdflatex %b")

Also, if you are on Windows with MikTeX, you can use texify, otherwise
latexmk can save you some time when it is not necessary to rebuild index
and/or bibliography.

M.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-04-25 15:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2012-04-25 11:21       ` Eric Fraga
2012-04-25 15:59         ` Mikhail Titov

Code repositories for project(s) associated with this 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).