How can I "embed" examples and solutions into my code to make easy-to-use worksheets and solutions manuals?
Context: I am creating a fractions workbook for students, many of whom have many unfortunate challenges in life, so the workbook must be uber easy to use. This means the solutions manual needs to look exactly like the worksheets, except with answers in them. I am struggling to make this happen to the point where I'm not sure even how to make a decent MWE.
Below are links to my attempted MWE and a PDF of what I want. There is a large gap to close!
(If this thread needs to be broken down into smaller bits, just let me know and I'll do that.)
Any suggestions?
How I want it to look, edited with pen
\documentclass[12pt,letterpaper]{article}
\usepackage{amsmath}
\usepackage{exsheets}
\usepackage{tikz}
% underline/answer space macro
\newlength{\ALT} %Sets name new my length, where ALT = Answer Line Thickness
\setlength{\ALT}{0.5pt} %sets thickness of that line
\newlength{\DLL} % DLL = default line length; that is if I don't otherwise specify the line length, it will be as long as I set it to here.
\setlength{\DLL}{0.8cm}
\newcommand{\AS}[1][\DLL]{\rule{#1}{\ALT}}
\begin{document}
\section{Worksheet Now}
Find the unknown.
\begin{question}
\(3+\AS=4\)
\end{question}
\begin{solution}
\(1\)
\end{solution}
\begin{question}
\(4=\AS-10\)
\end{question}
\begin{solution}
\(14\)
\end{solution}
\noindent
Shade the indicated length starting at zero.
\begin{question}
\(\frac{2}{5}\)
\tikz[xscale=2]
{
% X axes
\draw [line width =1pt]
(0,0)--(3,0)
(0,.5)--(3,0.5);
% Vertical tick marks and answer boxes
\foreach \x in {0,...,15}
\draw [line width=1pt](\x/5,-0.4)--(\x/5,0.5);
% Whole Number Labels
\foreach \x in {0,1,2,3}
\node[below] at (\x,-0.6) {\x};
}
\end{question}
\begin{solution}
\(\frac{5}{3}\)
\tikz[xscale=2]
{
% Shaded bar length
\filldraw[gray] (0,0) rectangle ({2/5},0.5);
% X axes
\draw [line width =1pt]
(0,0)--(3,0)
(0,.5)--(3,0.5);
% Vertical tick marks and answer boxes
\foreach \x in {0,...,15}
\draw [line width=1pt](\x/5,-0.4)--(\x/5,0.5);
% Whole Number Labels
\foreach \x in {0,1,2,3}
\node[below] at (\x,-0.6) {\x};
}
\end{solution}
\begin{question}
\(\frac{5}{3}\)
\tikz[xscale=1.5]
{
% X axes
\draw [line width =1pt]
(0,0)--(3,0)
(0,.5)--(3,0.5);
% Vertical tick marks and answer boxes
\foreach \x in {0,...,9}
\draw [line width=1pt](\x/3,-0.4)--(\x/3,0.5);
% Whole Number Labels
\foreach \x in {0,1,2,3}
\node[below] at (\x,-0.6) {\x};
}
\end{question}
\begin{solution}
\(\frac{5}{3}\)
\tikz[xscale=1.5]{
% Shaded bar length
\filldraw[gray] (0,0) rectangle ({5/3},0.5);
% X axes
\draw [line width =1pt]
(0,0)--(3,0)
(0,.5)--(3,0.5);
% Vertical tick marks and answer boxes
\foreach \x in {0,...,9}
\draw [line width=1pt](\x/3,-0.4)--(\x/3,0.5);
% Whole Number Labels
\foreach \x in {0,1,2,3}
\node[below] at (\x,-0.6) {\x};
}
\end{solution}
\pagebreak
\section{Solutions Now}
\printsolutions
\end{document}