線形方程式 (線形方程式のシステムではありません) を解く手順を示す LaTeX コードを探しています。たとえば、3x-2y=-1 を解くには、次のように記述します。
3x - 2y = -1
-3x - 3x
__________________
- 2y = -3x - 1
- 2y = -3x - 1
----- -------
-2 -2
y = 3x + 1
-- --
2 2
どの LaTeX 関数を使用すればよいかわからないため、MWE を提供できないことをお詫び申し上げます。
ご協力をよろしくお願いいたします。
答え1
array
これは、パッケージ (およびその\newcolumntype
マクロ\extrarowheight
) と環境を使用するソリューションですarray
。(マイナス) 記号の単項使用と二項使用の (書体の) 違いに注意してください-
。
\documentclass{article}
\usepackage{array}
\newcolumntype{C}{>{{}}c<{{}}} % for columns with binary and relational operators
\newcolumntype{R}{>{\displaystyle}r}
\begin{document}
\[
\setlength\arraycolsep{0pt}
\setlength\extrarowheight{3pt}
\begin{array}{RCRCRCR}
3x & - & 2y & = & \multicolumn{3}{R}{-1} \\
-3x & & & & -3x \\
\hline
\multicolumn{3}{R}{-2y} & = & -3x & - & 1 \\[2.5ex]
\multicolumn{3}{R}{\frac{-2y}{-2}} & = &
\multicolumn{3}{R}{\frac{-3x-1}{-2}}\\[3ex]
& & y & = & \frac{3x}{2} & + & \frac{1}{2} \\
\end{array}
\]
\end{document}