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.

  • 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

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.