
答案1
該cancel
包可用於此目的。
\documentclass{article}
\usepackage{mathtools,xcolor,cancel}
\renewcommand\CancelColor{\color{red}}
\begin{document}
\begin{align}
\biggl(\frac{8x-2}{\cancel{18}}-\frac{x-2}{\cancel{18}}\biggr) \cdot \cancel{18} &= \frac{21}{\cancel{18}} \cdot \cancel{18}
\\
8x - \bcancel{2} - x + \bcancel{2} &= 21
\end{align}
\end{document}
答案2
與影像關聯的 LaTeX 程式碼為:
\begin{align*}
( \frac{8x - 2}{{\color{Red} \cancel{{\color{Black} 18}}}} - \frac{x - 2}{{\color{Red} \cancel{{\color{Black} 18}}}} ) \times {\color{Red} \cancel{{\color{Blue} 18}}} = \frac{21}{{\color{Red} \cancel{{\color{Black} 18}}}} \times {\color{Red} \cancel{{\color{Blue} 18}}}\\
8x - 2 - ( x - 2 ) = 21\\
8x - {\color{Red} \bcancel{{\color{Black} 2}}} - x + {\color{Red} \bcancel{{\color{Black} 2}}} = 21\\
\end{align*}
使用的命令是:
\bcancel{}
從左到右下刪除內容\cancel{}
從左下到右上角刪除內容{\color{add color} {}}
為包含的物件賦予顏色\frac{}{}
建立分數欄\times
建立叉積的符號\begin{align*}
並\end{align*}
包含一個對齊\\
意味著換行
然而,就我個人而言,我更喜歡這樣:
\begin{align*}
\left( \frac{8 \cdot x - 2}{{\color{Red} \cancel{{\color{Black} 18}}}} - \frac{x - 2}{{\color{Red} \cancel{{\color{Black} 18}}}} \right) \cdot {\color{Red} \cancel{{\color{Blue} 18}}} &= \frac{21}{{\color{Red} \cancel{{\color{Black} 18}}}} \cdot {\color{Red} \cancel{{\color{Blue} 18}}}\\
8 \cdot x - 2 - \left( x - 2 \right) &= 21\\
8 \cdot x - {\color{Red} \bcancel{{\color{Black} 2}}} - x + {\color{Red} \bcancel{{\color{Black} 2}}} &= 21\\
\end{align*}
新使用的指令是:
&
對齊\cdot
建立一個中心點\left( \right)
創建與其內容一樣大的括號