I have to agree with everybody else that you should probably just add the %
, but I do find this question interesting. The problem is that as soon as LaTeX reads the empty line, it gets converted into the \par
command, which ends the previous paragraph. At the beginning of \todo
, that \par
command has already been executed, and it's impossible to undo it (I think). So your only hope is to keep that \par
from being inserted or from behaving like it normally does. If you want to prevent it from being inserted, you could try reading Chapter 8 of "The TeXbook", which should tell you how an empty line is converted to \par
. Alternatively, you could try to make a solution based on the following kind of idea:
Some text.{\let\par\relax
\todo{make note}}
But watch out! You definitely don't want to globally change the behavior of \par
, which is why I added an extra pair of curly braces (LaTeX commands are scoped, so the new definition of \par
only takes effect within the group where the definition was made). Good luck.