Cancelling Terms in LaTeX
November 9, 2005 – 10:26 pmI found a new LaTeX package the other day, known as cancel, which allows me to either strike through or zero out a term in an equation. For example, if I want to strike through a term in an equation, I can get an effect that looks like

with the following source code:
\[
a + b + \cancel{c} = \cancel{c} + d + e
\]
I can also zero out a term in an equation, to get an effect like

with the following source code:
\[
a + b + \cancelto{0}{c} = d + e
\]
All that is required is to add \usepackage{cancel} to my LaTeX’s document preamble, and the rest is history.
12 Responses to “Cancelling Terms in LaTeX”
Nice, that’s a useful one!
By Paul.za on Nov 10, 2005 at 12:06 pm
I wonder. Is there a way to have the cancel to X go down instead of up? I’ve always liked to have things that cancel to zero go down, things that cancel to one go up. What does it look like if you cancel multiple terms? $\cancelto{0}{a+b+c}$? (Too lazy to fire up a terminal right now and find out for myself.)
By Adam on Nov 10, 2005 at 4:29 pm
Thanks, I stumbled over this a couple of days back, while trying to figure out how to strike through text - it’s \sout, btw - but could use this to cancel out terms in some equations, too. This makes it easier to make out what’s going on in those equations.
By Karsten on Nov 15, 2005 at 4:51 pm
I’m glad this was helpful to you. I have found from my LaTeX experience that if something does not seem possible using LaTeX proper, there is usually a third-party package somewhere that accomplishes something very close to, if not exactly, what you are looking for.
I’m still hunting around for a good way to use the split environment inside the align environment. If you happen to find that one out, let me know.
By jjk on Nov 15, 2005 at 6:18 pm
hello \jeff{krimmel}
your page was a great help, thats exactly what I was looking for. thanks !
few more, if you’d have an idea:
i ) these cancellation are pointing northeast, say I want a cancellation pointing northwest. How do we do it ?
ii) I am working in an equation mode where there are 3 terms(say). Further, I make a 2nd line (again with 3 terms) and now, I want arrows pointing from each respective term in the first line to the corresponding term in the 2nd line. They may be diagonal, for the width of the terms in the 2nd line is longer. hope you are on the same page here
Any idea how to do ?
thanks
ps: pl feel free to email me the solutions.
By Manish on Jun 3, 2006 at 9:21 pm
hi !
dropping another query, hoping you’ll be able to reply all together:
I am writing an equation which is longer than 1 page. I assuemed that Latex would split it accordingly keeping text height in mind. but, the equation is put nastily untill the edge of the page and is being cut therefore. is there a way to make a smooth transition of the equation to flow from one page to the another.
doing it manually won’t help as one may not know where to break/split it. any help shall be appreciated
thnks
Manish
manish@math.mun.ca
By Manish on Jun 4, 2006 at 12:04 pm
Hi Manish. Regarding your first question, you can use
\bcancelinstead of\cancel. It doesn’t look like there is a\bcancelto.You can, however, look at the file
cancel.styon your system, and you can edit it to create your own\bcanceltocommand. There might be a good reason the author of the cancel package didn’t include it by default. Who knows.As far as getting arrows to point from one line of equations to the next, I don’t know. I’ve not had to do that before.
And with the long equation question, I’m not sure what’s happening. Are you using the
splitenvironment inside yourequationenvironment? Are you even using anequationenvironment, or have you cobbled together a trick? I would think if you usesplit, you would be able to create as many lines within the equation as you need, and it would flow smoothly from one page to the next. Maybe it doesn’t.By jjk on Jun 5, 2006 at 10:15 am
The package
canceldoes not work when using the packageqtree.By pyfg on Sep 9, 2007 at 12:47 pm
Nor does it work together with the eepic package. The commands are simply ignored.
By sfreson on Feb 20, 2008 at 6:10 am
Does anyone know how to use \sout? As in what packages to include?
By shaunak on Feb 27, 2008 at 10:49 am
A simple Google search for “latex sout” led me to
http://newslab.csie.ntu.edu.tw/resources/tipsonlatex.htm
It’s part of the ulem package. You just do \sout{text through which you would like a strike}. That’s it.
By jjk on Feb 27, 2008 at 10:55 am
thanks a lot!
By lucas reddinger on Feb 27, 2008 at 11:55 am