.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Text::BibTeX::BibSort 3pm" .TH Text::BibTeX::BibSort 3pm 2024-01-10 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Text::BibTeX::BibSort \- generate sort keys for bibliographic entries .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 4 \& # Assuming $entry comes from a database of the \*(AqBib\*(Aq structure \& # (i.e., that it\*(Aqs blessed into the BibEntry class, which inherits \& # the sort_key method from BibSort): \& $sort_key = $entry\->sort_key; .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" \&\f(CW\*(C`Text::BibTeX::BibSort\*(C'\fR is a base class of \f(CW\*(C`Text::BibTeX::BibEntry\*(C'\fR for generating sort keys from bibliography entries. It could in principle (and, someday, might) offer a wide range of highly customizable sort-key generators. Currently, though, it provides only a single method (\f(CW\*(C`sort_key\*(C'\fR) for public use, and that method only pays attention to one structure option, \f(CW\*(C`sortby\*(C'\fR. .SH METHODS .IX Header "METHODS" .IP "sort_key ()" 4 .IX Item "sort_key ()" Generates a sort key for a single bibliographic entry. Assumes this entry conforms to the \f(CW\*(C`Bib\*(C'\fR database structure. The nature of this sort key is controlled by the \f(CW\*(C`sortby\*(C'\fR option, which can be either \&\f(CW"name"\fR or \f(CW"year"\fR. (The \f(CW\*(C`namestyle\*(C'\fR also has a role, in determining how author/editor names are formatted for inclusion in the sort key.) .Sp For by-name sorting (which is how BibTeX's standard styles work), the sort key consists of one of the \f(CW\*(C`author\*(C'\fR, \f(CW\*(C`editor\*(C'\fR, \f(CW\*(C`organization\*(C'\fR, or \f(CW\*(C`key\*(C'\fR fields (depending on the entry type and which fields are actually present), followed by the year and the title. All fields are drastically simplified to produce the sort key: non-English letters are mercilessly anglicized, non-alphabetic characters are stripped, and everything is forced to lowercase. (The first two steps are done by the \f(CW\*(C`purify_string\*(C'\fR routine; see "Generic string-processing functions" in Text::BibTeX for a brief description, and the description of the C function \f(CWbt_purify_string()\fR in bt_misc for all the gory details.) .SH "SEE ALSO" .IX Header "SEE ALSO" Text::BibTeX::Structure, Text::BibTeX::Bib, Text::BibTeX::BibFormat .SH AUTHOR .IX Header "AUTHOR" Greg Ward .SH COPYRIGHT .IX Header "COPYRIGHT" Copyright (c) 1997\-2000 by Gregory P. Ward. All rights reserved. This file is part of the Text::BibTeX library. This library is free software; you may redistribute it and/or modify it under the same terms as Perl itself.