1Text::BibTeX::BibSort(3U)ser Contributed Perl DocumentatiToenxt::BibTeX::BibSort(3)
2
3
4
6 Text::BibTeX::BibSort - generate sort keys for bibliographic entries
7
9 # Assuming $entry comes from a database of the 'Bib' structure
10 # (i.e., that it's blessed into the BibEntry class, which inherits
11 # the sort_key method from BibSort):
12 $sort_key = $entry->sort_key;
13
15 "Text::BibTeX::BibSort" is a base class of "Text::BibTeX::BibEntry" for
16 generating sort keys from bibliography entries. It could in principle
17 (and, someday, might) offer a wide range of highly customizable sort-
18 key generators. Currently, though, it provides only a single method
19 ("sort_key") for public use, and that method only pays attention to one
20 structure option, "sortby".
21
23 sort_key ()
24 Generates a sort key for a single bibliographic entry. Assumes
25 this entry conforms to the "Bib" database structure. The nature of
26 this sort key is controlled by the "sortby" option, which can be
27 either "name" or "year". (The "namestyle" also has a role, in
28 determining how author/editor names are formatted for inclusion in
29 the sort key.)
30
31 For by-name sorting (which is how BibTeX's standard styles work),
32 the sort key consists of one of the "author", "editor",
33 "organization", or "key" fields (depending on the entry type and
34 which fields are actually present), followed by the year and the
35 title. All fields are drastically simplified to produce the sort
36 key: non-English letters are mercilessly anglicized, non-alphabetic
37 characters are stripped, and everything is forced to lowercase.
38 (The first two steps are done by the "purify_string" routine; see
39 "Generic string-processing functions" in Text::BibTeX for a brief
40 description, and the description of the C function
41 bt_purify_string() in bt_misc for all the gory details.)
42
44 Text::BibTeX::Structure, Text::BibTeX::Bib, Text::BibTeX::BibFormat
45
47 Greg Ward <gward@python.net>
48
50 Copyright (c) 1997-2000 by Gregory P. Ward. All rights reserved. This
51 file is part of the Text::BibTeX library. This library is free
52 software; you may redistribute it and/or modify it under the same terms
53 as Perl itself.
54
55
56
57perl v5.36.0 2023-01-29 Text::BibTeX::BibSort(3)