1
votes

When I knit the following Rmd file to pdf, the # in the link to the bookdown book is converted to %23 and doesn't work. The link works fine if the Rmd is knitted to html instead of pdf.

I tried escaping the # with \ and \\; neither worked.

---
output: pdf_document
urlcolor: blue
---

This link does not work in the rendered pdf:

https://bookdown.org/yihui/bookdown/markdown-syntax.html#inline-formatting


Is there any way to get such a link to work in a rendered pdf document?

1
Try encasing the link in \url{} like this: \url{https://bookdown.org/yihui/bookdown/markdown-syntax.html#inline-formatting}, and see if that works. You may have to include \usepackage{hyperref} in your .Rmd as well.Justin Singh-M.
@JustinSingh Thanks for the suggestion... just tried, doesn't work.jtr13
Might be an issue with the PDF viewer? tex.stackexchange.com/questions/555559/…Justin Singh-M.
That's it, thank you! If you write this as an answer, I'll check it.jtr13

1 Answers