微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

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

我想从 Markdown 脚本中的参考书目中删除 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}
:::

这个文件输出如下:

enter image description here

这里是 .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,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 标头中的样式更改为不包含 DOI 的样式(请注意,对于 PDF 输出,您需要添加 natbib 行)。

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

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

elsevier-harvard.csl 的示例

您可以只评论 CSL 文件中的相关行:

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

以新名称保存(例如,elsevier-harvard_mod.csl) 然后重新运行你的例子(这里缩短了)

---
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 {-}

enter image description here

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?