Go to page:

Search:   Help



LyX documentation


Shared groups



Categories: BibTeX
<< | Page list | >>

Simple example of using BibTeX with LyX

This example illustrates how you can use BibTeX together with LyX.



  1. Download simple_example.lyx and references.bib to the same directory.
  2. Open simple_example.lyx and do View→DVI.
    This should allow you to see the result without any errors.

If you want to, you can compare your output with that in simple_example.dvi or simple_example.pdf.

The file plainnat.lyx uses a different BibTeX style called plainnat that is part of the natbib-package, and the result is available in plainnat.dvi or plainnat.pdf.

Note: When plainnat.dvi and plainnat.pdf were generated, the source file was still called simple_example.lyx, so the text refers to the wrong file, please ignore that.

Related links

Contributor comments

  • On the user's list, Jean-Pierre suggests putting any URI:s in a field called url and that you use a style that supports this field, e.g. plainnat.
  • If you are using teTeX 1.0.7 and simply 'export as PDF', no links will be created in the PDF-file. Using teTeX 2.0.2 this works, and probably also when using 'pdflatex'.

Notes and history

  • Jean-Pierre's advice to use the plainnat style is now followed in the file plainnat.lyx.
  • The text \usepackage{hyperref} was added to the preamble of plainnat.lyx in order to get the links working in the exported PDF-file.
  • To get type 1 fonts when exporting to PDF, the document font was changed to Times.
  • After a comment by Gunter, I decided to keep simple_example.lyx simple, and put the example that uses plainnat in the file plainnat.lyx.


Excerpt from mail on the user's list by Jean-Pierre:

As far as the bib file is concerned, my opinion is that the bib data should always be self contained, so that using @preamble should not be encouraged (nor crossref in fact, or abbreviations).

Christian: My opinion is that these are fine to use, but that you have to remember when you use these constructions. And when necesseary, you have to use some tool such as aux2bib to generate a self-contained .bib-file.

Besides, the URL sould be described in an appropriate field, which will be understood or not depending on the bst file (natbib bsts understand the url field). In that line, the \url command will be managed by the document.

Christian: Makes sense.

See also



This example was created using the following version of LyX:

 localhost:~>lyx --version
 LyX 1.3.2 of Tue, May 6 2003
 Built on May 13 2003, 10:42:46
   Host type:                      i686-pc-linux-gnu
   Special build flags:           
   C   Compiler:                   gcc
   C   Compiler flags:             -g -O2
   C++ Compiler:                   g++ (2.96)
   C++ Compiler flags:             -O -fno-exceptions -ftemplate-depth-30
   Linker flags:                   
   Frontend:                       qt
     Qt version:                   3.0.3
   LyX binary dir:                 /pkg/lyx/1.3.2qt/bin
   LyX files dir:                  /pkg/lyx/1.3.2qt/share/lyx 


Edit - History - Print - Recent Changes - All Recent Changes - Search
Page last modified on 2008-01-06 14:48 CET