biblatex:芝加哥风格的页面范围

biblatex:芝加哥风格的页面范围

我正在尝试缩短文章的页码范围,如《芝加哥格式手册》第 759-760 页所述。对于不熟悉它的人。我试过了列表中给出的解决方案

\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}

我在这里放了完整的序言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}}

我还插入了我的一个参考文献:

    @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}
   }

正如我所说,我希望页面范围在articles 中,并且incollection应该缩短为类似“第 321-328 页”的内容,例如“第 321-28 页”。任何帮助表示感谢。

答案1

以下是缩写规则的摘要芝加哥格式手册(第 16 版,第 9.60 节)。

  1. 如果页面范围中第一个数字小于 100:不压缩(例如 3–10、71–72、96–117)
  2. 否则,如果第一个数字可以被 100 整除:不压缩(例如 100–104、1100–1113)
  3. 否则,如果第一个数字的倒数第二位数字为零:完全压缩(例如 101-8、808-33、1103-4)
  4. 否则:压缩到至少两位数(例如 321–28、498–532、1087–89、1496–500、11564–615、12991–3001)

根据讨论的计数器先前的答案以下值涉及规则 1 和 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隐藏第二个数字中的前导零。这解决了规则 3。可以通过编辑一些biblatex内部内容来处理规则 2。以下文档对此进行了演示。

\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}

在此处输入图片描述

答案2

我不熟悉 Cicago 格式手册。要将参考书目中的页面范围(如“321--328”)压缩为“321--28”,同时保留页面前缀,您必须pages按如下方式更改字段的格式:

\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}

在此处输入图片描述

相关内容