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.

I like alphanumerical citations written as in alpha.bst style, with initials of authors and years, but I would like references to appear sorted as in plain.bst style. As an example, I prefer the order

[BN07] M. Baker and S. Norine (2007)...
[Blo07] S. Bloch (2007)...

to

[Blo07] S. Bloch (2007)...
[BN07] M. Baker and S. Norine (2007)...

Then I would like to know how to modify the *.bst file in order to get what I want.

share|improve this question
3  
Please keep in mind, that this will get confusing for the reader of your document. He will see BN07 in the document, might skip to the end and through the list of references and will (especially if there are a lot of references) have a hard time finding what he is looking for. –  Stephan Oct 16 '11 at 17:17
    
Welcome to TeX.sx! Your question was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other, otherwise you won't be able to comment on or accept answers or edit your question. –  Werner Oct 16 '11 at 18:51
add comment

migrated from stackoverflow.com Oct 16 '11 at 18:32

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

2 Answers

up vote 3 down vote accepted

EDITED: You could try the following: copy alpha.bst to your tex directory and rename it e.g. to alpha_plsort.bst (you can find the location of the bst files with kpsewhich <bst-file>). In this file locate the definition of the function presort and rename it to presort.alpha. Now open plain.bst, copy the presort function from there, paste it into alpha_plsort.bst and rename it to presort.plain. Then change the call ITERATE(presort) to ITERATE(presort.plain) and insert ITERATE(presort.alpha) after the call to the SORT function. Your new bst file should look now something like this:

FUNCTION {presort.plain}
{ 
    % presort from plain.bst
}

FUNCTION {presort.alpha}
{ 
    % presort from alpha.bst
}

ITERATE {presort.plain}

SORT

ITERATE {presort.alpha}
share|improve this answer
    
Thanks to all. I tried copying the presort function from plain.bst and removing the one of alpha.bst looking at the functions .sort but I obtain errors when I compile. Nevertheless, if I don't remove the original presort function (of the alpha.bst), copying just after it the presort function from the plain.bst, changing its name and iterating both functions (first presort-alpha and later presort-plain), all before the instruction SORT, I obtain what I want. –  iago Oct 20 '11 at 17:04
    
Yes, you're right, I should have tested it before. What also works is iterating presort-alpha after SORT to just get the labels right. –  Elmar Zander Oct 21 '11 at 12:33
    
@iago: I've edited my answer now to reflect your comments. This version should work now. –  Elmar Zander Oct 21 '11 at 12:52
add comment

I'm afraid you didn't provide quite enough information for us to tell you fully how to modify a given .bst file. However, I would recommend that you run the file makebst.tex -- it'll compile under both plain TeX and LaTeX, and it's entirely menu driven: it asks you a series of question, and at the end it creates a new .bst file for you. Happy (Bib)TeXing!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.