5

I'm trying to use biblatex and biber to emulate, as best as possible, the default capitalization of bibtex's plain style. (I'm switching to biber/biblatex because of the better formatting options and unrelated advantages).

Consider the following bibtex entry:

@ARTICLE{some-ref,
  AUTHOR      = "John Doe",
  TITLE       = "How to Count: Easy as One, Two, Three",
  JOURNAL     = "Letters on Numbers",
  VOLUME      = 15,
  MONTH       = jan,
  YEAR        = 2000,
  PAGES       = "123-456"
}

In bibtex plain style, we'd get what I want, which is title capitalization like this (note capital after colon):

Doe, John. "How to count: Easy as one, two, three." Letters on Numbers. 2000.

In biber, we get the exact title capitalization we typed:

Doe, John. "How to Count: Easy as One, Two, Three." Letters on Numbers. 2000.

Or, using the \MakeSentenceCase macro, we can get:

Doe, John. "How to count: easy as one, two, three." Letters on Numbers. 2000.

I can already decide which titles to apply sentence case to (using Sentence case for titles in biblatex), but how can I capitalize the letter immediately after the colon using a similar macro to MakeSentenceCase? Can I make a custom macro to call? Something like this (Capitalize the first letter of each word in biblatex) ?

6
  • Does \MakeSentenceCase* with an appropriate language selected help? Oct 20, 2014 at 7:22
  • Not that I can tell - I think (but not sure) this option is for dealing with non-ASCII characters to do the upper case conversion correctly.
    – Joe
    Oct 20, 2014 at 14:57
  • It seems that \MakeSentenceCase has quite a rough idea of what constitutes "sentence casing" it just turns the first letter of the string passed to it into uppercase lowercasing all the other letters (leaving out the ones protected by curly braces). Since your example (arguably) contains two sentences, there would need to be a much more complex macro. In How to get BibLaTeX-chicago use title case capitalization?, Audrey gives a way to deal with title casing (probably even more complicated) that also deals with colons (the last map command).
    – moewe
    Oct 20, 2014 at 14:57
  • I'm hesitant to use the sourcemap option that Audrey's solution uses: if understand it correctly it modifies all titles (including, for example, journal titles), whereas I'd like to be more selective in the use (just for articles). I think a latex macro is the way to go, but I'm not sure how.
    – Joe
    Oct 20, 2014 at 20:48
  • Well, you can restrict mapping steps to certain entry types with \pertype{<entrytype>}. A macro might be more desirable, but I'm sure it will be quite complicated. In case you're interested in a macro, I'd suggest you reformulate your question - or ask an entirely new one (the question would only need to mention biblatex in passing as the main part is the macro).
    – moewe
    Oct 21, 2014 at 4:00

1 Answer 1

3

This can be achieved using some code from biblatex-ieee:

\begin{filecontents*}{\jobname.bib}
@ARTICLE{some-ref,
  AUTHOR      = "John Doe",
  TITLE       = "How to Count: Easy as One, Two, Three",
  JOURNAL     = "Letters on Numbers",
  VOLUME      = 15,
  MONTH       = jan,
  YEAR        = 2000,
  PAGES       = "123-456"
}
\end{filecontents*}
\documentclass{article}
\usepackage[style = numeric]{biblatex}
\addbibresource{\jobname.bib}
\makeatletter
\newcommand*\bbx@colon@search[2]{%
  \bbx@colon@search@aux#1#2: \stop
}
\long\def\bbx@colon@search@aux#1#2: #3\stop{%
  #1{#2}%
  \ifblank{#3}
    {}
    {%
      : %
      \bbx@colon@search@aux#1#3\stop
    }%
}
\DeclareFieldFormat{titlecase}{\bbx@colon@search\MakeSentenceCase{#1}}
\makeatother
\begin{document}
\nocite{*}
\printbibliography
\end{document}
1
  • This doesn't work, or at least has an unwanted side-effect, when using Biber 2.15 and and Biblatex 3.15a. In particular, it causes the journal title to be set in sentence case rather than in title case.
    – Psychonaut
    Sep 4, 2020 at 18:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .