46

My understanding is that bibtex lets the citation style handle capitalization of titles, which is what I would expect from an automated citation tool. Do biblatex and Biber also do this? The document I am working on with these tools seems to be preserving the capitalization in the bib database, which is NOT what I want, and I haven't found any clear references that explain what the expected behavior is.

lockstep
  • 250,273
Jonathan
  • 463
  • 1
    How are you calling biblatex? – egreg Jun 09 '11 at 17:18
  • This is really frustrating. I have hundrets of bib entries and I want title case. It seems like Biblatex only supports either "no styling" (which means inconsistent styling or hours of manual work) or sentence case. Sentence case also converts conference names and everything into sentence case, which I don't want (would need hours of manual escaping)... – stefanbschneider Feb 04 '21 at 14:22

2 Answers2

39

It might depend on the style and language(s) you are using, but generally titles are printed in the field format titlecase. By default, titlecase has no effect on casing; from biblatex.def:

\DeclareFieldFormat{titlecase}{#1}

If you want all titles in sentence case (i.e. first letter capitalized, the rest in lowercase) you can redefine this format:

\DeclareFieldFormat{titlecase}{\MakeSentenceCase*{#1}}

The \MakeSentenceCase* command converts its argument to sentence case, except for text enclosed in braces ({}). It also generally has no effect on control sequences. However Latin characters in math ($...$ or \(...\)) are affected and control sequences in $...$ generate parsing errors. To avoid these issues all math can be wrapped in braces. Wrapping a single character in braces affects its kerning, so the biblatex manual recommends wrapping braces around entire words. For example:

title = {An Introduction to {LaTeX}}

instead of:

title = {An Introduction to {L}a{T}e{X}}

You can make casing depend on the entry type(s) by adding an optional argument - for example:

\DeclareFieldFormat[article]{titlecase}{\MakeSentenceCase*{#1}}

One catch here is that the titlecase format is rolled out to all titles within an entry type. So in the above example both the title and journaltitle fields would be printed in sentence case. This question addresses how to make title case depend on both the entry and field types.

\DeclareCaseLangs specifies all the languages that the starred version \MakeSentenceCase* converts to sentence case. By default we have:

\DeclareCaseLangs{%     
  american,british,canadian,english,australian,newzealand,USenglish,UKenglish}

For further details, see biblatex documentation on the above commands and release notes under the heading "Sentence case vs. title case".

edit by @moewe: The biblatex documentation recommends the starred version \MakeSentenceCase* over the unstarred \MakeSentenceCase.

The starred version \MakeSentenceCase* only applies sentence casing of the language of the entry (as given in the langid field or if it is empty, the surrounding language) is in the list of languages where sentence casing makes sense (as defined by \DeclareCaseLangs).

\MakeSentenceCase applies sentence casing regardless of the language settings and may result in unwanted capitalisation changes in non-English contexts (German for example has no notion of Title Case vs sentence case and English sentence casing as implemented in \MakeSentenceCase would lead violate the rules of orthography).

Audrey
  • 28,881
  • Ah, so biblatex automates sentence casing as an override of what is otherwise assumed to be title casing. Clever. Thanks. – Jonathan Jun 13 '11 at 06:09
  • @Jonathan That's right. I assume the underlying reasoning is that a decent macro to convert a string to title case would be quite tedious to construct. – Audrey Jun 13 '11 at 16:53
  • 1
    @Audrey I'm seeing the same thing that Jonathan was seeing ("...document I am working on with these tools seems to be preserving the capitalization in the bib database, which is NOT what I want..."), and I'm sorry to say that I don't quite understand your answer as well as he seems to. I'm finding that whatever text I enter in the title field is typeset exactly as entered in the .bib database (even first character) which seems to differ from what you're saying with sentence case and titlecase above. Shouldn't biblatex (called with \printbibliography) just typeset the bibliography correctly? – TeXnewbie Nov 07 '12 at 22:09
  • 1
    @TeXnewbie The default titlecase format doesn't change casing. If you want all titles in sentence case, just add \DeclareFieldFormat{titlecase}{\MakeSentenceCase{#1}} to your preamble. – Audrey Nov 08 '12 at 03:00
  • 1
    Thanks @Audrey that helped me understand your answer better. So there is the default (do nothing to change case), and there is SentenceCase (Only first letter of first word of title capitalized), but what about title case capitalization (Each Word of Title Capitalized Except for Words Like 'of' 'and' 'for' et. al.)? I looked at documentation and release notes for biblatex as you suggested ("Sentence case vs. title case"), but I see nothing describing how to get biblatex to typeset a title (eg. for a book) using Title Case. Am I missing something? Is that determined by the documentclass? – TeXnewbie Nov 08 '12 at 20:38
  • 1
    @TeXnewbie That is referred to as "title case". biblatex doesn't offer a title case macro. If you use title case, you can apply it throughout your bib file and use \MakeSentenceCase whenever needed. Macros to apply title case are available, though biber's sourcemap feature might be better for this job. – Audrey Nov 09 '12 at 00:48
  • You'd expect that \DeclareFieldFormat{titlecase}{\MakeSentenceCase{#1}} could be replaced by \DeclareFieldFormat{titlecase}{\MakeTitleCase{#1}} to get a title case style, but no. But \DeclareFieldFormat{apacase}{#1} does the trick. Reasons unknown. – PatrickT Jul 03 '18 at 13:13
  • 1
    @PatrickT biblatex only has a macro to convert text to sentence case. There is no command to convert anything to Title Case. The implicit assumption is that people store titles in Title Case and that a style can convert titles to sentence case if need be. (BibTeX works similarly.) Hence there is no \MakeTitleCase and \DeclareFieldFormat{titlecase}{#1} simply disables sentence casing. apacase instead of titlecase is a design decision of biblatex-apa. All standard styles use titlecase, but biblatex-apa has more complex rules and uses apacase. – moewe Apr 01 '19 at 10:06
  • So if I have hundreds o bib entries that are not capitalized consistently, the only way to get consistent capitalization is using sentence case? But this also applies sentence case to conference names, eg, Ieee conference on xy instead of IEEE Conference on XY, which looks aweful... Is there no good solution here? – stefanbschneider Feb 04 '21 at 14:24
8

If you are using biblatex with style=apa and want to keep the casing of your bib-file you need to use

\DeclareFieldFormat{apacase}{#1}

The default is to capitalize only the first letter.

BenjaminH
  • 688