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.

Let's say that I want to cancel the denominator of a fraction and also assign him a value. Something like that \cancel{2}\cdot\dfrac{9}{\cancelto{2}{4}}. The problem here is that the fraction doesn't look good at all after that. So I need a cancelto command that creates a downward arrow. Is there any way to do it?

share|improve this question
add comment

2 Answers

To change the arrow direction you need to rewrite most of the internals of the cancel package. I would NOT recommend that, because it is very complicated code. May be you can try some other options such as



share|improve this answer
add comment

With the help of TikZ you can define a command to cancel an expression using a downward arrow:



  \begin{tikzpicture}[baseline=(current bounding box.center).anchor=west]
    \node[anchor=east,inner sep=2pt] (a) {#2};
    \draw[->] ($(a.north west)+(1pt,-2pt)$) -- ($(a.south east)+(0pt,2pt)$) node at ($(a.south east)+(4pt,1pt)$) {$\canc{#1}$};


\[ \Dcancelto[1]{7} \]

\[ \frac{1}{\Dcancelto[2]{4}} \]

\[ \frac{89}{\Dcancelto[0]{4367}} \]

\[ \cancel{2}\cdot\dfrac{9}{\Dcancelto[2]{4}} \]


Here's the result:

share|improve this answer
thanks for the great answer, I´ve also modified {#2} to {$ #2 $} in \node[anchor=east,inner sep=2pt] (a) {#2}; to work properly with math expressions like fractions –  escalator Apr 11 at 10:46
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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