编织为pdf时,R markdown链接未设置为蓝色 [英] R markdown link is not formatted blue when knitted to pdf
问题描述
由于某些原因,我的R降价(rmd)中的链接未设置为蓝色.将下面的简单rmd编织为pdf会使文本颜色变为黑色.只有将鼠标悬停在它上面时,才会意识到它实际上是一个链接.将其编织为html将使链接变为蓝色.我当然可以使用乳胶包装纸,但我想知道为什么会这样吗?
for some reason no link in my R markdowns (rmd) is formatted blue. knitting the simple rmd below to pdf is leaving the text color black. only when hovering over it does one realize that it's actually a link. knitting it to html will make the link blue. of course I can use a latex wrapper but I wonder why that is?
sessionInfo()R版本3.3.0(2016-05-03)平台:x86_64-w64-mingw32/x64(64位)在以下环境中运行:Windows 7 x64(内部版本7601)Service Pack 1通过名称空间(未附加)加载:knitr_1.15
sessionInfo() R version 3.3.0 (2016-05-03) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 7 x64 (build 7601) Service Pack 1 loaded via a namespace (and not attached): knitr_1.15
RStudio 1.0.44
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)
推荐答案
在Yaml中添加 urlcolor:blue
.
---
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
这篇关于编织为pdf时,R markdown链接未设置为蓝色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!