4

I use the following package

\usepackage{todonotes}

for my thesis.

It's working very well so far.

\todo[inline]{Todo #1: comments/ todos about status for professor or lecture}
\todo{Todo #2: comments for internal use. Just for me.}

Now I would like to set todos of category #2 as invisible temporarily.

But I don't want to touch all todos separately.

Is there any possibility with

\renewcommand{}[]{}

or something like that?

Here the minimal example:

\documentclass[%
]{scrreprt}

\usepackage{blindtext}  %lorem ipsum
\usepackage[colorinlistoftodos, ngerman]{todonotes}

\begin{document}

% list of todos
\listoftodos{}

% lorem ipsum
\blindtext
%Todo #1: comments/ todos about status for professor or lecture
\todo[inline]{Todo \#1: comments/ todos about status for professor or lecture}
% lorem ipsum
\blindtext
%Todo #2: comments for internal use. Just for me.
\todo{Todo \#2: comments for internal use. Just for me.}
% lorem ipsum
\blindtext

\end{document}

The post (in German) at golatex.de: http://golatex.de/viewtopic,p,79718.html#79718

2
  • Welcome to TeX.SX! Could you post a full working example? Compilable but minimal.
    – LaRiFaRi
    Commented Jan 13, 2016 at 10:00
  • I added a minimum example.
    – OKraftDD
    Commented Jan 13, 2016 at 10:45

1 Answer 1

2

You can have a look at the source code of the todonotes packages here on Github. In the file todonotes.dtx, on line 1618, todonotes defines the command \@todonotes@drawMarginNoteWithLine which prints the non-inline note. A simple way to remove all non-inline notes is to redefine this command to do nothing:

% Don't print any [non-inline] notes
\makeatletter
\renewcommand{\@todonotes@drawMarginNoteWithLine}{}
\makeatother

There is one problem with this approach: The ToDo note is still shown in the List of ToDo's. The command which adds items to the List of ToDo's is defined on lines 1649ff. To remove the non-inline notes, you can add an \if clause, which checks whether the current ToDo note is [inline] or not, and only call the command if it is inline:

% Remove [non-inline] notes from List of Todo's
\makeatletter
\renewcommand{\@todonotes@addElementToListOfTodos}{%
    % New: check if note is [inline]
    \if@todonotes@inlinenote%
    % if yes: print!, if no: do nothing
    \if@todonotes@colorinlistoftodos%
    \addcontentsline{tdo}{todo}{%
        \fcolorbox{\@todonotes@currentbordercolor}%
        {\@todonotes@currentbackgroundcolor}%
        {\textcolor{\@todonotes@currentbackgroundcolor}{o}}%
        \ \@todonotes@caption}%
    \else%
    \addcontentsline{tdo}{todo}{\@todonotes@caption}%
    \fi%
    \else%
    \fi}%
\makeatother
1
  • Wow, that's great and exactly what I need. Thank you so much for your quick answer!
    – OKraftDD
    Commented Jan 13, 2016 at 11:22

You must log in to answer this question.

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