\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}
输出: