# (Biblatex) How to suppress page field in footcite if postnote is present?

For my thesis, I am using the biblatex style oxnotes, which is a style fairly similar to verbose and uses footnotes.

If I use the \footcite command with a postnote specified, for an entry with page numbers (e.g. a book chapter), the footnote will print both the page number and the postnote. I would like to tell biblatex to suppress the page number in a footnote when a postnote is present.

Currently, a \footcite like this:

\footcite[1-5]{barkan2003}


...will produce the footnote

Barkan, 'Title', Journal Title (2003), 1-20 at 1-5.

I would like to suppress the pages (i.e. "1-20") in \footcite commands where a postnote is specified, such that it reads

Barkan, 'Title', Journal Title (2003), 1-5.

I have tried the following command, but it suppresses the pages field in both the citations and bibliography.

\DeclareFieldFormat{pages}{%
\iffieldundef{pages}{}{\iffieldundef{postnote}{}{\clearfield{pages}}}}


Is there a way to tell biblatex to suppress the pages field only in \footcite commands, and not in the bibliography?

Any help on a solution would be greatly appreciated!

\documentclass{article}
\usepackage[style=oxnotes]{biblatex}
\RequireBibliographyStyle{oxref}

\begin{filecontents*}{document.bib}
@article{barkan2003,
title = {Title},
journaltitle = {Journal Title},
date = {2003},
pages = {1-20},
author = {Barkan},
}
\end{filecontents*}

\begin{document}
Text.\footcite[1-5]{barkan2003}
\end{document}


biblatex-oxref's oxnotes citation style is based on verbose.cbx and supports all of its options. In particular you can use the option citepages, which is documented in the verbose style example. (In earlier versions of biblatex-oxref some aspects of citepages were a bit counter-intuitive, but that was improved in version 1.1, see https://github.com/alex-ball/biblatex-oxref/issues/8.)

• The oxnotes-default citepages=separate gives you

Wolfgang A. Herrmann et al., “A carbocyclic carbene as an efficient catalyst ligand for C–C coupling reactions”, Angew. Chem. Int. Ed. 45/23 (2006), 3859–62 at 3860–1.

• With citepages=omit the pages field is automatically omitted if the postnote is numeric

Wolfgang A. Herrmann et al., “A carbocyclic carbene as an efficient catalyst ligand for C–C coupling reactions”, Angew. Chem. Int. Ed. 45/23 (2006), 3860–1.

• citepages=suppress omits the pages field even if the postnote is not numeric.

• citepages=permit (the default of the standard verbose styles) would just show both fields

Wolfgang A. Herrmann et al., “A carbocyclic carbene as an efficient catalyst ligand for C–C coupling reactions”, Angew. Chem. Int. Ed. 45/23 (2006), 3859–62, 3860–1.

So you could try

\documentclass{article}

\usepackage[style=oxnotes, citepages=omit]{biblatex}

\begin{document}
Text.\footcite[3860-3861]{herrmann}

\printbibliography
\end{document}


The \DeclareFieldFormat idea did not work because \iffieldundef{pages}{}{\iffieldundef{postnote}{}{\clearfield{pages}}} is not a command that prints anything. It only tells biblatex to delete pages in a certain situation. But \DeclareFieldFormat should be used to tell biblatex how to print stuff, compare with the default

\DeclareFieldFormat{pages}{\mkpageprefix[bookpagination]{#1}}


or the simpler

\DeclareFieldFormat{title}{\mkbibemph{#1}}


A \DeclareFieldFormat should always involve a #1.

In essence this definition deletes the field in the case you want (and it would not delete the field in the bibliography, because \iffieldundef{postnote} would be true there), but it overwrites the definition that tells biblatex how to print the pages field in the first place, which means that it is always dropped in the output.

Deleting a field only in \DeclareFieldFormat could cause spurious punctuation because biblatex thinks it printed something when it didn't.

So I would not try and pursue that particular approach any further here.

Note that the

\RequireBibliographyStyle{oxref}


was not required. In general you shouldn't have to use \RequireBibliographyStyle or \RequireCitationStyle in a document. The style is loaded via biblatex's style option (or separately via bibstyle and citestyle).

• – moewe Feb 19 at 9:04
• Thank you, you beautiful person!!! And thanks as well for the github reference -- hadn't seen that! – BT220 Feb 19 at 10:00
• Plus I got the reasoning on \DeclareFieldFormat wrong... :( It must have been Monday! – gusbrs Feb 19 at 11:13