如何强制 biblatex 将 doi 排版为小写(用句号代替“doi”一词后的冒号)

如何强制 biblatex 将 doi 排版为小写(用句号代替“doi”一词后的冒号)

我使用的biblatex-ieee包,即加载了样式biblatex的包ieee

在我的参考书目中,我希望做两件该软件包目前没有做的事情。

  1. 将单词 DOI 后的冒号替换为句点
  2. 将单词“DOI”和实际 DOI 排版为小写(目前为小型大写)

我怎样才能实现这一点? 以下是 MWE:

\documentclass{article}
\usepackage[style=ieee]{biblatex}
\begin{filecontents*}{example.bib}
@article{Ahmed2014,
author = {Ahmed, Ryan and {El Sayed}, Mohammed and Arasaratnam, Ienkaran and {Jimi Tjong} and Habibi, Saeid},
doi = {10.1109/JESTPE.2014.2331059},
file = {::},
issn = {2168-6777},
journal = {IEEE Journal of Emerging and Selected Topics in Power Electronics},
month = {sep},
number = {3},
pages = {659--677},
title = {{Reduced-Order Electrochemical Model Parameters Identification and SOC Estimation for Healthy and Aged Li-Ion Batteries Part I: Parameterization Model Development for Healthy Batteries}},
url = {http://ieeexplore.ieee.org/document/6838950/},
volume = {2},
year = {2014}
}
\end{filecontents*}
\addbibresource{example.bib}

\begin{document}
Hello
\nocite{*}
\printbibliography
\end{document}

带冒号的小写 DOI

答案1

DOI 格式由 中定义的 DOI 字段格式控制biblatex.def。我们只需从 重新定义它即可

\DeclareFieldFormat{doi}{%
  \mkbibacro{DOI}\addcolon\space
  \ifhyperref
    {\href{https://doi.org/#1}{\nolinkurl{#1}}}
    {\nolinkurl{#1}}}

变成我们想要的东西。我没有重新定义\mkbibarco,而是直接插入文本,替换\addcolon\adddot并添加一些内容,\lowercase这样就可以得到

\DeclareFieldFormat{doi}{%
  doi\adddot\space
  \ifhyperref
    {\lowercase{\href{https://doi.org/#1}{\nolinkurl{#1}}}}
    {\lowercase{\nolinkurl{#1}}}}

综合起来

\documentclass{article}
\usepackage[style=ieee]{biblatex}

\DeclareFieldFormat{doi}{%
  doi\adddot\space
  \ifhyperref
    {\lowercase{\href{https://doi.org/#1}{\nolinkurl{#1}}}}
    {\lowercase{\nolinkurl{#1}}}}


\begin{filecontents*}{example.bib}
@article{Ahmed2014,
author = {Ahmed, Ryan and {El Sayed}, Mohammed and Arasaratnam, Ienkaran and {Jimi Tjong} and Habibi, Saeid},
doi = {10.1109/JESTPE.2014.2331059},
file = {::},
issn = {2168-6777},
journal = {IEEE Journal of Emerging and Selected Topics in Power Electronics},
month = {sep},
number = {3},
pages = {659--677},
title = {{Reduced-Order Electrochemical Model Parameters Identification and SOC Estimation for Healthy and Aged Li-Ion Batteries Part I: Parameterization Model Development for Healthy Batteries}},
url = {http://ieeexplore.ieee.org/document/6838950/},
volume = {2},
year = {2014}
}
\end{filecontents*}
\addbibresource{example.bib}

\begin{document}
Hello
\nocite{*}
\printbibliography
\end{document}

相关内容