22

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}

An example of the problem with overlapping lines

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

Solution 1 Solution 2

1
  • 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.
    – mbork
    Feb 24, 2013 at 19:14

1 Answer 1

19

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

Todonotes with the fancyline option.

\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}
5
  • 5
    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, 2013 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?
    – lockstep
    Feb 24, 2013 at 19:15
  • 3
    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
    – midtiby
    Feb 24, 2013 at 20:06
  • 1
    You should consider adding a global option. =] Feb 24, 2013 at 21:56
  • 1
    @AlexHirzel There's now a way, e.g., \presetkeys{todonotes}{fancyline, color=blue!30}{} Dec 1, 2016 at 19:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .