[Tex/LaTex] Package todonotes: Display a \todo only the \listoftodos

todonotes

I know the todonotes package gives me nolist option when calling \todo in order to hide a given entry from the \listoftodos.

However, I can't find a way in the documentation to do the opposite of this. I'd like to add an entry to the list without having something appear later on where I place the \todo itself. Is this possible?

Best Answer

You have two possibilitys:

  1. You can print all text in the margin completely in white with

    \newcommand{\mytodo}[1]{%
      \todo[linecolor=white, backgroundcolor=white,bordercolor=white, textcolor=white]{#1}%
    }
    
  2. You can fool todonotes and create the entry in the list of to dos by your own:

    \newcommand{\mysectodo}[1]{%
      \addcontentsline{tdo}{todo}{#1}%
    }
    

With the following complete code

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage{todonotes}
\usepackage{blindtext}

\newcommand{\mytodo}[1]{% <==========================================
  \todo[linecolor=white, backgroundcolor=white,bordercolor=white, textcolor=white]{#1}%
}

\newcommand{\mysectodo}[1]{% <=======================================
  \addcontentsline{tdo}{todo}{#1}%
}

\begin{document}

\listoftodos

test \todo[inline]{some fixme notes about this text 1}
\blindtext
\todo{some fixme notes about this text 2}
\blindtext
\textbf{test} 
\mytodo{some fixme notes about this text 3} % <================
\textbf{test} \blindtext
\emph{test} 
\mysectodo{some fixme notes about this text 4} % <=============
\emph{test} \blindtext
\todo{some fixme notes about this text 5}
\blindtext

\end{document}

you get the result:

result

As you can see in the image above (yellow part, marked with 3) the \mytodo is not visable, but it tooks place (*could be a problem with more \todos). Marked with 4 you can see the place where I added command \mysectodo. It needs no place in the margin, but writes the entry in the list of todos ...

Related Question