Thanks. Bill.
This is completely untested, but what if you use the unsrt style
and put a \nocite{*} at the beginning of your document?
-- Scott
-- Bill
"Scott Pakin" <pa...@uiuc.edu> wrote in message
news:3A52D62C...@uiuc.edu...
Here's a patch to plain.bst that might do what you want.
1) Save the patch file at the bottom of this message to
plain-sk.patch.
2) Generate plain-sk.bst from plain.bst by issuing the
command "patch plain.bst -o plain-sk.bst < plain-sk.patch".
3) Add a sortkey field to each entry of your .bib file.
plain-sk.bst will sort the entries alphabetically by
sortkey.
4) Replace "\bibliographystyle{plain}" in your LaTeX document
with "\bibliographystyle{plain-sk}".
As far as I can tell, BibTeX doesn't expose the .bib file
order to a .bst file; it does everything in citation order.
sortkey at least gives you some manual control over the sort
order.
Let me know if this works,
-- Scott
===========================BEGIN: plain-sk.patch===========================
--- plain.bst Wed Jan 10 08:09:38 2001
+++ plain-sk.bst Wed Jan 10 08:47:39 2001
@@ -1,12 +1,8 @@
-% BibTeX standard bibliography style `plain'
- % version 0.99a for BibTeX versions 0.99a or later, LaTeX version 2.09.
- % Copyright (C) 1985, all rights reserved.
- % Copying of this file is authorized only if either
- % (1) you make absolutely no changes to your copy, including name, or
- % (2) if you do make changes, you name it something other than
- % btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst.
- % This restriction helps ensure that all standard styles are identical.
- % The file btxbst.doc has the documentation for this style.
+% BibTeX style `plain-sk'
+% By Scott Pakin <pa...@uiuc.edu>
+%
+% This style is just like `plain', but it sorts the entries first
+% by the SORTKEY field, then by the usual AUTHOR, EDITOR, etc.
ENTRY
{ address
@@ -27,6 +23,7 @@
publisher
school
series
+ sortkey
title
type
volume
@@ -1019,7 +1016,13 @@
}
FUNCTION {presort}
-{ type$ "book" =
+{ sortkey duplicate$ empty$
+ { pop$ "~~~~~" }
+ 'skip$
+ if$
+ " "
+ *
+ type$ "book" =
type$ "inbook" =
or
'author.editor.sort
@@ -1033,6 +1036,7 @@
if$
}
if$
+ *
" "
*
year field.or.null sortify
============================END: plain-sk.patch============================
Bill Leal wrote:
> Hi. I have a .bib file that I have sorted in a particular, desirable order.
> When I run BibTeX against it, I want the resulting entries to appear in the
> same order as they do in the .bib file. Is there some bibliography style I
> can choose that will do that? unsrt doesn't do the job since that puts
> entries in the order they appear as citations.
As Scott Pakin pointed out, BibTeX doesn't appear to expose the .bib
file order to the style file, so this ordering probably can't be
imposed on the bibliography without the sort of additions which Scott
mentioned.
If, however, you want _all_ of the entries in the .bib file to appear
as citations, then you can get this with an .aux file like
\relax
\citation{*}
\bibstyle{unsrt}
\bibdata{yourbibname}
or any other \bibstyle which doesn't sort the entries. In this case,
the bibliography entries are generated in the order they appear in
the .bib file. This may or may not be documented behaviour (I doubt
it), so may or may not be proof against any changes to BibTeX.
If you don't want all the .bib entries, but do absolutely need them to
be in .bib-file order, and can't add sort keys, then you might be able
to combine this with some magic with bibtool, say (at CTAN), to
construct a scratch .bib file from the master one, with just the
desired entries in it.
Have fun,
Norman
--
---------------------------------------------------------------------------
Norman Gray http://www.astro.gla.ac.uk/users/norman/