2

Suppose you have a bibliography written with bibtex/natbib with author names, using e.g. also Scandinavian letters, like in Åqvist, Æsop, Ødegaard, Österlund and Ändernson.

Is there a way to make such words appear at desired places in the bibliography?

Such a feature may be useful if one wants to write an international text where the bibliography conforms to occasionally specified rules motivated by the alphabet, or alphabets, of the letters.

  • 1
    Please clarify what you mean by "make such words appear at desired places in the bibliography" [emphasis added]. Specifically, would you want Åqvist and Æsop to be placed with entries that start with A -- the English language sorting convention -- or at the very end of the listing -- the Swedish convention? (I'm not sure about the other Nordic languages' sorting conventions.) Please advise. – Mico May 21 '21 at 03:52
  • Is there an English language sorting convention for the letters I mentioned? If so, is it followed by bibtex/natbib? – Frode Alfson Bjørdal May 21 '21 at 04:10
  • The desired positions I had in mind was a hybrid between the Danish-Norwegian alphabet and the Swedish alphabet, which have, respectively, ÆØÅ and ÅÄÖ as final letters. – Frode Alfson Bjørdal May 21 '21 at 04:14
  • The English-language sorting convention is simple: Treat Å and Æ and Ä as equivalent to A for sorting purposes. In order to enable adherence to this convention, BibTeX requires replacement of Å, Æ and Ä with {\AA}, {\AE}, and {\"A}, respectively; see How to write “ä” and other umlauts and accented letters in bibliography? for more information. If that's not what you're looking for, please post a new query (or apply a major edit to this query) and state more explicitly what you're looking to achieve. – Mico May 21 '21 at 04:26
  • natbib is primarily a citation management package. As such, it exerts no influence whatsoever on the sorting of the entries. – Mico May 21 '21 at 04:28
  • 2
    Bibtex doesn't know such sorting rules. You should use biblatex and biber instead. Biber is unicode aware and uses the collation library. – Ulrike Fischer May 21 '21 at 05:51

1 Answers1

5

BibTeX can only sort ASCII characters. That's one reason why non-ASCII characters usually have to be 'escaped' with LaTeX macros as described in How to write “ä” and other umlauts and accented letters in bibliography?. (The other reason is that BibTeX has trouble generating initials for non-ASCII characters.)

Most BibTeX styles purify$ the sort key before it is used for sorting. This purify$ing converts some special control sequences to letters while ignoring all others and then removes all nonalphanumeric characters.

The control sequences that are replaced are listed below, all others (like \relax) are dropped.

Control sequence Replacement
\i i
\j j
\oe/\OE oe
\ae/\AE ae
\aa a
\o o
\l l
\ss ss

This means that {\AE}lk is sorted as aelk, but {\AA}lk, {\"A}lk and Alk all sort as alk.

The sort order generated by this usually works well for English-speaking publications, but might not be acceptable for other languages.


There are projects like

  • BibTeX8, which can deal with 8bit encodings (probably not what you want nowadays with UTF-8 being the de facto standard), and
  • BibTeXu, which can deal with Unicode, but the project seems underdocumented and at least I did not manage to make BibTeXu sort by Swedish or Danish tradition.

If you want Unicode support and locale-based sorting, currently your best bet in the LaTeX world is to use biblatex with Biber. With biblatex and Biber you can use Unicode directly in the input and sorting follows Unicode rules.

In the following MWE the sort order follows Unicode collation rules for the selected document language. A specific sort order different from the main document language can be forced with the sortlocale option.

\documentclass[swedish]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[backend=biber, style=authoryear]{biblatex}

\begin{filecontents}{\jobname.bib} @book{aalk, author = {Anne Ålk}, title = {A Theory on Brontosauruses}, year = {1970}, publisher = {Monthy & Co.}, location = {London}, } @book{alk, author = {Anne Alk}, title = {A Theory on Brontosauruses}, year = {1971}, publisher = {Monthy & Co.}, location = {London}, } @book{aelk, author = {Anne Ælk}, title = {A Theory on Brontosauruses}, year = {1972}, publisher = {Monthy & Co.}, location = {London}, } @book{aedlk, author = {Anne Älk}, title = {A Theory on Brontosauruses}, year = {1973}, publisher = {Monthy & Co.}, location = {London}, } @book{blk, author = {Anne Blk}, title = {A Theory on Brontosauruses}, year = {1973}, publisher = {Monthy & Co.}, location = {London}, } @book{nlk, author = {Anne Nlk}, title = {A Theory on Brontosauruses}, year = {1975}, publisher = {Monthy & Co.}, location = {London}, } @book{olk, author = {Anne Olk}, title = {A Theory on Brontosauruses}, year = {1975}, publisher = {Monthy & Co.}, location = {London}, } @book{oelk, author = {Anne Ølk}, title = {A Theory on Brontosauruses}, year = {1975}, publisher = {Monthy & Co.}, location = {London}, } @book{oedlk, author = {Anne Ölk}, title = {A Theory on Brontosauruses}, year = {1975}, publisher = {Monthy & Co.}, location = {London}, } @book{plk, author = {Anne Plk}, title = {A Theory on Brontosauruses}, year = {1975}, publisher = {Monthy & Co.}, location = {London}, } \end{filecontents} \addbibresource{\jobname.bib}

\begin{document} \nocite{*}

\printbibliography \end{document}

moewe
  • 175,683
  • Unfortunately, with me it does not compile. I tried xelatex, lualatex, pdflatex and so on. – Frode Alfson Bjørdal May 21 '21 at 15:20
  • 1
    @Sapiens I'm afraid, you'll have to be a bit more precise what that means. Do you get errors? If so, what errors? Since the MWE uses biblatex with Biber you will have to run Biber instead of BibTeX (so LaTeX, Biber, LaTeX, LaTeX - where "LaTeX" can be your favourite flavour of LaTeX: pdfLaTeX, LuaLaTeX, XeLaTeX). If you are using an editor to run the compilation steps for you see https://tex.stackexchange.com/q/154751/35864. See https://tex.stackexchange.com/q/63852/35864 and https://tex.stackexchange.com/q/25701/35864 for background. – moewe May 21 '21 at 15:47
  • It compiled after all, given one morecompilation! Many thanks, also for the useful links! – Frode Alfson Bjørdal May 21 '21 at 16:45