3

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) ?

  • Does \MakeSentenceCase* with an appropriate language selected help? – Andrew Swann Oct 20 '14 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 '14 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 '14 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 '14 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 '14 at 4:00
2

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}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.