# biblatex: Chicago-style page ranges

I am trying to shorten the page range of articles, as specified in the Chicago Manual of Style, pages 759-760. For the ones not familiar with it. I tried the solution given here in the list:

\DeclareFieldFormat{postnote}{\mkcomprange[{\mkpageprefix[pagination]}]{#1}}
\DeclareFieldFormat{pages}{\mkcomprange{#1}}

% Compress ranges where lower limit > 100
\setcounter{mincomprange}{100}

% Don't compress beyond the fourth digit
\setcounter{maxcomprange}{1000}


I put here the entire preamble for biblatex:

\usepackage[style=verbose-ibid,firstinits=true,sorting=nty,sortcites=true,useprefix=false,maxnames=6,backend=biber]{biblatex} % originally the style was verbose-ibid
%\usepackage[style=footnote-dw,namefont=smallcaps,firstinits=true,idembib=true,idembibformat=dash,nopublisher=false,edbyidem=false,backend=biber]{biblatex}
\renewcommand*{\mkbibnamelast}[1]{\textsc{#1}}
\renewcommand*{\newunitpunct}{\addcomma\space}%put commas instead of periods after some elements of the title
%\usepackage{biblatex}%remove �in� in journal articles
\renewbibmacro{in:}{%
\ifentrytype{article}{}{%
\printtext{\bibstring{in}\intitlepunct}}}
\renewcommand*{\labelnamepunct}{\addcomma\space}
\renewcommand*{\nametitledelim}{\addcomma\space}
\renewcommand*{\bibfont}{\small}

\renewbibmacro*{publisher+location+date}{%
\printtext[parens]{% ADDED
\printlist{location}%
\iflistundef{publisher}
{\setunit*{\addcomma\space}}
{\setunit*{\addcolon\space}}%
\printlist{publisher}%
\setunit*{\addcomma\space}%
\usebibmacro{date}%
}\nopunct% ADDED
\newunit}
%for citing short forms
\renewbibmacro*{cite:short}{%
\printnames{labelname}%
\setunit*{\nametitledelim}%
% If article:
\ifentrytype{article}{%
\usebibmacro{journal}%
\setunit{\addspace}%
\printfield{volume}}{%
% If incollection:
\ifentrytype{incollection}{%
\usebibmacro{in:}%
\printtext[booktitle]{\printfield[titlecase]{booktitle}}}{%
% Else:
\printtext[bibhyperlink]{\printfield[citetitle]{labeltitle}}}}}
%for defining shorthands
\defbibcheck{noshorthand}{%
\iffieldundef{shorthand}{}{\skipentry}%
}

\makeatletter
\defbibheading{subshorthands}[\losname]{%
\section*{#1}%
\if@twoside\markright{\MakeUppercase{#1}}\fi}
\makeatother

\DeclareFieldFormat{postnote}{\mkcomprange[{\mkpageprefix[pagination]}]{#1}}
\DeclareFieldFormat{pages}{\mkcomprange{#1}}


I also insert one of my references:

    @incollection{Kitchen.2009,
author = {Kitchen, K. A.},
title = {The Third Intermediate Period in Egypt: An Overview of Fact and Fiction},
pages = {161–202},
bookpaginationtype = {page},
publisher = {Nederlands Archaeologisch-Philologisch Istituut voor het Nabije Oosten and Peeters},
series = {Egyptologische Uitgaven},
editor = {Broekman, G. P. F. and Demarée, R. J. and Kaper, O. E.},
booktitle = {The Libyan Period in Egypt},
year = {2009},
usera = {Yes},
location = {Leiden and Leuven},
booksubtitle = {Historical and Cultural Studies into the 21st-24th Dynasties: Proceedings of a Conference at Leiden University, 25-27 October 2007},
number = {23}
}


As I said, I would like the page ranges in the articles and incollection should be shortened to something like from "pages 321-328" into something like " pages 321-28". Any help appreciated.

-
I'd use an en-dash (--) for the range: pages = {161--202}; also 21st--24th Dynasties. – Marc van Dongen Feb 14 '12 at 8:26
I'm not very familiar with the Chicago Manual of Style, so I'm not sure I understand you: Is the main change you want that the term "pages" isn't printed for article and incollection but is used for all other entry types? – Simifilm Feb 14 '12 at 12:55
Sorry, I have corrected the main point. In the Chicago Manual of Style, say pages 321-328 are shortened as pages 321-28. if you want put pages or not that is another issue. – Roberto Gozzoli Feb 15 '12 at 0:10
@MarcvanDongen In the pages field, "all dashes are normalized and replaced by the command \bibrangedash" (biblatex manual, p. 13). – lockstep Feb 15 '12 at 0:54
@Lockstep Thanks. I didn't know that. I'll was going to remove my comment, but it has "some" useful advise about en-dashes, so I'll leave it. – Marc van Dongen Feb 15 '12 at 5:52

## 2 Answers

Here's a summary of the abbreviation rules described in The Chicago Manual of Style (16th edition, section 9.60).

1. If the first number in the page range less is than 100: No compression (e.g. 3–10, 71–72, 96–117)
2. Otherwise if the first number is divisible by 100: No compression (e.g. 100–104, 1100–1113)
3. Otherwise if the second last digit in the first number is zero: Full compression (e.g. 101–8, 808–33, 1103–4)
4. Otherwise: Compression down to at least two digits (e.g. 321–28, 498–532, 1087–89, 1496–500, 11564–615, 12991–3001)

Based on the counters discussed in a previous answer the following values address rules 1 and 4.

\setcounter{mincomprange}{100}    % Compress when first number is > 100...
\setcounter{maxcomprange}{100000} %   and has no more digits than 100000 (essentially > 100)
\setcounter{mincompwidth}{10}     % Compress down to two digits


\mkcomprange suppresses leading zeros in the second number. This takes care of rule 3. Rule 2 can be handled by editing some biblatex internals. This is demonstrated with the document below.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[style=authoryear]{biblatex}

\DeclareFieldFormat{postnote}{\mkcomprange[{\mkpageprefix[pagination]}]{#1}}
\DeclareFieldFormat{pages}{\mkcomprange{#1}}

\setcounter{mincomprange}{100}
\setcounter{maxcomprange}{100000}
\setcounter{mincompwidth}{10}

\makeatletter
\patchcmd{\blx@comprange@check}
{\blx@comprange@comp{#1}{#2}}
{\blx@tempcnta=#1
\divide\blx@tempcnta100
\multiply\blx@tempcnta100
\ifnumequal{\blx@tempcnta}{#1}
{\blx@range@out@value{#1\bibrangedash#2}}
{\blx@comprange@comp{#1}{#2}}}
{}{}
\makeatother

\addbibresource{biblatex-examples.bib}

\begin{document}
\noindent
\cites[3--10,71--72,96--117]{cms}{salam} \\
\cite[100--104,1100--1113,2900--2913]{cms} \\
\cite[101--108,808--833,1103--1104]{cms} \\
\cite[321--328,498--532,1087--1089,1496--1500,11564--11615,12991--13001]{cms}
\printbibliography
\end{document}


-
I get an error \blx@range@out@value – Yiannis Lazarides Feb 15 '12 at 4:15
@YiannisLazarides With biblatex 1.7? – Audrey Feb 15 '12 at 4:24
Thanks, I had an outdated version. Your solution is very good. – Yiannis Lazarides Feb 15 '12 at 4:57
@Audrey I am using your solution for the preamble, but it does not fully work for me. It is working fine for the bibliographic references, the page ranges are shortened, but it does not work in abbreviating the postnote in the citations. So if I cite \cites[196--197]{Ray.1990} the number is not shortened as you give in the example above. Please bear in mind that I just copied and pasted the coding as you give it. It might be conflicting with something I am not able to understand. – Roberto Gozzoli Feb 16 '12 at 4:34
@Audrey Thanks, after the changes you suggested everything is working fine. Thanks again. – Roberto Gozzoli Feb 16 '12 at 7:23

I'm not familiar with the Cicago Manual of Style. To compress a page range like "321--328" to "321--28" in the bibliography while retaining the page prefix, you have to change the format of the pages field as follows:

\documentclass{article}

\usepackage{biblatex}

\DeclareFieldFormat[article,incollection]{pages}%
{\mkcomprange[{\mkpageprefix[bookpagination]}]{#1}}
\setcounter{mincompwidth}{10}

\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},
}
\end{filecontents}

\addbibresource{\jobname.bib}

\nocite{*}

\begin{document}

\printbibliography

\end{document}


-