This is a follow-up question on todonotes: How to make multiple listoftodos?
I used the above example to categorize my todo notes (e.g. figures, administrative stuff, laboratory todos...) instead of different reviewers and it works well (using the owner as tag). But now I get trouble using the missingfigure command. I would like to show missing figures only in one category. Instead it is shown on all listoftodos. Would it be possible to add a owner attribute to missingfigure or disable missingfigures from listoftodos?
Or do you have a different idea to realize this?
\documentclass{scrbook}
\usepackage{hyperref}
\usepackage[
textsize=footnotesize,
colorinlistoftodos,
color=orange!10,
bordercolor=orange!90
]{todonotes}
\usepackage{etoolbox}
\usepackage{lipsum}
\presetkeys{todonotes}{inline, color=blue!15, bordercolor=blue!85, size=\scriptsize,
figwidth=0.9\linewidth, figcolor=black!10}{}
\makeatletter
\newcommand\@todonotes@owner{default}
\define@key{todonotes}%
{owner}{\def\@todonotes@owner{#1}}
\newtoggle{ownerdefault}
\newtoggle{owneradmin}
\newtoggle{ownerfig}
\newcommand\adminTodo[1]{%
\todo[%
owner=admin,
author={[Admin]},noline,caption={[Admin]: #1},color=blue!20%
]%
{#1}}
\newcommand\figTodo[1]{%
\todo[%
owner=fig,
author={[Fig]},noline,caption={[Fig]: #1},color=red!50!white%
]%
{#1}}
\renewcommand{\@todonotes@addElementToListOfTodos}{%
\if@todonotes@colorinlistoftodos%
\addtocontents{tdo}
{%
\protect\iftoggle{owner\@todonotes@owner}
{%
\protect\contentsline {todo}
{\protect\fcolorbox{\@todonotes@currentbordercolor}%
{\@todonotes@currentbackgroundcolor}%
{\protect\textcolor{\@todonotes@currentbackgroundcolor}{o}}%
\ \@todonotes@caption
}{\thepage}{\@currentHref}%
}{}%
}%
\else%
\addtocontents{tdo}
{%
\protect\iftoggle{owner\@todonotes@owner}
{%
\protect\contentsline {todo}
{\@todonotes@caption
}{\thepage}{\@currentHref}%
}{}%
}%
\fi}%
\makeatother
\begin{document}
\todo{some uncategorized todo}
\lipsum[1]
\figTodo{This is a todo in category figure}
\lipsum[1]
\adminTodo{This is a todo in category administrative stuff}
\lipsum[1]
\missingfigure{missing figure}
\toggletrue{owneradmin}
\section*{Administrative ToDos}
\InputIfFileExists{\jobname.tdo}{}
\toggletrue{ownerfig}
\togglefalse{owneradmin}
\section*{Figure ToDos}
\InputIfFileExists{\jobname.tdo}{}
\togglefalse{ownerfig}
\toggletrue{ownerdefault}
\section*{ToDos}
\InputIfFileExists{\jobname.tdo}{}
\togglefalse{ownerdefault}
\makeatletter \@starttoc{tdo}\makeatother % to trigger the creation of the list
\end{document}
\documentclass,\begin{document}and\end{document}. This way we can just copy/paste the code and go straight into solving the problem without resorting to wild guesses about what you really are asking. – Andreas Storvik Strauman Jun 25 '18 at 16:56