1

First, I have a .Rmd file using knitr to generate a pdf, it only contains a link:

---
title: "My Title"
author: "my name"
date: "2020/2/6"
output: pdf_document
linkcolor: blue   
urlcolor: blue  
citecolor: blue  
---

[Stack Overflow](https://stackoverflow.com/)

and output is :

enter image description here

How can I change its pattern to default LaTeX style like:

enter image description here

Whatever it is a link, url or a cite, how to change it to LaTeX style with red or green boxes above?

Thanks!

song.xiao
  • 179
  • 9

1 Answers1

2

Normally these boxes are shown by default. Unfortunately rmarkdown disables them, but you can undo the the changes made by rmarkdown:

---
title: "My Title"
author: "my name"
date: "2020/2/6"
output: 
  pdf_document:
    keep_tex: true
header-includes:
    - \hypersetup{colorlinks = false,pdfborder={1 1 1}}
---

[Stack Overflow](https://stackoverflow.com/)
  • Do you know how to [create citations to references with a hyperlink](https://stackoverflow.com/questions/60087346/in-r-markdown-how-do-i-create-citations-to-references-with-a-hyperlink) ? – song.xiao Feb 06 '20 at 09:33