[Tex/LaTex] biblatex: Chicago-style page ranges

biblatexchicago-style

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.

Best Answer

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}

enter image description here

Related Question