0

I cite the answer from this post:

To omit the page prefix for all citations, add the following to your preamble:

\DeclareFieldFormat{postnote}{#1}
\DeclareFieldFormat{multipostnote}{#1}

I would like to do exactly the same thing, but just for one specific book (so for all other books "p." should appear in the citation).

The same answer says that

To suppress the prefix for individual citations, use \nopp within the citation's optional argument (thanks to Gonzalo Medina for the tip):

\cite[\nopp 1]{A01}

The result is exactly what I want, but I would prefer not to have to write the command every time I quote that specific book, but to automate the operation.

How can I achieve that?

Urel
  • 91

1 Answers1

1

Use the pagination field and give it the value none to suppress the page prefix.

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[backend=biber, style=authoryear]{biblatex}

\begin{filecontents}{\jobname.bib} @book{elk, author = {Anne Elk}, title = {A Theory on Brontosauruses}, year = {1972}, publisher = {Monthy & Co.}, location = {London}, pagination = {none}, } \end{filecontents} \addbibresource{\jobname.bib} \addbibresource{biblatex-examples.bib}

\begin{document} Lorem \autocite[380]{sigfridsson} ipsum \autocite[12]{elk}

\printbibliography \end{document}

Lorem (Sigfridsson and Ryde 1998, p. 380) ipsum (Elk 1972, 12)

If you also need to remove the comma in that case you can use something like

\DeclareDelimFormat{postnotedelim}{%
  \ifboolexpr{    test {\iffieldpages{postnote}}
              and test {\iffieldequalstr{pagination}{none}}}
    {\addspace}
    {\addcomma\space}%
}
moewe
  • 175,683
  • That is exactly what I wanted! Do you also know how to remove the comma between the author-year and the page number? So, instead of Elk 1972, 12, i would like to get Elk 1972 12 (but just for this book). Thanks in advance – Urel Jun 04 '21 at 14:46
  • 1
    @Urel See the update, please. – moewe Jun 04 '21 at 14:49