Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

This question already has an answer here:

I am new to Lyx and have spent the better part of a week getting things to work correctly. I am stumped how to fix the problem of the bibliography sorting order not working.

I have a LyX file like this:

Mary had a little lamb.

I insert a citation so now I have:

Mary had a little lamb [1].

I then realize that I needed to cite Mary so I insert again:

Mary [2] had a little lamb [1].

No matter what I do in settings etc, I can not get it to print:

Mary [1] had a little lamb [2].

My set up:

LyX version 2.0.4 MiKTex 2.9 I am using Zotero in conjunction with LyX to build BibTeX database. I have tried different styles: unsrt, plain, ieeter

LyXserverPipe: \.\pipe\lyxpipe

I am totally tired of trying to get this up and working. I am sure the effort will be repaid, but what a pain.

Any help is appreciated.

share|improve this question

migrated from stackoverflow.com Oct 13 '12 at 21:42

This question came from our site for professional and enthusiast programmers.

marked as duplicate by Andrew Swann, Adam Liter, Kurt, Yori, Christian Hupfer 2 days ago

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
Welcome to TeX.sx! Your post was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other (by using the same OpenID), otherwise you won't be able to comment on or accept answers or edit your question. The style that should allow to get what you want is unsrt. –  egreg Oct 13 '12 at 21:46
    
I’m quite sure, this is not MiKTeX related. –  Speravir Nov 13 '12 at 2:50
    
Aren’t there auxiliary files generated? I would first try to delete them. –  Speravir Nov 13 '12 at 2:55

2 Answers 2

The answer is in BibTeX style unsrt that you can select in the dialog window where you add your BibTeX database.

share|improve this answer
1  
This is one of several approaches. However, the poster is also asking to do this in LyX. Can you address that to improve your answer? –  Andrew Swann 2 days ago
    
Also, OP mentions having tried unsrt already. –  Yori 2 days ago

From rgheck here: http://www.lyx.org/trac/ticket/8363

Many publishers prefer that citations be listed by date, and sometimes numerical citations are ordered not alphabetically, but by order of appearance. And there's a better solution to this: use natbib and use its "sort" option. This automatically sorts the citations numerically, and you can even use "sort&compress" to get things like: [2,4-6]. Note that "sort" will also sort citations alphabetically, in the author-year case. To do this, make sure you are using natbib (numerical) under Document> Settings> Bibliography, and then go to the Document Class pane and enter "sort" or "sort&compress" in the Custom field, under Class Options. It wouldn't be a terrible thing to have UI for this. So I'm going to change the bug report to request that.

share|improve this answer