1

I have a .bib file with items as shown below:

    @Article{     10.1093/imaiai/iat004,
  author    = {Javanmard, Adel and Montanari, Andrea},
  journal   = {Information and Inference: A Journal of the IMA},
  volume    = {2},
  number    = {2},
  pages     = {115-144},
  year      = {2013},
  month     = {12},
  issn      = {2049-8764},
  doi       = {10.1093/imaiai/iat004},
  url       = {https://doi.org/10.1093/imaiai/iat004},
  eprint    = {https://academic.oup.com/imaiai/article-pdf/2/2/115/1958160/iat004.pdf},
  title     = {\href{/https://doi.org/10.1093/imaiai/iat004}{State
          evolution for general approximate message passing
          algorithms with applications to spatial coupling}}
}

@Article{ 8866740, author = {Takeuchi, Keigo}, journal = {IEEE Transactions on Information Theory}, year = {2020}, volume = {66}, number = {1}, pages = {368-386}, doi = {10.1109/TIT.2019.2947058}, title = {\href{https://doi.org/10.1109/TIT.2019.2947058}{Rigorous Dynamics of Expectation-Propagation-Based Signal Recovery from Unitarily Invariant Measurements}} }

and, using:

  \usepackage[backend=biber,
              style=numeric-comp,
              maxbibnames=6,
              sorting=none,
              eprint=false,
              url=false,
              doi=false,
              hyperref=true,
              firstinits=true,
              date=year,
              natbib]{biblatex} 

I obtain the following output: output of bibliography

where the titles of the references appear exactly as in the .bib file. Why is this the default behaviour? Notice that upper case letters are not enclosed by curly braces in the .bib file. How to make the titles of all references consistent (e.g. using sentence case or using first letter capitalisation)? Changing the backend from biber to bibtex did not produce a different behaviour. Unfortunately, I could not find clear information online and I am not sure how to proceed.

EDIT: After moewe's suggestion (thanks a lot!), my preamble reads:

  \usepackage[autostyle]{csquotes}
  \usepackage[backend=biber,
          style=ext-numeric-comp,
          maxbibnames=6,
          %block=ragged,
          sorting=none,
          eprint=false,
          url=false,
          doi=false,
          hyperref=true,
          firstinits=true,
          date=year,
          natbib]{biblatex} 
 \addbibresource{\jobname.bib}% bibliographic data base(s)
    \DeclareFieldFormat[article,inbook,incollection,inproceedings,patent,thesis,unpublished]{titlecase:title}{\MakeSentenceCase*{#1}}

\newbibmacro{string+doiurlisbn}[1]{% \iffieldundef{doi}{% \iffieldundef{url}{% \iffieldundef{isbn}{% \iffieldundef{issn}{% #1% }{% \href{http://books.google.com/books?vid=ISSN\thefield{issn}}{#1}% }% }{% \href{http://books.google.com/books?vid=ISBN\thefield{isbn}}{#1}% }% }{% \href{\thefield{url}}{#1}% }% }{% \href{http://doi.org/\thefield{doi}}{#1}% }% }

\DeclareFieldFormat{title}{\usebibmacro{string+doiurlisbn}{\mkbibemph{#1}}} \DeclareFieldFormat[article,incollection,inbook,inproceedings]{title}{% \usebibmacro{string+doiurlisbn}{\mkbibquote{#1}}}

and my BIB file has references in the format:

@Article{     8866740,
  author    = {Takeuchi, Keigo},
  journal   = {IEEE Transactions on Information Theory},
  mytit = {Rigorous Dynamics of Expectation-Propagation-Based Signal
      Recovery from Unitarily Invariant Measurements},
  year      = {2020},
  volume    = {66},
  number    = {1},
  pages     = {368-386},
  doi       = {10.1109/TIT.2019.2947058},
  title = {Rigorous
      Dynamics of Expectation-Propagation-Based Signal Recovery
      from Unitarily Invariant Measurements}
}

The title links properly, however conversion to sentence case still does not seem to work and I don't understand why, as now the double curly braces are no longer there: Output after modification suggested by moewe

There might be some setting in the template I am using (toptesi with option tipotesi=scudo) that is in contrast with the macro suggested by moewe (concerning the language, I can see it is set to english by default, so that should not be a problem).

EDIT 2:

Using the unstarred version of the command:

\DeclareFieldFormat
 [article,inbook,incollection,inproceedings,patent,thesis,unpublished]{titlecase:title}{\MakeSentenceCase{#1}}

gives the desired output (I don't know why):

Output with unstarred command

PeterP
  • 11

1 Answers1

2

There are two issues at work here. But before we start let me remark that the code shown so far added into a minimal example document does not reproduce the output shown in the question, so take this with a shovel of salt.

  1. The biblatex standard styles don't apply sentence case to titles by default.

    So if you want sentence case, you need to ask for it. Classically this is done via

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

    This approach, however, has the disadvantage that it applies sentence casing to all title-like fields. This is often not what people want (because journals and usually also book titles should retain their capitalisation).

    If you want a more fine-grained approach you can use the styles of my biblatex-ext bundle, where you could for example use

    \DeclareFieldFormat
      [article,inbook,incollection,inproceedings,patent,thesis,unpublished]
      {titlecase:title}{\MakeSentenceCase*{#1}}
    

    to apply sentence casing only to titles that are usually shown in quotation marks in the bibnliography.

  2. In your example, however, this is not enough. The braces in \href{<link>}{<title text>} "protect" the <title text> from case changing by the "usual" case BibTeX case changing rules that biblatex replicates. See BibTeX loses capitals when creating .bbl file, Implementation of "Title Case" in Bibtex, What is the proper casing to use when storing titles in the bibliography database?.

    I believe the correct way to address this is to get rid of the \href in title fields and let biblatex link the title automatically. You could use code like biblatex: make title hyperlink to DOIs, URL or ISBN to make that work.

In total you'd get

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

\usepackage[backend=biber, style=ext-numeric-comp, sorting=none, maxbibnames=6, firstinits=true, date=year, eprint=false, url=false, doi=false, natbib, ]{biblatex} \usepackage[colorlinks]{hyperref}

\DeclareFieldFormat [article,inbook,incollection,inproceedings,patent,thesis,unpublished] {titlecase:title}{\MakeSentenceCase*{#1}}

\newbibmacro{string+doiurlisbn}[1]{% \iffieldundef{doi}{% \iffieldundef{url}{% \iffieldundef{isbn}{% \iffieldundef{issn}{% #1% }{% \href{http://books.google.com/books?vid=ISSN\thefield{issn}}{#1}% }% }{% \href{http://books.google.com/books?vid=ISBN\thefield{isbn}}{#1}% }% }{% \href{\thefield{url}}{#1}% }% }{% \href{http://doi.org/\thefield{doi}}{#1}% }% }

\DeclareFieldFormat{title}{\usebibmacro{string+doiurlisbn}{\mkbibemph{#1}}} \DeclareFieldFormat[article,incollection]{title}{% \usebibmacro{string+doiurlisbn}{\mkbibquote{#1}}}

\begin{filecontents}{\jobname.bib} @article{10.1093/imaiai/iat004, author = {Javanmard, Adel and Montanari, Andrea}, journal = {Information and Inference: A Journal of the IMA}, volume = {2}, number = {2}, pages = {115-144}, year = {2013}, month = {12}, issn = {2049-8764}, doi = {10.1093/imaiai/iat004}, url = {https://doi.org/10.1093/imaiai/iat004}, eprint = {https://academic.oup.com/imaiai/article-pdf/2/2/115/1958160/iat004.pdf}, title = {State evolution for general approximate message passing algorithms with applications to spatial coupling}, } @article{8866740, author = {Takeuchi, Keigo}, journal = {IEEE Transactions on Information Theory}, year = {2020}, volume = {66}, number = {1}, pages = {368-386}, doi = {10.1109/TIT.2019.2947058}, title = {Rigorous Dynamics of Expectation-Propagation-Based Signal Recovery from Unitarily Invariant Measurements}, }

\end{filecontents} \addbibresource{\jobname.bib} \addbibresource{biblatex-examples.bib}

\begin{document} Lorem \autocite{sigfridsson,10.1093/imaiai/iat004,8866740,springer}

\printbibliography \end{document}

"K. Takeuchi. ‘Rigorous dynamics of expectation-propagation-based signal recovery from unitarily invariant measurements’. In: IEEE Transactions on Information Theory 66.1 (2020), pp. 368–386." with linked title.

moewe
  • 175,683
  • Thanks for your detailed answer, I now understand a bit more what is going on. However, I tried copying your solution and edited the BIB file as you suggested, but still cannot obtain titles converted to sentence case. I can reproduce your solution in a separate file though, so I'm trying to see what could be going wrong here. The option british that you use in the document class seems to be important in order to reproduce your result. – PeterP Jul 10 '21 at 19:10
  • I tried \DeclareFieldFormat [article,inbook,incollection,inproceedings,patent,thesis,unpublished] {titlecase:title}{\MakeSentenceCase{#1}} instead of \DeclareFieldFormat [article,inbook,incollection,inproceedings,patent,thesis,unpublished] {titlecase:title}{\MakeSentenceCase*{#1}} and it now works, I don't know why the starred version of the command is ignored. – PeterP Jul 10 '21 at 20:22
  • @PeterP The difference between the starred and the unstarred version of \MakeSentenceCase is that the unstarred version will always apply sentence casing, while the starred version will only do so for languages where it makes sense (as declared with \DeclareCaseLangs). In my example the document is in (British) English, where sentence casing makes sense, so it is applied. If you document is in say German, where there is no concept of sentence case, it is not applied. ... – moewe Jul 10 '21 at 20:56
  • ... You may want to tell biblatex about the language of your .bib entries with language = {english}, in that case the main document language will not matter. – moewe Jul 10 '21 at 20:57
  • Wouldn't that display "eng." at each bibliography entry in the PDF file though? The template sets "english" as the document language automatically (there's an option \AfterEndPreamble{\English} in the .sty file of the template I'm using: this sets English as default language). Also putting english in the options of the document class did not change things, there must be something I am missing (possibly related to the way the template was set up) – PeterP Jul 10 '21 at 21:15
  • @PeterP Oh yeah, sorry. That should have been langid and not language (as in langid = {english},). langid is a purely internal marker that can influence the sentence casing code and hyphenation. language is there to print the language. – moewe Jul 11 '21 at 06:52
  • @PeterP I don't really know about toptesi, but a bit of playing around suggests that with tipotesi=scudo, the class already hard-codes a biblatex style. You need to load the class with the option mybibliostyle to take full control over the bibliography. (Indeed when I did not set the option, I would get an error.) https://gist.github.com/moewew/5d0adc459672669c223e91469ef54667 compiles without error for me and generates the output I expect. – moewe Jul 11 '21 at 08:04
  • Yes, you are perfectly right, I omitted this in my post to avoid flooding it with too many details, but I did use the option mybibliostyle in my document. Thanks so much for your answer and comments (and also for having a look at the class toptesi, you really went above and beyond), they have been extremely helpful to get me unstuck. I cannot thank you enough for that! – PeterP Jul 11 '21 at 09:25
  • And thank for the clarification concerning langid, I wasn't aware of that option! – PeterP Jul 11 '21 at 09:26