The subject line just about says it. If I have ab/b I want to indicate that the b's cancel. On a board I would simply strike them through. How to I do the same in LaTex? I've tagged this as stacking-symbols as I'm guessing that's like the trick but I can't figure out which symbol and how to stack it.
2 Answers
Here's how to do it with cancel:
\documentclass{article}
\usepackage{cancel, amsmath}
\begin{document}
\[ \frac{a\cancel{b}}{\cancel{b}} = a \]%
\end{document}
- 271,350
For completeness, I will mention the \not command. It does not depend on any package, but the strike-through is not always very nice.
It is usually used for operators instead of symbols, so \not\sim, \not\cong, \not\equiv etc.
It can also be used for other symbols, such as \not\exists, but the results are usually unsatisfactory. In this specific case, \nexists from amsmath package is better.
For example, consider the following code
\begin{document}
$$\not\sim\ \not\cong\ \not\equiv\ \not\exists$$
$${\displaystyle\frac{a\not b}{\not b}}\
{\textstyle \frac{a\not b}{\not b}}\
{\scriptstyle\frac{a\not b}{\not b}}$$
\end{document}
It produces the following output: 
You can see that the strike-through in the fractions makes the whitespace around the b ugly in the \displaystyle example, and in the other examples the strikethrough is not through the middle of the b.
For your specific case, the cancel package mentioned above is much better, but in other cases the \not command might help.
- 101
-
Thanks for the followup. I hadn't realized \not could be used with a variety of elements. – TonyK Jun 20 '22 at 21:26

cancelpackage. – Bernard May 29 '22 at 18:22