2

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?

  • Please don't use $$...$$, that's deprecated in LaTeX. Use \[...\] instead – user31729 Jul 28 '17 at 18:26
  • @ChristianHupfer I see... Why on Earth would that easy, fool-proof notation form be made appreciated? – Steeven Jul 28 '17 at 18:35
  • Which one? $$...$$ isn't fool - proof for LaTeX parsing ;-) – user31729 Jul 28 '17 at 18:39
  • @ChristianHupfer A bit more accessible for the mortals among us, I will claim. Anyhow, thank you for the answer. – Steeven Jul 28 '17 at 20:13
3

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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