4

I'd like to handle some todos differently than others by defining a new command for them that makes them hidden in the list of todos. Just setting the caption to empty does not suffice (the entry remains just without any text beside the ellipsis and page number).

NWME:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{todonotes}
\presetkeys{todonotes}{inline}{}
\newcommand\todohidden[2][]{%
    \todo[inline, caption={}, #1]{%
        #2%
    }%
}

\begin{document}

\listoftodos

\vspace{0.5\textheight}
\todo{Normal todo}
\todohidden{Hidden todo}

\end{document}
2
  • 1
    The package doc says: \todo[nolist]{} will do. Commented Jan 25, 2018 at 12:05
  • 1
    Indeed, I missed that :( If you simply re-post the MWE with the caption keyval replaced with nolist I am happy to accept it as answer :)
    – stefanct
    Commented Jan 25, 2018 at 13:09

1 Answer 1

6

The todonotes package provides the option nolist for the \todo command which will hide the note from the list of todos (see package documentation, page 6):

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{todonotes}
\presetkeys{todonotes}{inline}{}
\newcommand\todohidden[2][]{%
    \todo[inline, nolist, #1]{%
        #2%
    }%
}

\begin{document}

\listoftodos

\vspace{0.5\textheight}
\todo{Normal todo}
\todohidden{Hidden todo}

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .