# How can I strikethrough a character in an equation?

I'm trying to create an equation where the letter "I" has a horizontal line through it. The only name I know for this action is "strikethrough" but I'm not sure if this would be correct when dealing with equations specifically; I don't want the line to be too long.

I've tried the ulem, soul, sout and cancel but none of these seem to work inside a ... environment.

-

1. Box the contents in an \mbox that you then use inside equation as a macro.

\documentclass{article}
\usepackage{soul}% http://ctan.org/pkg/soul
\newcommand{\stI}{\mbox{\st{$I$}}}
\begin{document}
$$f(x)=\stI\times\stI$$
\end{document}

2. A slightly more verbatim boxing technique is to set everything inside a box using lrbox and then just use the box via \usebox:

\documentclass{article}
\usepackage{soul}% http://ctan.org/pkg/soul
\newsavebox{\strikeoutI}
\begin{lrbox}{\strikeoutI}\st{$I$}\end{lrbox}
\newcommand{\stI}{\usebox{\strikeoutI}}
\begin{document}
$$f(x)=\stI\times\stI$$
\end{document}

3. Use \ooalign to overlay symbols (an $I$ and a horizontal rule):

\documentclass{article}
\newcommand{\stI}{%
\ooalign{\hidewidth $I$\hidewidth\cr\rule[.5ex]{1ex}{.4pt}}}
\begin{document}
$$f(x)=\stI\times\stI$$
\end{document}


See \subseteq + \circ as a single symbol (“open subset”) for a short course in \ooalign.

-
Thank you Werner for your comprehensive answer! For my needs, option 3 from your list was the most appropriate as it allows the horizontal line to be made less wide but also to be moved up or down the character "I" in order to not clash with sub/superscripts. –  user16307 Aug 4 '12 at 14:08