Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
    
From reading the documentation it appears that \mkbibbold should do that automatically. Perhaps this is a bug? –  Alan Munn Feb 19 '11 at 23:33
    
@Alan: No, a bug in my reading of the manual :-) –  Joseph Wright Feb 20 '11 at 8:41
    
Except that I don't think it actually works. Removing the \setpunctfont{\textbf} doesn't change anything in your example, yet \mkbibbold should make the punctuation following the volume number bold. –  Alan Munn Feb 20 '11 at 12:55
    
Now reading your answer, you weren't the only one who had a bug in reading the manual. :-) –  Alan Munn Feb 20 '11 at 12:59
    
@Alan: I've updated the answer to use a comma: try with and without punctfont to see the effect. –  Joseph Wright Feb 20 '11 at 13:02
add comment

1 Answer

up vote 6 down vote accepted

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}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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