![如何在简单分数消除示例中添加其他数字](https://linux22.com/image/307365/%E5%A6%82%E4%BD%95%E5%9C%A8%E7%AE%80%E5%8D%95%E5%88%86%E6%95%B0%E6%B6%88%E9%99%A4%E7%A4%BA%E4%BE%8B%E4%B8%AD%E6%B7%BB%E5%8A%A0%E5%85%B6%E4%BB%96%E6%95%B0%E5%AD%97.png)
\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{shapes.misc}
\newcommand{\strikeout}[1]{%
\ifmmode%
\tikz[inner sep=0.5pt,baseline] \node [strike out,draw=black,anchor=text]{${}#1{}$};%
\else%
\tikz[inner sep=0.5pt,baseline] \node [strike out,draw=black,anchor=text]{#1};%
\fi%
}
\begin{document}
\begin{align*}
\frac{4\strikeout{a}b}{\strikeout{9}} \times \frac{\strikeout{6}\strikeout{m}} {\strikeout{a}c\strikeout{m}} &=\frac{4b \times 2 }{3c} \\
&= \frac{8b}{3c} \\
&= \frac{8b}{3c}
\end{align*}
\end{document}
答案1
你想要这样的东西吗?
代码:
\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{shapes.misc}
\newcommand{\strikeout}[1]{%
\ifmmode%
\tikz[inner sep=0.5pt,baseline] \node [strike out,draw=black,anchor=text]{${}#1{}$};%
\else%
\tikz[inner sep=0.5pt,baseline] \node [strike out,draw=black,anchor=text]{#1};%
\fi%
}
\newcommand{\uprest}[1]{\!{}^{^{^{#1}}}\!\!}
\newcommand{\downrest}[1]{\!{}_{_{_{_{#1}}}}\!\!}
\begin{document}
\begin{align*}
\frac{4\strikeout{a}b}{\downrest{3}\strikeout{9}} \times
\frac{\strikeout{6}\uprest{2}\strikeout{m}}{\strikeout{a}c\strikeout{m}}
&=\frac{4b \times 2 }{3c} \\
&= \frac{8b}{3c} \\
&= \frac{8b}{3c}
\end{align*}
\end{document}
否则,该cancel
包提供了一个\cancelto
命令:
\documentclass{article}
\usepackage{amsmath}
\usepackage{cancel}
\begin{document}
\begin{align*}
\frac{4\cancel{a}b}{\cancelto{3}{9}} \times
\frac{\cancelto{2}{6}\cancel{m}}{\cancel{a}c\cancel{m}}
&=\frac{4b \times 2 }{3c} \\
&= \frac{8b}{3c} \\
&= \frac{8b}{3c}
\end{align*}
\end{document}
输出: