I have tried the example in this post to censor some parts of my text. It works as long as I'm not using the soul package in conjunction with the todonotes package. What can I do to make both packages work together? Here is the latex code:
Code: Select all
%this example only works if commenting out '\usepackage{todonotes}'
\documentclass{scrbook}
\usepackage{soul}
\newlength{\tokwidth}
\newcommand{\black}[1]{%
\settowidth{\tokwidth}{#1}%
\rule[-.2\baselineskip]{\tokwidth}{\baselineskip}}
\makeatletter
\DeclareRobustCommand{\secret}{%
\def\SOUL@everytoken{\black{\phantom{\the\SOUL@token}}}\SOUL@}
\makeatother
\usepackage{todonotes}
\begin{document}
the word \secret{test} is secret
\end{document}
Code: Select all
! Package soul Error: Reconstruction failed.
See the soul package documentation for explanation.
Type H <return> for immediate help.
...
l.16 the word \secret{test}
is secret