3

I am using biblatex and currently my journal titles seem to have no standard capitalization structure. For example, I have a bib file with

@article{makarov2021barrier,
  title={Barrier Crossing Dynamics from Single-Molecule Measurements},
  author={Makarov, Dmitrii E},
  journal={The Journal of Physical Chemistry B},
  volume={125},
  number={10},
  pages={2467--2476},
  year={2021},
  publisher={ACS Publications}
}
@article{clegg1995fluorescence,
  title={Fluorescence resonance energy transfer},
  author={Clegg, Robert M},
  journal={Current opinion in biotechnology},
  volume={6},
  number={1},
  pages={103--110},
  year={1995},
  publisher={Elsevier}
}
@article{dill2012protein,
  title={The protein-folding problem, 50 years on},
  author={Dill, Ken A and MacCallum, Justin L},
  journal={science},
  volume={338},
  number={6110},
  pages={1042--1046},
  year={2012},
  publisher={American Association for the Advancement of Science}
}

which gives this bibliography

D. E. Makarov. “Barrier Crossing Dynamics from Single-Molecule Measurements”. In: The Journal of Physical Chemistry B 125.10 (2021), pp. 2467–2476
R. M. Clegg. “Fluorescence resonance energy transfer”. In: Current opinion in biotechnology 6.1 (1995), pp. 103–110.
K. A. Dill and J. L. MacCallum. “The protein-folding problem, 50 years on”. In: science 338.6110 (2012), pp. 1042–1046

Notice the three different capitalization formats (important words, first word, no capitalization) in one bibliography! It seems like the capitalization is taken directly from the bib file without any modifications.

Is there a way to uniformize the journal capitalizations in biblatex? I see a couple stack exchange posts that do this for bibtex, but so far none for biblatex. Ideally I would like the "important words" convention above, but I would settle for any convention that is at least uniform.

Shep Bryan
  • 209
  • 1
  • 6
  • 2
    It depends on which standard you are following (supposed to be following), if this standard is correctly programmed into bibtex or biblatex and if your bib file is correctly set, for example, writing {a} force the small "a" while {A} forces the capital "A". We can't much without knowing which standard you are using and which result should be produced. – FHZ Aug 24 '22 at 23:35
  • 1
    The capitalization is no doubt following the style of the journal in which each was published. (And I suggest that the journal name "science" should probably have an initial cap.) The comments by @FHZ are relevant here, but even with bibtex, it's sometimes necessary to edit the .bib file to handle situations not easily handled by most algorithms. – barbara beeton Aug 25 '22 at 00:51
  • 1
    "It seems like the capitalization is taken directly from the bib file without any modifications." I'll never not argue that this is as it should be, at least by default. I have on more than one occasion had well-meaning software butcher my non-English bibliography items, uppercasing seemingly random words willy-nilly. There are numerous standards, ranging from none (most languages except English) to all words, and multiple shades inbetween: it really is safest if you simply format the data the way you want to look it in your .bib file. – Ingmar Aug 25 '22 at 06:34
  • The issue with styles that uniformize the capitalization is that can always fails with some words, for instance, converting "NATO" in "nato", or "Nato" except if you protect the term with curly braces (e.g., {NATO} ). JabRef can change the source title with a click to lowercase, uppercase, capitalize, sentence case or title case. So, at the end of day, uniformize yourself some titles is not more hard that protect any term that should remain as is in all the titles. – Fran Sep 05 '22 at 21:34

2 Answers2

8

biblatex (like BibTeX) only has functions to reliably turn a string into sentence case (first word capitalised, remainder lower case). There are functions to capitalise words, but there is no built-in function to generate real Title Case, where a certain class of words should not be capitalised.

That means that you should input all titles in your .bib file in Title Case ("important words capitalised") and can let biblatex/BibTeX turn titles into sentence case on demand. Note that you still need to "protect" portions that must not be lowercased (names, abbreviations, maths, ...) with curly braces (or in newer biblatex with \NoCaseChange{...}). (See also What is the proper casing to use when storing titles in the bibliography database?, Implementation of "Title Case" in Bibtex, BibTeX loses capitals when creating .bbl file)

You might be able to find some attempts for LaTeX code (possibly compatible with biblatex) that tries to automatically Title Case your titles, but I don't think I have yet seen a solution that I would trust. (There is How to get BibLaTeX-chicago use title case capitalization? by Audrey, who definitely knows biblatex, but still ...)

If you do not want to go through your .bib file manually, you might have a better chance finding some external tool to normalise your .bib file.

moewe
  • 175,683
0

What I should have stressed in the question was that I am more interested in uniformizing my bibliography that I am in making the journal titles in standard titlecase. Since it seems that a true titlecase would be difficult to do, I came up with an alternative: using uppercase. I figure that no one can complain about capitalizing the wrong letter if all the letters are capitalized.

To force all journal entries, book titles, and publishers into uppercase, I added this bit of code to my preamble:

\DeclareFieldFormat{uppercase}{\MakeUppercase{#1}}
\DeclareListFormat{uppercase}{\MakeUppercase{#1}}
\renewbibmacro*{journal}{%
  \ifboolexpr{
    test {\iffieldundef{journaltitle}}
    and
    test {\iffieldundef{journalsubtitle}}
  }
    {}
    {\printtext[journaltitle]{%
       \printfield[uppercase]{journaltitle}%
       \setunit{\subtitlepunct}%
       \printfield[uppercase]{journalsubtitle}}}}
\renewbibmacro*{booktitle}{%
  \ifboolexpr{
    test {\iffieldundef{booktitle}}
  }
    {}
    {\printtext[booktitle]{%
       \printfield[uppercase]{booktitle}}}}
\renewbibmacro*{publisher+location+date}{%
  \printlist[uppercase]{publisher}%
  \iflistundef{location}
    {\setunit*{\addcomma\space}}
    {\setunit*{\addcolon\space}}%
  \printlist{location}%
  \setunit*{\addcomma\space}%
  \usebibmacro{date}%
  \newunit}
\addbibresource{main.bib}

The new bibliography looks like:

Ken A Dill and Justin L MacCallum. “The protein-folding problem, 50 years on”. In: SCIENCE 338.6110 (2012), pp. 1042–1046
Robert M Clegg. “Fluorescence resonance energy transfer”. In: CURRENT OPINION IN BIOTECHNOLOGY 6.1 (1995), pp. 103–110
Dmitrii E Makarov. “Barrier Crossing Dynamics from Single-Molecule Measurements”. In: THE JOURNAL OF PHYSICAL CHEMISTRY B 125.10 (2021), pp. 2467–2476

which may not be the prettiest, but at least it is uniform and I dont have to rewrite my .bib file.

The LaTeX code was inspired by a solution I found on github. If I had more time, I think that this solution could possibly be expanded to create a true automatic titlecase algorithm, but until then I think that upper case is good enough for me.

Shep Bryan
  • 209
  • 1
  • 6