LyXLyx bibliography sorting order is not automatic? Help!

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
serratus
Posts: 1
Joined: Thu Sep 18, 2008 8:46 pm

Lyx bibliography sorting order is not automatic? Help!

Post by serratus »

I'm new to LaTeX and Lyx but have read a lot on Lyx and started to write my thesis in it. Right now, I'm finding that when adding a bibliographical entry, Lyx does not automatically insert it into the correct order and update the numbers. It's probably easier to describe what I'm saying by using a simple example:

Normally, you want something like this:

Text text text [1], text more text
more text [2] more text [3]

Bibliography
[1] google
[2] yahoo
[3] msn


from the following Lyx code:

Text text text [google-key], text more text
more text [yahoo-key] more text [msn-key]

Bibliography
[google-key] google
[yahoo-key] yahoo
[msn-key] msn



Now, the problem is if you started adding more text and more bibliographies. For example I end up with this mess:

Text text text [1], text more text
ADDED LINE[4] HERE
more text [2] more MORE ADDED TEXT AND REFERENCE [5] text [3]

Bibliography
[1] google
[2] yahoo
[3] msn
[4] logitech
[5] samsung


from the following Lyx code:

Text text text [google-key], text more text
ADDED LINE[new_logetech-key] HERE
more text [yahoo-key] more MORE ADDED TEXT AND REFERENCE [new_samsung-key] text [msn-key]

Bibliography
[google-key] google
[yahoo-key] yahoo
[msn-key] msn
[new_logetech-key]
[new_samsung-key]



Now, what I want is to have the final output to have numbers [1] to [5] in chronological order. The quick solution is to insert the
[new_logetech-key]
[new_samsung-key]

into the 2nd and 4th entries in the bibliography instead at the end, but finding and inserting in the correct order is not practical when inserting chapters together for a thesis with numerous references. Wasn't the point of Lyx to help do these kind of things automatically?

BTW, I'm not using BibTeX and would love to learn how because I bet Lyx doesn't screw up the order when using BibTeX. Is there a good GUI that helps with making the BibTeX databases for windows? Anyhow, is there some command in Lyx that will automatically sort this properly in chronological order of appearance in the thesis? or am I forced to learn BibTeX?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX books
User avatar
Maksi
Posts: 52
Joined: Sun Mar 16, 2008 12:12 pm

Lyx bibliography sorting order is not automatic? Help!

Post by Maksi »

serratus wrote:BTW, I'm not using BibTeX and would love to learn how because I bet Lyx doesn't screw up the order when using BibTeX. Is there a good GUI that helps with making the BibTeX databases for windows? Anyhow, is there some command in Lyx that will automatically sort this properly in chronological order of appearance in the thesis? or am I forced to learn BibTeX?
JabRef

And as for the rest, I did not quite understand you. What are your settings in LyX (LyX -> Document -> Settings -> Bibliography)? Do you use standard references, Natbib or Jurabib? All these are different packages for different purposes and can be set up for your needs to some extent.
Standard is for standard [1] numerical [2] references [3] and so on.
Natbib is for (Author, Year) references used commonly in some sciences and social sciences.
Jurabib is for references in footnose.

Now, what is your setting and do you have any special settings in your LaTeX preamble?

And generally, LyX can handle its own bibliography (using BibTeX of course) for every document or use a separate bibliography file edited with a BibTeX editor (which I recommend). You can then easily access all citations via the citations dialogue in LyX.
A Humanities user of LaTeX :)
lbthrice
Posts: 1
Joined: Tue Oct 28, 2008 5:14 am

Re: Lyx bibliography sorting order is not automatic? Help!

Post by lbthrice »

Hi,

The bibliographic style you are looking for is "unsrt".
In Lyx (assuming you have the proper bst installed...which you probably do) just right click in the bibliography environment and change the style from "plain" to "unsrt". Easy pah-cheesy...like getting a degree in the humanties :).
djc11
Posts: 2
Joined: Wed Jan 20, 2010 4:59 pm

Re: Lyx bibliography sorting order is not automatic? Help!

Post by djc11 »

Hi,
Sorry to dredge up an old thread but I am having the same problem as the OP.
My references are not being listed chronologically in the main text and are appearing like:

textextext[14]textextext[6]textextextext[1]

Bib:
[1]
[2]
[3]...

I've tried setting the bib style to unsrt but this does not alter the situation.
Any ideas? I am using lyx 1.6.3 and jabref 2.6

Edit: Ok so I've just noticed that the reference list at the end is organised in alphabetical order i.e. [1] A.Aaron, [2] B.Baxter etc. I'm not sure how I managed to do that, but how would I go about changing this so that the order is chronological?

Regards
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Re: Lyx bibliography sorting order is not automatic? Help!

Post by Juanjo »

Somewhere in your file, where the bibliography should appear in the final document, there is a gray rectangle with the words "Generated BibTeX bibliography" (or something similar). Click there. In the opened window, go to the popup menu corresponding to bib styles and choose unsrt. Accept and generate a new document.
If this doesn't work, you should prepare a small lyx file showing the problem; compress it, together with the bib file, and attach the zip file to a new post here.
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
CA McHugh
Posts: 1
Joined: Wed Mar 23, 2011 5:53 pm

Re: Lyx bibliography sorting order is not automatic? Help!

Post by CA McHugh »

I just wanted to thank you for the answers to this question. I'm writing my doctoral thesis in Microbiology using LyX and was having the same problem. Thanks to your help, I solved it quickly and easily. :D
xiao_haozi
Posts: 1
Joined: Wed May 11, 2011 9:35 pm

Lyx bibliography sorting order is not automatic? Help!

Post by xiao_haozi »

Sorry to bump this older thread, but I am having the same issue.

update I have attached a zip of the .lyx file and the bib file.
test_doc.zip
test documents
(4.33 KiB) Downloaded 412 times
I am using biblatex and have setup as outlined in the lyx wiki page. The problem I am running into is that after if I insert a citation say right here (*) it is obviously listed as [1]. However, if I know go back and realize I want to add a citation earlier, it is listed as [2] and reading through teh document you would then see the first citation listed as [2] and not [1]. The citations aren't being renumbered retroactively.

I will outline my setup below ... anyone know what I'm missing?

-bib generated in kbibtex (.bib output)

-preamble:

Code: Select all

Code, edit and compile here:
\usepackage[style=numeric,natbib=true]{biblatex}
\bibliography{/home/my_user/test_bib}
\bibliographystyle{unsrt}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-citation style in the dialog menu for document settigns is natbib numeric with processor bibtex

-the bib listing in my lyx note loads test_bib with style unsrt

*note: i cannot exclude natbib=true from my preamble

Everything works okay, just that things aren't retroactively renumbered if I add a citation back later before others.
christophellebrecht
Posts: 1
Joined: Sat May 21, 2011 5:30 pm

Lyx bibliography sorting order is not automatic? Help!

Post by christophellebrecht »

Juanjo wrote:Somewhere in your file, where the bibliography should appear in the final document, there is a gray rectangle with the words "Generated BibTeX bibliography" (or something similar). Click there. In the opened window, go to the popup menu corresponding to bib styles and choose unsrt. Accept and generate a new document.
If this doesn't work, you should prepare a small lyx file showing the problem; compress it, together with the bib file, and attach the zip file to a new post here.
Hi there,

I've changed the bib style to unsrt, but lyx doesnt put the citations in the order they appear in the text? any ideas?

thanks,
Post Reply