BibLaTeX - 旧式页码,并在参考书目中保留“p.”和“pp.”

BibLaTeX - 旧式页码,并在参考书目中保留“p.”和“pp.”

正如标题所述,有什么方法可以使页码变为旧式,并保留分页(“p.”和“pp.”)?

这是我目前所做的:

我的 MWE 代码:

% !TEX program = xelatex

\documentclass{article}

\usepackage{filecontents}
\usepackage{hyperref}

\begin{filecontents}{mybib.bib}
@Article{Cormos2012,
  Title        = {Integrated assessment of IGCC power generation technology with carbon capture and storage (CCS)},
  Author       = {Cormos, C.},
  Journal      = {Energy},
  Year         = {2012},
  Number       = {1},
  Pages        = {434-445},
  Volume       = {42},
  ISBN         = {0360-5442},
  Publisher    = {Elsevier Ltd},
  Url          = {http://dx.doi.org/10.1016/j.energy.2012.03.025}
}

@Article{Mumford2015,
  Title        = {Review of solvent based carbon-dioxide capture technologies},
  Author       = {Mumford, Kathryn a. and Wu, Yue and Smith, Kathryn H. and Stevens, Geoffrey W.},
  Journal      = {Frontiers of Chemical Science and Engineering},
  Year         = {2015},
  Number       = {2},
  Pages        = {125-141},
  Volume       = {9},
  Doi          = {10.1007/s11705-015-1514-6},
  ISBN         = {2095-0179},
  Keywords     = {absorption,carbon capture,carbon dioxide,large scale,solvent},
  Url          = {http://link.springer.com/10.1007/s11705-015-1514-6}
}

\end{filecontents}

\usepackage[%
    backend      = biber,
    style        = numeric-comp,
    firstinits   = true, 
    isbn         = false,
    doi          = true,
    url          = false,
    maxcitenames = 4,
    maxbibnames  = 4
]{biblatex}

\DeclareFieldFormat*{pages}{\mkpageprefix[pagination]{\oldstylenums{#1}}}

\addbibresource{mybib.bib}

\begin{document}
Here comes the 1st citation\autocite{Cormos2012} and the 2nd one\autocite{Mumford2015}.

\printbibliography
\end{document}

可以看到,第一个 [1] 的页码完全没有变化,但第二个却成功更改了。它们都丢失了我想要保留的“p.”和“pp.”

抱歉,我是新手,发布图片时遇到了一些“声誉”问题。

答案1

测试 pages 字段是否为数字时,您可以忽略。(另请\NumCheckSetup参阅\oldstylenums当页码以某些字母结尾时,Biblatex 不会打印“p”。带有单破折号的复合页码\DeclareNumChars 和页面字段中的命令

最安全的解决方案可能是

\newcommand{\myosn}[1]{\ifpages{#1}{\oldstylenums{#1}}{#1}}

\DeclareFieldFormat*{pages}{\mkpageprefix[pagination]{\myosn{#1}}}
\NumCheckSetup{\renewcommand{\myosn}[1]{#1}}

或者你只能忽略\oldstylenums

\DeclareFieldFormat*{pages}{\mkpageprefix[pagination]{\oldstylenums{#1}}}
\NumCheckSetup{\def\oldstylenums#1{#1}}

另一个快速解决方案是添加\oldstylenums负责\mkpageprefix

\makeatletter
\protected\long\def\blx@mkpageprefix#1[#2]#3{%
  \ifnumeral{#3}
    {\bibstring{#1}\ppspace}
    {\ifnumerals{#3}
       {\bibstring{#1s}\ppspace}
       {\def\pno{\bibstring{#1}}%
        \def\ppno{\bibstring{#1s}}}}%
  \blx@mkpageprefix@i[#2]{\oldstylenums{#3}}}
\makeatother

相关内容