用箭头划掉“归零”

用箭头划掉“归零”

可能重复:
在公式中的表达式上画一个对角箭头,表示它消失

在我目前正在阅读的一本教科书中,作者使用了 LaTeX(或其他 TeX 风格......)排版的符号,我通常在手写时使用这种符号,但从未想过用 TeX 可以实现:他在等式中用箭头和数字 0“划掉”项,表示它们变为零并将被忽略。

例如,在线性化方程时使用此符号,以显示在接下来的分析中忽略哪些高阶项。它基本上看起来像一个长而倾斜的箭头(带箭头的 /),从线下方延伸到线上方,箭头向上,尖端有一个小 0。我意识到这个描述相当模糊,但这可能是我能做的最好的没有油漆 :P

我如何在 LaTeX 中实现这一点?

(我通常使用 pdflatex 或 xelatex 来编译,所以它最好与其中任何一种风格兼容......)

答案1

看一下cancel提供的包\cancelto{<value>}{expression}。最小示例:

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

在此处输入图片描述

答案2

据推测,这是一次演讲,在这种情况下,你(或其他人)可能会对以下内容的 beamer-ized 版本感兴趣\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}

结果是

在此处输入图片描述

(比例盒的东西只是为了使最终的图形很小,但重要部分仍然清晰可辨......)

其他命令也可以类似地进行投影仪化,但是这留给用户作为练习...

答案3

调用包\usepackage{cancel},然后在数学模式下使用以下命令\cancelto{0}{x},其中 x 被取消为数字零。A\cancel{x}划掉该项,不带任何数字。

相关内容