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.

Is there any command or macro for printing a character with a cross over it?

share|improve this question
    
Are you referring to something like cancelling? As in How to strike through obliquely, e.g. to indicate cancellation? –  Werner Sep 3 at 13:12
    
I need a double stroke, like a big X across a C. –  user56153 Sep 3 at 13:14

1 Answer 1

up vote 8 down vote accepted

With tikz anything is possible if you are determined.

\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{shapes}

\newcommand*{\mycancel}[2][draw]{%
\begin{tikzpicture}
  \node[cross out,inner sep=0.5pt,outer sep=0pt,#1]{#2};
\end{tikzpicture}
}

\begin{document}
  \mycancel[draw=red]{C} \mycancel{$\alpha$}
\end{document}

enter image description here

But there is already a package for it and you can use it in math mode.

\documentclass{article}

\usepackage{cancel,color,amsmath}

\begin{document}
  $\xcancel{C}$

  \renewcommand{\CancelColor}{\color{red}}
  $\xcancel{C}$

  $\xcancel{\text{C}}$

\end{document}

enter image description here

share|improve this answer
    
Thank you, Harish, it's perfect! –  user56153 Sep 3 at 13:39

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.