Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 3 down vote accepted

Too long for a comment.

The second answer in that thread is a working example.

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} 

enter image description here

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.