R markdown link is not formatted blue when knitted to pdf R markdown link is not formatted blue when knitted to pdf r r

R markdown link is not formatted blue when knitted to pdf


Add urlcolor: blue to the yaml.

---title: "R Notebook"output:  pdf_document: default  html_notebook: defaulturlcolor: blue---```{r, echo=F}# tex / pandoc options for pdf creationx <- 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

enter image description here


To elaborate on the answer by @eipi10, and to answer a question in the comments by @Maarten Punt, the urlcolor is specifying the color for URL links referenced in the doc. However you might have links to other sections in your document, specified by linkcolor. So you can specify either:

---title: "R Notebook"output:  pdf_document: defaulturlcolor: bluelinkcolor: 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)```

enter image description here

The red is a link within the document, whereas the blue is a URL link.