GeneralPackage Conflict due to new Command

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
GBase
Posts: 1
Joined: Thu Nov 28, 2013 3:21 pm

Package Conflict due to new Command

Post by GBase »

Hi everyone,

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}
This is the error message that I get.

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
P.S. both package versions are up-to-date
Last edited by Stefan Kottwitz on Thu Nov 28, 2013 10:03 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

Post Reply