[Tex/LaTex] Coloring the cancellation line with \cancel

cancelcolormath-mode

I would like the strike-out line colored grey when using the \cancel command from the cancel package.

The code…

\documentclass{article}

\usepackage{cancel}

\begin{document}

$$a+\cancel b+c$$

\end{document}

… gives this output:

enter image description here

Can this cancellation line be made weaker in the colour, for example grey, while the math itself remains black?

Best Answer

Using \renewcommand{\CancelColor}{\color{whatevercoloryoulike}} should help!

I suggest to use the thicklines option to the package as well:

\documentclass{article}

\usepackage{xcolor}
\usepackage[thicklines]{cancel}

\renewcommand{\CancelColor}{\color{lightgray}}

\begin{document}

\[a+\cancel{b}+c\]

\end{document}

enter image description here

Related Question