For a larger document including many TikZ pictures I am using tikzexternalize and the todonotes package. Based on this question I (re-) defined a command that automatically excludes the todo notes from externalization, which works as expected. However, as my todo notes sometimes span multiple lines I started writing the notes in a seperate line (instead of inline) like this
Next line will be a todo.
\todo{todo goes here}
Text goes on...
Doing this gives me a really annoying double white space that I am trying to get rid of without changing thousands of lines in my LaTeX documents.
The following MWE points out the problem alongside how it looks when defining \tikzexternaldisable
and \tikzexternalenable
right around the \todo{}
\documentclass{report}
\usepackage{tikz}
\usetikzlibrary{external}
\tikzexternalize
\usepackage{todonotes}
\makeatletter
\newcommand{\todoo}[2][]{\tikzexternaldisable\@todo[#1]{#2}\tikzexternalenable}
\makeatother
\begin{document}
\noindent
Hello Hello\newline
Hello
\todoo{wrong spacing}
Hello\newline
Hello
\tikzexternaldisable\todo{proper spacing}\tikzexternalenable
Hello\newline
\end{document}