I have an inlinetodo macro/command that is defined depending on a toggle:
\nottoggle{disableAnnotations}{
\NewDocumentCommand \inlinetodo {m}{\pdfmarkupcomment[color=yellow]{[TODO: #1]}{}}
}{
\NewDocumentCommand \inlinetodo {m}{}
}
As you see, the command does not make anything if disableAnnotations is enabled. But that is not entirely true. If I have
This is the first line.
\inlinetodo{Explain the issue here!}
Last line here.
Then there will be a larger space between "…first line." and "Last line…".
How can I avoid the space, so that the result will be equal to
This is the first line.
Last line here.
if annotations are disabled?

\inlinetodo{Explain the issue here!}%. See https://tex.stackexchange.com/questions/7453/what-is-the-use-of-percent-signs-at-the-end-of-lines-why-is-my-macro-creat for more information – samcarter_is_at_topanswers.xyz Apr 13 '23 at 15:43inlinetodo as meaning what it says. I have tried a similar command with\ignorespacesbut it gobbles one one side. I will delete my prior comment. – rallg Apr 13 '23 at 16:33\@bsphack\@esphack, whereas Ulrike's answer here lists several options, from which I went with a particular one that I refined to\ifhmode \unskip{} \fi. And from what I can tell\@bsphack\@esphackhas some issues if it appears right after another\@bsphack\@esphacksequence. – Flow Apr 14 '23 at 09:43