如何从 R-markdown 参考书目中删除 DOI?

How do I remove DOI from R-markdown bibliography?

我想从我的降价脚本中的参考书目中删除 DOI。我有办法做到这一点吗?

这是我的降价文件:

---
title: "my paper"
author: "name"
date: \today
header-includes:
output:
  pdf_document:
    number_sections: yes
    toc: yes
    keep_tex: yes
    fig_caption: yes
  word_document:
    toc: yes
latex_engine: xelatex
indent: yes
bibliography: library.bib
references: 
link-citations: yes
linkcolor: blue
hyperfootnotes: yes
---

I would like to remove the DOI from this reference @Wallace2005

# Bibliography {-}
::: {#refs}
:::

此文件的输出如下:

这是 .bib 文件

@article{Wallace2005,
abstract = {Constantly evolving, and with far-reaching implications, European Union policy-making is of central importance to the politics of the European Union. From defining the processes, institutions and modes through which policy-making operates, the text moves on to situate individual policieswithin these modes, detail their content, and analyse how they are implemented, navigating policy in all its complexities. The first part of the text examines processes, institutions, and the theoretical and analytical underpinnings of policy-making, while the second part considers a wide range of policy areas, from economics to the environment, and security to the single market. Throughout the text, theoreticalapproaches sit side by side with the reality of key events in the EU, including enlargement, the ratification of the Lisbon Treaty, and the financial crisis and resulting euro area crisis, exploring what determines how policies are made and implemented. In the final part, the editors consider trendsin EU policy-making and look at the challenges facing the EU. Exploring the link between the modes and mechanisms of EU policy-making and its implementation at national level, Policy-Making in the Europe Union helps students to engage with the key issues related to policy. Written by experts, for students and scholars alike, this is the most authoritative andin-depth guide to policy in the European Union.},
author = {Wallace, Helen and Wallace, William and Pollack, Mark A},
doi = {10.1177/0010414013516917},
file = {:Users/aguasti/Desktop/Mendely Organized Library/Wallace, Wallace, Pollack/Wallace, Wallace, Pollack - 2005 - Policy-Making in the European Union.pdf:pdf},
isbn = {0199689679},
issn = {0010-4140},
pages = {574},
pmid = {130137987},
title = {{Policy-Making in the European Union}},
url = {https://books.google.com/books?id=w6SbBQAAQBAJ&pgis=1},
year = {2005}
}

如果有人知道如何从参考书目中删除 DOI,我将非常感激

我假设您想在编写 PDF 时即时完成此操作。

引用的呈现方式由应用的 citation styles.

控制

因此,一种方法是将 YAML header 中的引用样式更改为不包含 DOI 的样式(请注意,对于 PDF 输出,您需要添加 natbib 行).

bibliography: library.bib
citation_package: natbib
csl: somethingelse.csl

或者,如果您必须坚持某种风格,您可以[修改CSL-file] (https://www.zotero.org/support/dev/citation_styles/style_editing_step-by-step)。

elsevier-harvard.csl

的示例

您可以在 CSL-file 中评论相关行:

<if variable="DOI">
   <!--<text variable="DOI" prefix="https://doi.org/"/> -->
</if>

用新名称保存(例如,elsevier-harvard_mod.csl) 然后 re-run 你的例子(这里缩短)

---
title: "my paper"
author: "name"
date: \today
output: pdf_document
bibliography: library.bib
citation_package: natbib
csl: elsevier-harvard_mod.csl
---

I would like to remove the DOI from this reference @Wallace2005

# Bibliography {-}