Is there a way to create a negative slope with the cancel
package, but using \cancelto
? i.e. I would like to combine the two commands so that I have a negative slope but with an arrow and number.
Thanks!
MWE:
\documentclass{journal}
\usepackage{cancel}
\begin{document}
\[
\cancelto{0}{X^2}
\]
\[
\bcancel{X^2}
\]
%$\bcancelto{0}{X^2}$
\end{document}
Best Answer
I assume this is what you are after:
This was achieved by first patching the
\canto@vector
command to change modify the script placement based on the sign of the y component of the vector (given by#4
). Then,\@cancelto
was renewed with an optional parameter. If blank, the standard behavior would be achieved. If a-
is passed, then the vector is pointed downward. Finally, the\bcancelto
command was created, assuming the defaultsmaller
option is used (Smaller
orsamesize
would require an alternative definition to modify the script size used).Your modified MWE:
As a note, I'd recommend using the
makeroom
option to accommodate the arrow head for the\bcancelto
.