[Tex/LaTex] Automatically formatting punctuation using biblatex field format

biblatexpunctuation

Customising a biblatex style, I’d like to use ‘traditional’ typography where the format of punctuation follows that of the preceding text, for example

J. Organomet. Chem. 691. 13

with the full stop after ‘691’ in bold. I'm pretty sure that biblatex can do this automatically, but cannot find how to achieve it. From the documentation, \setpunctfont seems to be the function I want, but something like

\documentclass{article}
\usepackage[style=numeric]{biblatex}
\DeclareFieldFormat*{volume}{\mkbibbold{#1}\setpunctfont{\textbf}}
\bibliography{biblatex-examples}
\begin{document}
\nocite{*}
\printbibliography
\end{document}

fails (my example text is in ref. 3 in the resulting output). I’d rather not have to code the formatting in by hand, as it make maintenance awkward: how is this supposed to be done?

Best Answer

Re-reading the manual, I find what I'm after is the punctfont option:

\documentclass{article}
\usepackage[style=numeric,punctfont]{biblatex}
\DeclareFieldFormat*{volume}{\mkbibbold{#1}}
\renewbibmacro*{volume+number+eid}{%
  \printfield{volume}%
  \setunit*{\addcomma}%
  \printfield{number}%
  \setunit{\addcomma\space}%
  \printfield{eid}}
\bibliography{biblatex-examples}
\begin{document}
\nocite{*}
\printbibliography
\end{document}
Related Question