# How to use \cancel command

I want to use \cancel command in TeXnicCenter but it is giving error while using that..

Basically I want to show cancellation of 2 with 2, using \frac.

Like: \frac{2}{2} but I want to show it like: $$\frac{\cancel{2}}{\cancel{2}}$$.

And I am unable to do it, can anybody please tell me how to do it..

• Did you load the cancel package? Apr 9 '13 at 7:23
• @Gurpreet As with every package: \usepackage{cancel} Apr 9 '13 at 20:31
• to new users it is not obvious that \cancel comes from the cancel package. i found this question (and the answer) very helpful and am surprised it was closed as "too localized." please re-open. Sep 15 '17 at 15:08
• @dbliss Why reopen? Reopening is for allowing more answers. There is an answer with the cancel package and with screenshot and explanation. No need to encourage writing further answers (again about making \cancel work with cancel package). Simply no need to open as no solution is prevented as the meaningful one has been given. Closed does not mean bad but answering closed. Sep 17 '17 at 3:40
• @StefanKottwitz in terms of practical effect, i don't have too much of a case to make. all i'd say is that new users might see this question and infer that questions like this are discouraged by the site, which seems to me wrong. and then technically, if the goal is just to prevent more answers, should the question be "protected" rather than "closed"? in the end, i don't care enough to have a meta debate about this minor issue. Sep 17 '17 at 11:12

\documentclass[preview,border=12pt,varwidth]{standalone}
$\frac{a\bcancel{b}}{\bcancel{b}}=a$

• \abovedisplayskip=0pt and \documentclass[preview,border=12pt,varwidth]{standalone} are used above just for my own purpose, you do NOT need them. One more \bcancel can be used not only for b but also for other charactes such as \bcancel{x} and \bcancel{y}. Apr 9 '13 at 7:35