Possible Duplicate:
Draw a diagonal arrow across an expression in a formula to show that it vanishes

In a course book I'm currently reading, the author uses notation typeset in LaTeX (or some other TeX flavour...) that I usually use when writing by hand, but never thought was possible with TeX: he "crosses out" terms in an equation with an arrow and the number 0, indicating that they go to zero and will be ignored.

For example, this notation is used when linearizing equation, to show which higher order terms are ignored in the coming analysis. It basically looks like a long, slanted arrow (a / with an arrowhead) that reaches from a little below the line to a little above the line, with the arrowhead upwards and a small 0 at the tip. I realize this description is pretty vague, but it's probably the best I can do without paint :P

How do I accomplish this in LaTeX?

(I usually use pdflatex or xelatex to compile, so it should preferrably be compatible with either of those flavours...)

  • 1
    Feel free to use paint! Commented Oct 12, 2011 at 12:30

3 Answers 3


Take a look at the cancel package, which provides \cancelto{<value>}{expression}. Minimal example:


enter image description here

  • I copy pasted exactly what you wrote between the \[ ... \] but it says the control sequence is undefined. Is that weird or do I need to import some package for it to work? Commented Nov 14, 2016 at 15:58
  • 2
    @CharlieParker In my example there is precisely one package loaded, and that is required for \cancelto to work. That is also stated above the code example. Commented Nov 14, 2016 at 16:05

Presumably, this is for a talk, in which case you (or someone else) might be interested in a beamer-ized version of \cancelto:


\renewcommand{\CancelColor}{\color{red}} %change cancel color to red

\let\my@cancelto\cancelto %copy over the original cancelto command
% redefine the cancelto command, using \phantom to assure that the
% result doesn't wiggle up and down with and without the arrow


} %use the new cancelto command


which results in

enter image description here

(the scalebox stuff is just so the resulting figure is small, but the important parts still legible...)

The other commands can be similarly beamer-ized, but this is left as an exercise for the user...

  • Not what I was looking for this time, but definitely nice for future reference! Commented Oct 12, 2011 at 20:05
  • What's the <> in \newcommand<> do? Is that valid syntax? Commented May 4, 2020 at 12:27

Invoke the package \usepackage{cancel} then use the following command \cancelto{0}{x} in math mode where x is being cancelled to the number zero. A \cancel{x} cross the term out without any number.


Not the answer you're looking for? Browse other questions tagged .