http://tex.stackexchange.com/questions/ ... orksheets/
I am trying to make sense of the first part of the code (non-TikZ stuff) and have preceded my comments in the code with %%%.
Code: Select all
%%% MY COMMENTS
\documentclass{article}
\usepackage{exsheets,amsmath}
\makeatletter
% a color for answers
\colorlet{answercolor}{orange}
%%% I did not understand the whole "true/false input stream" explanation in the exsheets manual.
\newcommand\answer[1]{\PrintSolutionsTF{#1}{\phantom{#1}}}
%%% Defines a new length called "\answerspaces" and sets them to be 2cm long.
\newlength\answerspace
\setlength\answerspace{2cm}
%%% If math mode something happens and if not in math mode something else happens?
\newcommand\answerline[1]{%
\ifmmode
\answerline@math{#1}%
\else
\answerline@text{#1}%
\fi
}
%%% No idea what's happening from here until the printing options stuff.
\newcommand*\answerline@text[1]{%
\underline{\makebox[\answerspace][c]{\answer{\color{answercolor}#1}}}%
}
\newcommand\answerline@math[1]{\mathpalette\answer@line@math{#1}}
\newcommand\answer@line@math[2]{\answerline@text{$#1#2$}}
\makeatother
% uncomment to get answers printed:
% \SetupExSheets{solution/print=true}
\begin{document}
\section*{Find the unknown.}
\begin{question}
\( 3 + \answerline{1} = 4 \)
\end{question}
\begin{question}
\( 4 = \answerline{14} -10 \)
\end{question}
\end{document}