本文介绍了在RMarkdown中设置/更改书目标题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在尝试使用RMarkdown.但是,我想更改参考书目的标题.在这种情况下,我正在使用natbib.当前的RMarkdown设置如下所示:

I'm currently experimenting with RMarkdown. However, I would like to change the title of my bibliography. I'm using natbib in this situation. The current RMarkdown setup is shown below:

title: ....
author: ....
output:
  pdf_document:
    citation_package: natbib
bibliography: Referanser2.bib
biblio-style: unsrt
header_includes: 
- \usepackage{amsmath}
- \usepackage{kbordermatrix}
- \setcitationstyle{numbers,square} 
[@MyReference]

这给了我一个简单的PDF,带有1个参考文献和一个书目.为了我可以更改书目标题,可以对代码进行任何修改吗?

This gives me a simple PDF with 1 reference and a bibliography. Is there any modification which can be done to the code in order for me to change the bibliography title?

推荐答案

首先,您在YAML中输入错误:它是 header-includes 并带有连字符.

First of all, you got a typo in your YAML: it is header-includes with an hyphen.

您可以通过重新定义 \ refname 来更改参考部分的标题:

You can change the head of the reference section by redefining \refname:

---
title: "Test"
author: "Martin"
header-includes: 
  - \renewcommand\refname{NEW TITLE}
output:
  pdf_document:
    keep_tex: yes
    citation_package: natbib
bibliography: skeleton.bib
biblio-style: unsrt
---

[@SomeRef]

这篇关于在RMarkdown中设置/更改书目标题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-22 21:17