LaTeX started as an ASCII thing for English speaking nerds. Only later did people start to use it all over the word, in many languages from Cezch to Hindi. We now have XeTeX and LuaLaTeX. But like the serpent Sesha in the Hindu mythology, some of that early ASCII universe remains, notably in the BibTex part of things.

BibTeX famously fails to sort bibliographic entries with diactrics correctly. If you let it do its thing, Čapek and Çalışkan will come at the very end, after Winston and Zaslavsky. We don’t want this.

Let us assume that you have stored your bibliography in biblio.bib and are using an edited copy of apa-good.bst , say biblio.bst, as your bibliographic style. Assume you have included both like this:

\bibliography{biblio.bib}
\bibliographystyle{biblio.bst}

What you need to do first, to solve your sorting problem, is to add a key field to your bibtex entries. Here an example (Note that my last entry has no key field: unlike Čapek and Çalışkan, the sorting order of the author Cammarata is straigforward in the ASCII world):

@article{caliskanParametricDesignUrbanism2017,
    key = {Caliskan},
    author = {Çalışkan, Olgu},
    title = {Parametric {Design} in {Urbanism}: {A} {Critical} {Reflection}},
    volume = {32},
    issn = {0269-7459},
    url = {https://doi.org/10.1080/02697459.2017.1378862},
    number = {4},
    journal = {Planning Practice \& Research},
    month = aug,
    year = {2017},
    pages = {417--443}
}

@book{capek_rur_1920,
    key={Capek},
    author = {{\v C}apek, Karel},
    address = {Praha},
    title = {{RUR}: {Rossum}'s {Universal} {Robots}. {Kolektivní} drama o vstupní komedii a třech aktech},
    publisher = {Aventinum},
    year = {1920}
}

@techreport{cammarataStrategiesCooperationDistributed1983,
    author = {Cammarata, Stephanie J. and McArthur, David J. and Steeb, Randall},
    title = {Strategies of {Cooperation} in {Distributed} {Problem} {Solving}},
    url = {https://www.rand.org/pubs/notes/N2031.html},
    language = {en},
    urldate = {2023-11-30},
    institution = {RAND Corporation},
    month = jan,
    year = {1983}
}Code language: PHP (php)

Ok. Now this is not all, unfortunately, but we are almost there. Somewhere in your biblio.bst file, you will find a fuction that looks like this:

FUNCTION {author.sort}
{ author empty$
   { key empty$
       { "to sort, need author or key in " cite$ * warning$
         ""
       }
       { key sortify }
     if$
   }
   { author sort.format.names }
 if$
}Code language: PHP (php)

What is does is that it considers the author’s name first for the sorting order, and only then the key. We want it to work the other way around! Therefore, you need to change this function to look like this:

FUNCTION {author.sort}
{
  key empty$
  {
    author empty$
    { "to sort, need author or key in " cite$ * warning$ }
    { author sort.format.names }
    if$
  }
  {
    key sortify
  }
  if$
}Code language: PHP (php)

You might want to make a similar adjustement in the author.editor.sort and the editor.sort functions. But than, that’s it.

Leave a comment

Your email address will not be published. Required fields are marked *