12

I have to cite articles without page numbers, book sections however are supposed to have them. I'm using the following code to avoid the "pp." before the pages:

\DefineBibliographyStrings{ngerman}{pages={}}

Obviously, this omits page numbers for all citations. Is there a way to have only the articles without page numbers?

  • Just to be clear: Should this apply for the bibliography, or for in-text-citations, or for both? – lockstep Jan 4 '12 at 13:25
  • 1
    Which bibliography style are you using? I think the easiest option might be to duplicate it in your texmf folder and change it. For instance, in many styles you could remove (or comment) the line that says \printfield{pages} under \DeclareBibliographyDriver{article}. – ienissei Jan 4 '12 at 13:27
  • It is for the authoryear-style and only in the bibliography. – Jan Jan 4 '12 at 13:28
15

You have to change the format of the pages field which deals with page ranges of articles, incollections etc. in the bibliography. (There's also a pagetotal field for the total pages of, e.g., books.) The optional argument of \DeclareFieldFormat takes a comma-separated list of entry types for which the new/changed format should apply.

Changing the format for in-text-citations requires to fiddle with the postnote field; see section 3.11.3 of the biblatex manual for details.

\documentclass{article}

\usepackage[style=authoryear]{biblatex}

\DeclareFieldFormat[article]{pages}{#1}%

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@article{Bli74,
  author = {Blinder, Alan S.},
  year = {1974},
  title = {The economics of brushing teeth},
  journaltitle = {Journal of Political Economy},
  volume = {82},
  number = {4},
  pages = {887--891},
}
@incollection{Fis00,
  author = {Fischel, William A.},
  year = {2000},
  title = {Zoning and land use regulation},
  maintitle = {Encyclopedia of law and economics},
  volume = {2},
  booktitle = {Civil law and economics},
  editor = {Boudewijn, Bouckaert and de Geest, Gerrit},
  location = {Cheltenham},
  publisher = {Elgar},
  pages = {403--442},
}
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}

Some text \autocites[887]{Bli74}[403]{Fis00}.

\printbibliography

\end{document}

enter image description here

EDIT: iennisei's answer makes me think I may have misunderstood your question: In case you don't only want to drop the prefix for article page ranges, but to omit them entirely, use the following code (which makes the above format redefinition superfluous):

\AtEveryBibitem{%
  \ifentrytype{article}{%
    \clearfield{pages}%
  }{%
  }%
}

enter image description here

|improve this answer|||||
  • Thank you, that does it. I assume that the code in question is: \DeclareFieldFormat[article]{pages}{#1}% What exactly does this mean? Only for learning benefits ;-) – Jan Jan 4 '12 at 13:47
  • 1
    @Jan I added a short explantion to my answer. – lockstep Jan 4 '12 at 13:54
3

The technique you used replaces the language string for "pages" throughout the entire bibliography, and also presupposes that you do not write any page references in the entries for your articles (but what if you need them for another paper, with another citation style?). @lockstep's answer is more targeted, but (unless I am mistaken) also supposes that you omit the page numbers in your .bib file.

In order to prevent printing the page number altogether, how about this:

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

The note+pages macro is used by the standard.bbx file for displaying the page numbers of articles. It is the file called by authoryear for formatting the bibliography.

|improve this answer|||||
  • 1
    With @locksteps solution, you don’t have to omit the pages in the .bib file. – domwass Jan 4 '12 at 14:03
  • Good catch, with regard to omitting prefixes vs. omitting the entire data! I've updated my answer to include my preferred method (\clearfield), but +1 for your one. – lockstep Jan 4 '12 at 14:10
  • @domwass Actually, re-reading the OP's question makes me think it was quite ambiguous, and iennissei's answer was helpful. – lockstep Jan 4 '12 at 14:11
  • @lockstep Yes, the ambiguity of the question was behind my reasoning, but I very much like your solutions. – ienissei Jan 4 '12 at 14:19
  • This solution works very well. With the \DeclareFieldFormat solution, I would get my bib entries ending with a comma instead of a period. – Supernormal Feb 15 at 9:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.
https://tex.stackexchange.com/questions/40023/biblatex-no-pages-for-article
tex.stackexchange.com
crawl=CC-MAIN-2020-16
160012
application/http; msgtype=response
sha1:2ZXSJAOWKF3BYHHZ3P72B7JXFHEWERBP
<urn:uuid:dc8ef953-8831-40bb-b377-6532c2cd6d4a>
2020-04-06T22:38:05Z
151.101.193.69
text/html
sha1:VJH5F2TRX7LHV3OZ7GEGRNADY5WW77IT
<urn:uuid:a9f565be-fe59-487a-8508-86b6cc5af983>
https://tex.stackexchange.com/questions/40023/biblatex-no-pages-for-article
response
<urn:uuid:e073efc6-4970-4261-a9bd-be57c11ce265>
isPartOf: CC-MAIN-2020-16
publisher: Common Crawl
description: Wide crawl of the web for March/April 2020
operator: Common Crawl Admin (info@commoncrawl.org)
hostname: ip-10-67-67-152.ec2.internal
software: Apache Nutch 1.16 (modified, https://github.com/commoncrawl/nutch/)
robots: checked via crawler-commons 1.1-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)
format: WARC File Format 1.1
conformsTo: http://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/