# Biblatex citepages=omit not working when postnote has text

I am working with philosophy-verbose style with citepages=omit.

Sometimes I need comment in the footnotes after reference. Writing just text.\footcite[22, textual comment]{bertram} outputs footnote

Bertram Aaron, Wentworth Richard, "Gromov invariants for holomorphic maps on Riemann surfaces", J. Amer. Math. Soc., 9, 2 (1996), pp. 529-571, 22, textual comment.

I don't need pagetotal and it is absent without text in the postnote: text.\footcite[22]{bertram} results in footnote

Bertram Aaron, Wentworth Richard, "Gromov invariants for holomorphic maps on Riemann surfaces", J. Amer. Math. Soc., 9, 2 (1996), p. 22.

This answer showed to me how add p. before page number, but pagetotal field that I don't need is there: text.\footcite[\pno~22, textual comment]{bertram} results footnote

Bertram Aaron, Wentworth Richard, "Gromov invariants for holomorphic maps on Riemann surfaces", J. Amer. Math. Soc., 9, 2 (1996), pp. 529-571, p. 22, textual comment.

Now I am using \cite inside \footnot: text.\footnote{\cite[22]{bertram}, textual comment} to get desired footnote

Bertram Aaron, Wentworth Richard, "Gromov invariants for holomorphic maps on Riemann surfaces", J. Amer. Math. Soc., 9, 2 (1996), p. 22, textual comment.

Is this intended behaviour that citepages=omit is not working in such conditions or I am doing something wrong?

MVE

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{csquotes}
\usepackage[english]{babel}
\usepackage[style=philosophy-verbose,backref=true,citepages=omit]{biblatex}
\usepackage{xpatch}

\begin{document}
\null\vfill\noindent
text.\footcite[\pno~22, textual comment]{bertram}
\printbibliography
\end{document}


This is intentional. citepages=omit tests if the postnote is a page range and only suppresses the pages field in that case. The idea being that in other cases it can not be guaranteed that the postnote contains page references that supersede the info in the pages field.

Following discussions in 2 exact page numbers in footnotes biblatex-sbl and https://github.com/plk/biblatex/issues/918, the next version of biblatex (v3.15) will have two new commands \NumsCheckSetup and \PagesCheckSetup that can be used to define a command that lets you hide additional text in the footnote from the macro that tests if we are dealing with a page range.

So we can define a new macro \hidefromifpages that simply expands to its argument, but then we redefine it to hide its argument when \ifpages does its text. That means that if the rest of the postnote outside \hidefromifpages is a page range, the postnote field still passes the test.

Instead of manual \pno~ it is more convenient to use \pnfmt introduced in version 3.13 (https://github.com/plk/biblatex/issues/870).

The MWE contains two code blocks: The first block defines \PagesCheckSetup and sets it up for \pnfmt. That code block will be superfluous in biblatex 3.15 or above, since it will be contained in the biblatex core. In the MWE the block is coded in a way that will cause it to raise an error in newer biblatex version to remind you that it should be removed.

The second code block sets up \hidefromifpages.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{csquotes}
\usepackage[english]{babel}
\usepackage[style=philosophy-verbose,backref=true,citepages=omit]{biblatex}
\usepackage{xpatch}

% In biblatex 3.15 and above
% \NumsCheckSetup and \PagesCheckSetup are part of the biblatex core.
% The following lines will then throw an error.
% Just remove them if that happens.
\makeatletter
\newrobustcmd*{\NumsCheckSetup}{\appto\blx@hook@ifnums}
\newrobustcmd*{\PagesCheckSetup}{\appto\blx@hook@ifpages}
\PagesCheckSetup{\let\pnfmt\@firstofone}
\makeatother

\makeatletter
\newcommand*{\hidefromifpages}[1]{#1}
\PagesCheckSetup{\let\hidefromifpages\@gobble}
\makeatother


• Oh, I'm glad to see you are also finding use for \pnfmt. :) Mar 7 '20 at 22:50
• It generates dvi file with with such text: @processoptions heckoptions@global @ ff maxnamesaxcitenames@ ff minnamesincitenames@ ff maxitemsaxitems@ ff minitemsinitems @donameparts niquelistpt@uniquelist@minyear on?opt'uniquelist=minyear' re- quires 'labeldateparts'.Setting 'uniquelist=true' @dodates uxwritemain- aux\abx@aux@refcontextefcontext@context heckencoding blinput axsection@ nf@refsec nf@refsegopreamblecmds in the upper part of a page and 1 sigfridsson. in the footnote. Maybe this will be useful for understanding what is going on. Mar 8 '20 at 3:04
• @Maras Sorry, I have no idea why you would get those errors. If you can come up with a minimal example that reproduces the errors, I'll be happy to look at them. Just open a new question. Was ! Undefined control sequence. l.15107 \blx @processoptions the very first error, or was there one before that? That error looks like the category code of @ is wrong, so something to do with \makeatletler/\makeatother seems to be wrong. In the MWE all \makeatletter/\makeatothers line up. Mar 8 '20 at 5:43