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.

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 \begin{equation} ... \end{equation} environment.

share|improve this question

1 Answer 1

up vote 6 down vote accepted
  1. Box the contents in an \mbox that you then use inside equation as a macro.

    enter image description here

    \documentclass{article}
    \usepackage{soul}% http://ctan.org/pkg/soul
    \newcommand{\stI}{\mbox{\st{$I$}}}
    \begin{document}
    \begin{equation}
      f(x)=\stI\times\stI
    \end{equation}
    \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}
    \begin{equation}
      f(x)=\stI\times\stI
    \end{equation}
    \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}
    \begin{equation}
      f(x)=\stI\times\stI
    \end{equation}
    \end{document}
    

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

share|improve this answer
    
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.