# Todo and rmd-generated LaTeX document

How to use the todo package in R Markdown-generated LaTeX documents?

To load packages, it is possible to add them to the document's header with header-includes:. This successfully works with \usepackage{hyperref} and its styling (\hypersetup{colorlinks=true}), but doesn't seem to allow to add inline todo{}s.

---
title: "Untitled"
author: "Test"
date: "7/24/2017"
output: pdf_document
- \usepackage{todo}
- \usepackage{hyperref}
---

[Link styling works](www.example.com) but \todo{todo does not}.


which generates

• Maybe you want to use really the package todonotes? – Fran Jul 24 '17 at 10:01
• Anyway the problem is not related in with Rmarkdow but with the todo package, that do not make the automatic internal \label{todolbl:1} . – Fran Jul 24 '17 at 10:15
• @Fran Any workaround? – Francesco Jul 24 '17 at 13:24
• Look like a bug of the package, but you can insert the \label{todolbl:1}, \label{todolbl:1}, etc. manually. But what I would do is just change "todo" by "todonotes" in the YAML header and add \listoftodos at the end of the .Rmd file. – Fran Jul 25 '17 at 8:26
• @Fran Yes, this seems a good solution (answer) to me – Francesco Jul 25 '17 at 8:28

A good alternative is use the \todo command but from the todonotes package. Example:

---
title: "Untitled"
author: "Test"
date: "7/24/2017"
output: pdf_document