2017-08-18 34 views
4

我rmarkdown脚本如下所示:如何仅在R markdown的引用中提供年份?

--- 
title: "Untitled" 
author: "me" 
date: '`r format(Sys.time(), "%d %B, %Y")`' 
output: 
    pdf_document: default 
    bibliography: bibliography.bib 
--- 

In his book Helsel explains how to approach censored environmental data [@helsel_statistics_2012]. 

MY文件名为.bib这样:

@book{helsel_statistics_2012, 
    address = {Hoboken, N.J}, 
    edition = {2nd ed}, 
    series = {Wiley series in statistics in practice}, 
    title = {Statistics for censored environmental data using {Minitab} and {R}}, 
    isbn = {978-0-470-47988-9}, 
    publisher = {Wiley}, 
    author = {Helsel, Dennis R.}, 
    year = {2012}, 
    note = {00003 OCLC: ocn748290711}, 
    keywords = {Environmental sciences, Measurement Statistical methods, Minitab, Pollution, R (Computer program language), Statistical methods}, 
} 

当我编我得到以下输出文件:

在他的书Helsel解释了如何处理审查过的环境数据(Helsel 2012)。

问题:我如何才能在引用中返回年份(因为我已经在文本中声明了作者)?

在他的书中Helsel (2012)解释了如何对待审查的环境数据。

回答

7

在rmarkdown(.Rmd)文件把下面的(注意,从去除括号[] [@ helsel_statistics_2012]):

In his book @helsel_statistics_2012 explains how to approach censored environmental data. 

一旦渲染这会给你所需的输出:

In his book Helsel (2012) explains how to approach censored environmental data. 

如果你真的只希望一年的引文,那么:

[[email protected]_statistics_2012] 

回报:

(2012) 

欲了解更多详情,请参阅上引用的rmarkdown documetation http://rmarkdown.rstudio.com/authoring_bibliographies_and_citations.html

相关问题