# Overlapping todonotes

When adding several notes on the same line using todonotes and then one note on the line behind them, its impossible to see which notes belong to which line since the line connecting each textbox to the corresponding piece of text overlap. I made a minimal example below. Is there any way to automatically solve this problem using todonotes or any similar package?

\documentclass[10pt,a4paper]{article}
\usepackage{todonotes}
\usepackage{lipsum}

\begin{document}

\todo{Lorem}\textbf{Lorem} \todo{ipsum}\textbf{ipsum} \todo{dolor}\textbf{dolor}
sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore
et dolore magna aliqua. Ut enim ad \todo{minim}\textbf{minim} veniam, quis nostrud
exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

\end{document}


A couple of acceptable solutions (which I do not node how to obtain in LaTeX) is the following:

• From what I suspect seeing your question (and midtiby's cool answer), implementing your ideas for solution within existing todonotes code might be quite difficult. Feb 24 '13 at 19:14

There is the option 'fancyline' for the todo commands. With it the notes now appear as follows. Personally I prefer the default behaviour.

\documentclass[10pt,a4paper]{article}
\usepackage{todonotes}
\usepackage{lipsum}

\begin{document}

\todo[fancyline]{Lorem}\textbf{Lorem} \todo[fancyline]{ipsum}\textbf{ipsum}
\todo[fancyline]{dolor}\textbf{dolor} sit amet, consectetur adipisicing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
\todo[fancyline]{minim}\textbf{minim} veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat.

\end{document}

• Might want to mention that "This does require two runs. First one to determine the locations, and the second to do the drawing.". This won't be obvious to new users. Feb 24 '13 at 18:58
• @midtiby (Henrik Skov Midtiby --author of todonotes --, I suppose): How can one enable the fancyline behaviour globally (for all notes) in the preamble? \presetkeys{todonotes}{fancyline}{} seems like a low-level-hack -- is there a package option I'm missing? Feb 24 '13 at 19:15
• Well todonotes is my package ;-). Regarding your question, there is currently no global option for enabling fancyline for all todos. You can redefine the todo command with the following code to set fancyline as default. \makeatletter \renewcommand{\todo}[2][]{\@bsphack\@todo[fancyline,#1]{#2}\@esphack\ignorespaces}% \makeatother Feb 24 '13 at 20:06
• You should consider adding a global option. =] Feb 24 '13 at 21:56
• @AlexHirzel There's now a way, e.g., \presetkeys{todonotes}{fancyline, color=blue!30}{} Dec 1 '16 at 19:40