Search code examples
latexbiblatex

Capitalize and keep in italics the main title of an edited book in biblatex bibliography


@samcarter has very helpfully shown how to capitalize article, journal and book titles in biblatex bibliography (see here) and subtitles (see here).

However, new instances of bibliographic references where I need to capitalize the major words in a title keep cropping up. For example, I now have book chapters, so I use either the InBook or the InCollection types of bib entry; but the result is that the chapter title is capitalized, which is what I want, but the book title is not, which is not what I want.

Following @samcarter's advice, I have looked the code of the chicago-authordate.bbx file here.

From that I have gathered that I nee to add the following line \DeclareFieldFormat{booktitle}{\capitalisewords{#1}} to the code presented in the previous examples (which, again, are here) and (see here). ), as shown below:

\documentclass{scrbook}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

% Bibliography
\usepackage[backend=biber, style=chicago-authordate, hyperref=auto, bibencoding=inputenc, refsection=chapter, doi=false, url=false, isbn=false, eprint=false]{biblatex}
\usepackage[babel,autostyle=true]{csquotes}

% Capitalize article titles and journal names
\usepackage{mfirstuc} 
\MFUnocap{a}
\MFUnocap{for}
\MFUnocap{the}
\MFUnocap{of}
\MFUnocap{and}
\MFUnocap{con}
\MFUnocap{il}
\DeclareFieldFormat{jtnoformat}{\capitalisewords{#1}}
\DeclareFieldFormat{stnoformat}{\capitalisewords{#1}}
\DeclareFieldFormat{booktitle}{\capitalisewords{#1}}

\usepackage{xpatch}
\xpatchbibmacro{mag+news+title}{\printfield[noformat]{title}}{\printfield[jtnoformat]{title}}{}{}

\xpatchbibmacro{italtitle+stitle}{\printfield[tnoformat]{title}}{\printfield[jtnoformat]{title}}{}{}

\begin{filecontents*}[overwrite]{sample.bib}
@InBook{Goldthorpe1969,
  title =        "herbert spencer",
  date =         1969,
  author =       "John H. Goldthorpe",
  booktitle =    "The founding fathers of social science",
  editor =       "Timothy Raison",
  publisher =    "Penguin Books",
  location =     "Harmondsworth, UK"}

@InCollection{Turner1999,
  author =       "Bryan S. Turner and Ron Eyerman",
  title =        "The sociology of generations",
  date =         1999,
  booktitle =    "Classical sociology",
  publisher =    "Sage",
  location =     "London",
  chapter =      14,
  pages =        "246--261"}
\end{filecontents*}

\addbibresource{sample.bib}

\begin{document}

\nocite{Goldthorpe1969}.

\nocite{Turner1999}.

\printbibliography

\end{document}

The output shows that the main title of the book is capitalized but not in italics as it was originally (i.e., without the line \DeclareFieldFormat{booktitle}{\capitalisewords{#1}}, in which case it is in italics but not capitalized).

output

I guess I have chosen the wrong field with booktitle. Is this the case? How's the correct way to do this?

Thank you very much!! Daniel


Solution

  • The original field format for booktitle is defined in chicago-authordate.cbx, line 100 as

    \DeclareFieldFormat{booktitle}{\mkbibemph{#1}}
    

    You can combine this with capitalisation like this:

    \documentclass{scrbook}
    
    \usepackage[utf8]{inputenc}
    \usepackage[T1]{fontenc}
    
    % Bibliography
    \usepackage[backend=biber, style=chicago-authordate, hyperref=auto, bibencoding=inputenc, refsection=chapter, doi=false, url=false, isbn=false, eprint=false]{biblatex}
    \usepackage[babel,autostyle=true]{csquotes}
    
    % Capitalize article titles and journal names
    \usepackage{mfirstuc} 
    \MFUnocap{a}
    \MFUnocap{for}
    \MFUnocap{the}
    \MFUnocap{of}
    \MFUnocap{and}
    \MFUnocap{con}
    \MFUnocap{il}
    \DeclareFieldFormat{jtnoformat}{\capitalisewords{#1}}
    \DeclareFieldFormat{stnoformat}{\capitalisewords{#1}}
    \DeclareFieldFormat{booktitle}{\mkbibemph{\capitalisewords{#1}}}
    
    \usepackage{xpatch}
    \xpatchbibmacro{mag+news+title}{\printfield[noformat]{title}}{\printfield[jtnoformat]{title}}{}{}
    
    \xpatchbibmacro{italtitle+stitle}{\printfield[tnoformat]{title}}{\printfield[jtnoformat]{title}}{}{}
    
    \begin{filecontents*}[overwrite]{sample.bib}
    @InBook{Goldthorpe1969,
      title =        "herbert spencer",
      date =         1969,
      author =       "John H. Goldthorpe",
      booktitle =    "The founding fathers of social science",
      editor =       "Timothy Raison",
      publisher =    "Penguin Books",
      location =     "Harmondsworth, UK"}
    
    @InCollection{Turner1999,
      author =       "Bryan S. Turner and Ron Eyerman",
      title =        "The sociology of generations",
      date =         1999,
      booktitle =    "Classical sociology",
      publisher =    "Sage",
      location =     "London",
      chapter =      14,
      pages =        "246--261"}
    \end{filecontents*}
    
    \addbibresource{sample.bib}
    
    \begin{document}
    
    \nocite{Goldthorpe1969}.
    
    \nocite{Turner1999}.
    
    \printbibliography
    
    \end{document}
    \documentclass{scrbook}
    
    \usepackage[utf8]{inputenc}
    \usepackage[T1]{fontenc}
    
    % Bibliography
    \usepackage[backend=biber, style=chicago-authordate, hyperref=auto, bibencoding=inputenc, refsection=chapter, doi=false, url=false, isbn=false, eprint=false]{biblatex}
    \usepackage[babel,autostyle=true]{csquotes}
    
    % Capitalize article titles and journal names
    \usepackage{mfirstuc} 
    \MFUnocap{a}
    \MFUnocap{for}
    \MFUnocap{the}
    \MFUnocap{of}
    \MFUnocap{and}
    \MFUnocap{con}
    \MFUnocap{il}
    \DeclareFieldFormat{jtnoformat}{\capitalisewords{#1}}
    \DeclareFieldFormat{stnoformat}{\capitalisewords{#1}}
    \DeclareFieldFormat{booktitle}{\capitalisewords{#1}}
    
    \usepackage{xpatch}
    \xpatchbibmacro{mag+news+title}{\printfield[noformat]{title}}{\printfield[jtnoformat]{title}}{}{}
    
    \xpatchbibmacro{italtitle+stitle}{\printfield[tnoformat]{title}}{\printfield[jtnoformat]{title}}{}{}
    
    \begin{filecontents*}[overwrite]{sample.bib}
    @InBook{Goldthorpe1969,
      title =        "herbert spencer",
      date =         1969,
      author =       "John H. Goldthorpe",
      booktitle =    "The founding fathers of social science",
      editor =       "Timothy Raison",
      publisher =    "Penguin Books",
      location =     "Harmondsworth, UK"}
    
    @InCollection{Turner1999,
      author =       "Bryan S. Turner and Ron Eyerman",
      title =        "The sociology of generations",
      date =         1999,
      booktitle =    "Classical sociology",
      publisher =    "Sage",
      location =     "London",
      chapter =      14,
      pages =        "246--261"}
    \end{filecontents*}
    
    \addbibresource{sample.bib}
    
    \begin{document}
    
    \nocite{Goldthorpe1969}.
    
    \nocite{Turner1999}.
    
    \printbibliography
    
    \end{document}
    

    enter image description here