如果“journal = {JINST}”,则抑制页面中的“p”。

如果“journal = {JINST}”,则抑制页面中的“p”。

《仪器仪表杂志》(JINST)的页码通常以字母开头。出于某种原因,如果第一个字母是“C”,则biblatex在页码前打印“p。”,但其他字母则不打印。为了保持一致性,我想在 JINST 的任何页码前隐藏“p。”。对于其他通常只有页码的杂志,我仍然想保留“p。”

下面是一个演示该问题的例子。

\documentclass{article}
\usepackage{filecontents}

\usepackage[
  backend=biber,
  sorting=none,
  giveninits=true,
  useprefix=true,
  backref=true,
  backrefstyle=three,
  style=numeric-comp
]{biblatex}

\begin{filecontents}{test.bib}
@article{C03024,
  author = {zur Nedden, M.},
  title = {The LHC Run 2 ATLAS trigger system: design, performance and plans},
  journal = {JINST},
  year = {2017},
  month = {mar},
  volume = {12},
  number = {03},
  pages = {C03024},
  doi = {10.1088/1748-0221/12/03/C03024},
}
@article{P09015,
  author = {{ATLAS Collaboration}},
  title = {Performance of the ATLAS muon triggers in Run 2},
  journal = {JINST},
  year = {2020},
  month = {sep},
  volume = {15},
  number = {09},
  pages = {P09015},
  doi = {10.1088/1748-0221/15/09/P09015},
}
@article{S08003,
  author = {{ATLAS Collaboration}},
  title = {The ATLAS Experiment at the CERN Large Hadron Collider},
  journal = {JINST},
  year = {2008},
  volume = {3},
  number = {08},
  pages = {S08003},
  doi = {10.1088/1748-0221/3/08/S08003},
}
\end{filecontents}
\addbibresource{test.bib}

\begin{document}

C03024~\cite{C03024}

P09015~\cite{P09015}

S08003~\cite{S08003}

\printbibliography[heading=bibintoc]

\end{document}

这得出

在此处输入图片描述

答案1

C03024被识别为正常页码,因为biblatex允许使用罗马数字和阿拉伯数字(甚至像这样“组合”)。

对于不是真实页面的页面,您可以使用该eid字段。

\documentclass{article}
\usepackage[
  backend=biber,
  sorting=none,
  giveninits=true,
  useprefix=true,
  backref=true,
  backrefstyle=three,
  style=numeric-comp
]{biblatex}

\begin{filecontents}{\jobname.bib}
@article{C03024,
  author  = {zur Nedden, M.},
  title   = {The {LHC Run~2 ATLAS} trigger system: design, performance and plans},
  journal = {JINST},
  year    = {2017},
  month   = mar,
  volume  = {12},
  number  = {03},
  eid     = {C03024},
  doi     = {10.1088/1748-0221/12/03/C03024},
}
@article{P09015,
  author  = {{ATLAS Collaboration}},
  title   = {Performance of the {ATLAS} muon triggers in {Run~2}},
  journal = {JINST},
  year    = {2020},
  month   = sep,
  volume  = {15},
  number  = {09},
  eid     = {P09015},
  doi     = {10.1088/1748-0221/15/09/P09015},
}
@article{S08003,
  author  = {{ATLAS Collaboration}},
  title   = {The {ATLAS} Experiment at the {CERN} Large Hadron Collider},
  journal = {JINST},
  year    = {2008},
  volume  = {3},
  number  = {08},
  eid     = {S08003},
  doi     = {10.1088/1748-0221/3/08/S08003},
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
C03024~\autocite{C03024}

P09015~\autocite{P09015}

S08003~\autocite{S08003}

\printbibliography[heading=bibintoc]
\end{document}

M. zur Nedden。“LHC Run 2 ATLAS 触发系统:设计、性能和计划”。收录于:JINST 12.03,C03024(2017 年 3 月)。doi:10.1088/1748-0221/12/03/C03024(引自第 1 页)。

如果你不想更改.bib文件,你可以让 Biber 为你映射字段

\DeclareSourcemap{
  \maps[datatype=bibtex]{
    \map{
      \step[fieldsource=journal, fieldtarget=journaltitle]
      \step[fieldsource=journaltitle,
            match=\regexp{\AJINST\Z}, final] 
      \step[fieldsource=pages, fieldtarget=eid]
    }
  }
}

如果您更喜欢该pages字段及其位置,您可以使用该bookpagination字段来告诉biblatex停止尝试在页码前放置“p。”/“pp。”前缀。

\documentclass{article}
\usepackage[
  backend=biber,
  style=numeric-comp,
  sorting=none,
  giveninits=true,
  useprefix=true,
  backref=true,
  backrefstyle=three,
]{biblatex}

\begin{filecontents}{\jobname.bib}
@article{C03024,
  author         = {zur Nedden, M.},
  title          = {The {LHC Run~2 ATLAS} trigger system: design, performance and plans},
  journal        = {JINST},
  year           = {2017},
  month          = mar,
  volume         = {12},
  number         = {03},
  pages          = {C03024},
  bookpagination = {none},
  doi            = {10.1088/1748-0221/12/03/C03024},
}
@article{P09015,
  author         = {{ATLAS Collaboration}},
  title          = {Performance of the {ATLAS} muon triggers in {Run~2}},
  journal        = {JINST},
  year           = {2020},
  month          = sep,
  volume         = {15},
  number         = {09},
  pages          = {P09015},
  bookpagination = {none},
  doi            = {10.1088/1748-0221/15/09/P09015},
}
@article{S08003,
  author         = {{ATLAS Collaboration}},
  title          = {The {ATLAS} Experiment at the {CERN} Large Hadron Collider},
  journal        = {JINST},
  year           = {2008},
  volume         = {3},
  number         = {08},
  pages          = {S08003},
  bookpagination = {none},
  doi            = {10.1088/1748-0221/3/08/S08003},
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
C03024~\autocite{C03024}

P09015~\autocite{P09015}

S08003~\autocite{S08003}

\printbibliography[heading=bibintoc]
\end{document}

M. zur Nedden。“LHC Run 2 ATLAS 触发系统:设计、性能和计划”。收录于:JINST 12.03(2017 年 3 月),C03024。doi:10.1088/1748-0221/12/03/C03024(引自第 1 页)。

这也可以自动化

\DeclareSourcemap{
  \maps[datatype=bibtex]{
    \map{
      \step[fieldsource=journal, fieldtarget=journaltitle]
      \step[fieldsource=journaltitle,
            match=\regexp{\AJINST\Z}, final] 
      \step[fieldset=bookpagination, fieldvalue=none]
    }
  }
}

如果您希望罗马数字的数字检查失败biblatex,您可以重新定义内部命令\blx@hook@ifnum(请注意,由于我们正在处理内部命令,因此无法保证这在未来版本中不会中断)

\makeatletter
\def\blx@hook@ifnum{%
  \def\do##1{\uccode`##1=`\%}%
  \do\ \do\0\do\1\do\2\do\3\do\4\do\5\do\6\do\7\do\8\do\9%
  \blx@donumchars
  \let\RN\@firstofone
  \let\Rn\@firstofone}
\makeatother

相关内容