Based on the two examples here, the inline form of \todo is modified to allow truly inline todos. However, if the \todo is on a line by itself, a Bad space factor (0). error is generated (sometimes, see code below). Is there a way to have the command work in either context?


%%% https://tex.stackexchange.com/questions/329701/todonotes-how-to-make-literally-inline-notes-without-line-breaks
\tikzstyle{inlinenotestyle} = [
    line width=0.5pt,
    inner sep = 0.8 ex,
    rounded corners=4pt]

        {\begin{tikzpicture}[remember picture,baseline=(current bounding box.base)]%
            \draw node[inlinenotestyle,font=\@todonotes@sizecommand, anchor=base,baseline]{%
                {\noindent \@todonotes@sizecommand \@todonotes@author:\,\@todonotes@text}%
                {\noindent \@todonotes@sizecommand \@todonotes@text}%

This is \todo[inline]{fine}.

The following breaks if the line above is commented out.

\todo[inline]{a test}
  • You can use \leavevmode\todo[inline]{a test} (but it looks like a bug in todonotes placing of @esphack I think. (incidentally you are defining \mytodo but not using it – David Carlisle Jan 13 '18 at 20:56

You can use \leavevmode\todo[inline]{a test}

but it looks like a bug in todonotes placing of \@bsphack

Yyou are defining \mytodo (copied from the previous answer) but not using it, using \mytodo instead of \todo[inline] would also fix the problem as it avoids the use of \@bsphack.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.