# pagetotal for articles - Biblatex

I would like to know how to cite an article indicating the total number of pages in the article. I added the field pagetotal to the .bib file and added the following code in my Preamble:

\DeclareFieldFormat{pagetotal}{\mkpagetotal[bookpagination]{#1~pp.}}


However, both with and without this code, or its variants with Pagetotal instead of pagetotal all fail. Understnadably, the key bookpagination may affect only the way this field is formatted for books. So, any pointer in the right direction would be very helpful.

The default biblatex styles as implemented by standard.bbx only print the pagetotal field for book-like entry types such as @book, @collection, @booklet, @thesis etc. Naturally, @article is not among those types, so by default the pagetotal is ignored there. Considering the fact that articles normally come with a pages field indicating the first and last page of the journal they can be found in, the pagetotal field does seem indeed superfluous, since (in general) its informational value can be obtained by a small computation on the pages field (some online journal do not have pages as such, in those cases it might be useful).

In order to include the pagetotal in the output - despite its redundancy, we have to include the command \printfield{pagetotal}% in the driver for @article. To do this we hook into the macro note+pages which is only used by @article

\renewbibmacro*{note+pages}{%
\printfield{note}%
\setunit{\bibpagespunct}%
\printfield{pages}%
\setunit{\bibpagespunct}% this ...
\printfield{pagetotal}% ... and this is new
\newunit}


We also make sure the field is properly formatted (as the standard bookpagination will not help here)

\DeclareFieldFormat[article]{pagetotal}{\mkpagetotal[pagination]{#1}}


MWE

\documentclass{article}
\usepackage[style=authoryear, backend=biber]{biblatex}
\usepackage{filecontents}
\usepackage{hyperref}
\begin{filecontents*}{\jobname.bib}
@article{BarPalNumEst,
author    = {Hilary C. Barth and Annie M. Paladino},
title     = {The development of numerical estimation},
subtitle  = {Evidence against a representational shift},
journal   = {Developmental Science},
volume    = {14},
number    = {1},
pages     = {125-135},
date      = {2011-01},
doi       = {10.1111/j.1467-7687.2010.00962.x},
gender    = {pf},
pagetotal = {11},
}
\end{filecontents*}

\DeclareFieldFormat[article]{pagetotal}{\mkpagetotal[pagination]{#1}}
\renewbibmacro*{note+pages}{%
\printfield{note}%
\setunit{\bibpagespunct}%
\printfield{pages}%
\setunit{\bibpagespunct}%
\printfield{pagetotal}%
\newunit}

\begin{document}
\nocite{*}
\printbibliography
\end{document}


This modification can be done for the other entry types currently lacking pagetotal as well. For @inbook, @incollection and friends, the modification could be done to chapter+pages. But here this modification seems especially unnecessary, since these entries should all contain proper physical page numbers in their pages field.

\renewbibmacro*{chapter+pages}{%
\printfield{chapter}%
\setunit{\bibpagespunct}%
\printfield{pages}%
\setunit{\bibpagespunct}%
\printfield{pagetotal}%
\newunit}