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).
Post Reply
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?

Post by WyoTeacher »

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}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

Post Reply