# Cross out with arrow as in “goes to zero” [duplicate]

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...)

-

## marked as duplicate by Matthew Leingang, Loop Space, lockstep, topskip, Torbjørn T.Oct 12 '11 at 18:00

Feel free to use paint! –  Loop Space Oct 12 '11 at 12:30

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

\documentclass{article}
\usepackage{cancel}
\begin{document}
$\cancelto{0}{x}$
\end{document}


-
Fantastic - exactly what I'm looking for! –  Tomas Lycken Oct 12 '11 at 12:41

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.

-
If I could accept two answers, I would =) –  Tomas Lycken Oct 12 '11 at 12:41

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

\documentclass{beamer}
\usepackage{mathtools,cancel}

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

\makeatletter
\let\my@cancelto\cancelto %copy over the original cancelto command
\newcommand<>{\cancelto}[2]{\alt#3{\my@cancelto{#1}{#2}}{\mathrlap{#2}\phantom{\my@cancelto{#1}{#2}}}}
% redefine the cancelto command, using \phantom to assure that the
% result doesn't wiggle up and down with and without the arrow
\makeatother

\begin{document}
\begin{frame}

\scalebox{5}{
$\cancelto<2>{0}{x}(1-x)=0$
} %use the new cancelto command

\end{frame}
\end{document}


which results in

(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! –  Tomas Lycken Oct 12 '11 at 20:05