# crossing out using different colour

How to cross out a sentence using a horizontal line in a colour different from the text?

I found this useful question about how to cross out a sentence, but I cannot figure out how to use colour with this solution. The cancel package allows that, as described here, but would not do a horizontal line.

-

Too long for a comment.

If you want to change the color when using the soul package you can use the command \setstcolor:

\documentclass{article}
\usepackage{soul,xcolor}

\begin{document}

\setstcolor{red}

\st{Some overstruck text}

\end{document}


The ulem package does not support coloring directly, but looking at its manual, you can find that it is possible to define a new command like

\newcommand\redsout{\bgroup\markoverwith{\textcolor{red}{\rule[0.5ex]{2pt}{0.4pt}}}\ULon}


so that

\documentclass{article}
\usepackage[normalem]{ulem}
\usepackage{xcolor}

\begin{document}

\newcommand\redsout{\bgroup\markoverwith{\textcolor{red}{\rule[0.5ex]{2pt}{0.4pt}}}\ULon}

\redsout{Some overstruck text}

\end{document}


produces the same result as the above one.

-