I work with students with special needs in a high school setting in America within an inclusion classroom (students with special needs integrated into general ed class). I'm trying to do a lot of scaffolding for these students (provide supports that other students in general education might not need). Next unit is going to be multiplying monomials.
My knowledge of LATEX has been growing, but as a teacher, I don't have much of a programming background, but I'm trying to learn in order to save time when creating worksheets in algebra. I've been using the readarray environment to take csv files with numbers and variables and then compiling them to create a formatted worked solution for multiplying monomials for my students. Here is the csv file I've been using (the name of the file is randomfile.csv because I'm still testing it out. This filed will be longer in the final version with maybe 20 problems instead of just 3, it's formatted as a 3D array):
coefficientA,variableA,exponentA,variableB,exponentB
-7,x,7,y,8
3,x,9,y,8
-21,x,16,y,16
%,,,,
coefficientA,variableA,exponentA,variableB,exponentB
7,x,8,y,9
2,x,1,y,6
14,x,9,y,15
%,,,,
coefficientA,variableA,exponentA,variableB,exponentB
-9,x,2,y,9
10,x,2,y,8
-90,x,4,y,17
I've then been importing the CSV file into this tex file:
\documentclass{article}
\usepackage{readarray}
\usepackage{amsmath}
\usepackage{import}
\readarraysepchar{,}
\readdef{randomfile.csv}\dataC
\readarray*\dataC\threeD[-,\nrows,\ncols]
\newcommand{\rf}[0]{ %
\threeD
}
\begin{document}
\begin{enumerate}
\item Sample Problem 1
\begin{align}
(\rf[1,2,1] \rf[1,2,2]^\rf[1,2,3] \rf[1,2,4]^{\rf[1,2,5]})
(\rf[1,3,1] \rf[1,3,2]^\rf[1,3,3] \rf[1,3,4]^{\rf[1,3,5]})
&=
(\rf[1,2,1] \cdot \rf[1,3,1])
(\rf[1,2,2]^\rf[1,2,3] \cdot \rf[1,3,2]^\rf[1,3,3])
(\rf[1,2,4]^{\rf[1,2,5]} \cdot \rf[1,3,4]^{\rf[1,3,5]})
\\
&= (\rf[1,4,1])
(\rf[1,2,2]^{\rf[1,2,3] \; + \; \rf[1,3,3]})
(\rf[1,2,4]^{\rf[1,2,5] \; + \; \rf[1,3,5]})
\\
&= (\rf[1,4,1])
\rf[1,4,2]^{\rf[1,4,3]}
\rf[1,4,4]^{\rf[1,4,5]}
\end{align}
\item Sample Problem 2
\begin{align}
(\rf[2,2,1] \rf[2,2,2]^\rf[2,2,3] \rf[2,2,4]^{\rf[2,2,5]})
(\rf[2,3,1] \rf[2,3,2]^\rf[2,3,3] \rf[2,3,4]^{\rf[2,3,5]})
&=
(\rf[2,2,1] \cdot \rf[2,3,1])
(\rf[2,2,2]^\rf[2,2,3] \cdot \rf[2,3,2]^\rf[2,3,3])
(\rf[2,2,4]^{\rf[2,2,5]} \cdot \rf[2,3,4]^{\rf[2,3,5]})
\\
&= (\rf[2,4,1])
(\rf[2,2,2]^{\rf[2,2,3] \; + \; \rf[2,3,3]})
(\rf[2,2,4]^{\rf[2,2,5] \; + \; \rf[2,3,5]})
\\
&= (\rf[2,4,1])
\rf[2,4,2]^{\rf[2,4,3]}
\rf[2,4,4]^{\rf[2,4,5]}
\end{align}
\end{enumerate}
\end{document}
The output ends up being:
I want to try and figure out two things:
- I want to be able to create the first problem and then call each subsequent problem as an iteration based on the first. Basically I'm later going to create an excel file that has about 20 problems based on different parameters and then save the different versions to csv so that I can have different difficulty levels. I know that I can iterate in a
tabularenvironment with a csv file for a table with something likecsvreaderbecause I've done it other times for a different purpose earlier in the year, but I'm not sure how to do it in this situation where I'm doing an equation instead of a table. - Is this the best way to do this? Does anyone have any suggestions that are more elegant? As a relative newbie, I'm trying to learn about more packages or better ways to define variables for the least amount of work on my end. I'm going to be using this template for other worksheets later in the algebra curriculum (for adding polynomials, factoring quadratics, etc.).

