Tri*_*mus 29 pdf markdown r r-markdown
由于某种原因,我的R降价(rmd)中的链接没有格式化为蓝色.将下面的简单rmd编织为pdf会使文本颜色变黑.只有当它悬停在它上面时才会意识到它实际上是一个链接.将它编织成html将使链接变为蓝色.当然我可以使用乳胶包装但我不知道为什么会这样?
sessionInfo()R版本3.3.0(2016-05-03)平台:x86_64-w64-mingw32/x64(64位)运行于:Windows 7 x64(build 7601)Service Pack 1通过命名空间加载(并未附加) ):knitr_1.15
RStudio 1.0.44
---
title: "R Notebook"
output:
pdf_document: default
html_notebook: default
---
```{r, echo=F}
# tex / pandoc options for pdf creation
x <- Sys.getenv("PATH")
y <- paste(x, "E:\\miktex\\miktex\\bin", sep=";")
Sys.setenv(PATH = y)
```
[link](www.rstudio.com)
Run Code Online (Sandbox Code Playgroud)
eip*_*i10 60
添加urlcolor: blue到yaml.
---
title: "R Notebook"
output:
pdf_document: default
html_notebook: default
urlcolor: blue
---
```{r, echo=F}
# tex / pandoc options for pdf creation
x <- Sys.getenv("PATH")
y <- paste(x, "E:\\miktex\\miktex\\bin", sep=";")
Sys.setenv(PATH = y)
```
[Link to R Studio](www.rstudio.com)
Bare urls will also be highlighted:
http://www.rstudio.com
Run Code Online (Sandbox Code Playgroud)
Dyl*_*mes 11
为了详细说明@eipi10 的答案,并回答@Maarten Punt 评论中的问题,urlcolor指定文档中引用的 URL 链接的颜色。但是,您可能有指向文档中其他部分的链接,由linkcolor. 所以你可以指定:
---
title: "R Notebook"
output:
pdf_document: default
urlcolor: blue
linkcolor: red
---
## test links vs urls
* see [the relevant section](#test)
[link](http://www.rstudio.com)
```{r cars}
summary(cars)
```
\newpage
## Including Plots{#test}
You can also embed plots, for example:
```{r pressure, echo=FALSE}
plot(pressure)
```
Run Code Online (Sandbox Code Playgroud)
红色是文档内的链接,而蓝色是 URL 链接。