# How to cross-out a number several times?

Hello. I want to be able to cross out a number several times (just like in the picture!) at least 3 times. How do i do that? And how do i make a circle around a number?

The crossout commands are \crossout, \dcrossout, \tcrossout, and \qcrossout, for 1,2, 3, and 4 strokes respectively.

\documentclass{article}
\usepackage{stackengine}
\newcommand\rawcrossout[2]{\stackengine{0pt}{#1}{#2}{O}{c}{F}{T}{L}}
\def\XX{\kern-3pt/}
\newcommand\crossout[1]{\rawcrossout{#1}{/}}
\newcommand\dcrossout[1]{\rawcrossout{#1}{/\XX}}
\newcommand\tcrossout[1]{\rawcrossout{#1}{/\XX\XX}}
\newcommand\qcrossout[1]{\rawcrossout{#1}{/\XX\XX\XX}}
\begin{document}

2 4 6 70 86
\end{document}


While an \fbox would typically be used for a boxed quantity, it seemed from the application that you might want one that is the same width as the original number, so I also provide \shadowbox{}.

You can use \ooalign (one of my favorite tools to play with):

\documentclass{article}

\newcommand{\crossout}[2][1]{%
\vphantom{\rslash}%
{\ooalign{\hidewidth$\crosses{#1}$\hidewidth\cr$#2$\cr}}%
}

\newcommand{\crosses}[1]{%
\ifcase#1\relax
\or
\rslash\or
\rslash\mskip-5.5mu\rslash\or
\rslash\mskip-5.5mu\rslash\mskip-5.5mu\rslash%
\fi
}
\newcommand{\rslash}{\raisebox{.15ex}{/}}

\begin{document}

\fbox{$2$} \fbox{$3$} \crossout{4} \fbox{$5$} \crossout[2]{6}
\fbox{$7$} \crossout{8} \crossout{9} \crossout[3]{90}

\end{document}


• +1, but there are two flaws. First, #2 is going to be typeset in math mode, i.e. in a different font. Second, because the character to be typeset is in the second “row” of \ooalign, the height of the resulting box is determined by the slashes and not by the character, cf. \fbox{\crossout{\displaystyle\int}}. – Henri Menke Jun 8 '16 at 14:31
• The definition should thus read something like \newcommand{\crossout}[2][1]{\vphantom{\rslash#2}{\ooalign{\hidewidth$\crosses{#1}$\hidewidth\cr#2\cr}}} – Henri Menke Jun 8 '16 at 14:33
• @HenriMenke The slash is certainly bigger than the digits, so the \vphantom sets the depth accurately; if you need to use this also for deeper and higher symbols, add $#2$ in the \vphantom. These are numbers used as numbers, so they should be in math mode. I forgot \$ in \fbox. – egreg Jun 8 '16 at 14:37