LaTeX forum ⇒ Math & Science“array” most efficient code for creating step-by-step solution procedures for single variable Alg equations?

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
WyoTeacher
Posts: 3
Joined: Wed Apr 22, 2020 6:55 am

“array” most efficient code for creating step-by-step solution procedures for single variable Alg equations?

Postby WyoTeacher » Thu Oct 15, 2020 5:21 pm

Greetings LaTeX Community!

I need to create step-by-step procedure solutions to share with my high school students.

Is "array" the most efficient method of creating these columnar style procedure steps?

The MWE works but is quite time intensive. (h/t to the good folks at overleaf.com for providing basic code shown below)

Thanks in advance for your advice!

\documentclass{article}
\usepackage{amsmath,array}

\usepackage{cancel}

\newenvironment{system}
{\renewcommand{\arraystretch}{1.5}% like aligned does
\begin{array}{
@{}r@{}
*{\value{MaxMatrixCols}}{
>{{}}c<{{}}@{}
>{\mathopen{}}r@{}
}
}%
}{\end{array}}

\begin{document}

\[
\begin{system}
& -\frac {1}{5}x & + \cancel{7} & = & 3 & + & \frac {4}{5} x
\\
& & -\cancel{7} & & -7 & \\ \hline
\bigskip
& - \frac {1}{5}x & & = & -4 & + & \frac{4}{5} x \\

& \frac{1}{5} x & & = & -4 & + & \frac{4}{5}x \\
& \frac{1}{5}x & & = & & & + \frac{1}{5}x \\ \hline
& 0 &&= && & + \frac{5}{5}x
\\\
&0&&=&&1x
\\\
&x&&=&&0
\end{system}
\]

\end{document}

Return to “Math & Science”

Who is online

Users browsing this forum: No registered users and 2 guests