3

As mentioned in title, any way to make page number old-style, and keeping the pagination ("p." and "pp.")?

This is I have done so far:

My MWE code:

% !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}

As you can see, the page number of the first one [1] does not change at all, but the second one change successfully. Both of them losing "p." and "pp." that I intend to keep.

Sorry, I am new and have some "reputation" trouble to post the image.

  • I noticed that Ms. Mumford's second first name initial seems to be lowercase shouldn't it be Author = {Mumford, Kathryn A. and Wu, Yue and Smith, Kathryn H. and Stevens, Geoffrey W.},? – moewe Feb 24 '16 at 18:41
  • @moewe Yes, silly copying mistakes of mine. – Spaceship Feb 24 '16 at 18:49
3

With \NumCheckSetup you can ignore \oldstylenums when testing if the pages field is a number. (See also Biblatex no printing “p.” when page number ends in some letters, Compound page numbers with single dash and \DeclareNumChars and commands in page field)

The safest solution is probably

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

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

Alternatively you can only ignore \oldstylenums

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

Another quick solution is to add \oldstylenums to the internal macro in charge of \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

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.