如何在Rmarkdown引文中删除冒号前的令人不快的空格?

时间:2017-10-14 23:30:54

标签: r latex r-markdown pandoc

在Rmarkdown中我想要ASA style In-Text Citation,所以我需要在一年之后使用冒号,例如:“(1983:578)”,在冒号之前使用 no 空格。当我将:直接设置在年份后面时,引文会被侵蚀。我试图用一个\或两个\\反斜杠来逃避空间和冒号,但这没有用。根据{{​​3}},我还尝试首先定义LaTeX代码\edef\hc{\string:},其次,为冒号设置“\hc”:“[@hawking_thermodynamics_1983\hc578]”但它看起来只是同样,这也不是诀窍。

这是我可重复的临时解决方案:

---
title: Example
author: Author
output: pdf_document
bibliography: bibliography.bib
references:
- id: hawking_thermodynamics_1983
  author:
  - family: Hawking
    given: S. W.
  - family: Page
    given: Don N.
  publisher: Communications in Mathematical Physics
  title: Thermodynamics of black holes in anti-de Sitter space
  type: article-journal
  issued:
    year: 1983
---
```{r setup, include=FALSE, tidy=TRUE}
library(knitr)
opts_chunk$set(echo = TRUE)
```
# Chapter
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy 
eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam 
voluptua [@hawking_thermodynamics_1983 :578]. 

# References

或者

\edef\hc{\string:}

# Chapter
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy 
eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam 
voluptua [@hawking_thermodynamics_1983\hc578]. 

这是令人不快的结果: @egreg

有没有人有线索?

0 个答案:

没有答案