Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

share|improve this question

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

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

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

3 Answers 3

up vote 20 down vote accepted

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}

enter image description here

share|improve this answer
    
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.

share|improve this answer
    
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

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

share|improve this answer
    
Not what I was looking for this time, but definitely nice for future reference! –  Tomas Lycken Oct 12 '11 at 20:05

Not the answer you're looking for? Browse other questions tagged or ask your own question.