I wish to do a simple question and answer sheet for my students. I'd like to have something like this:
\section{Differential Equations}
\begin{questions}
\begin{question}
... Question here ...
\end{question}
\begin{answer}
... Answer here ...
\end{answer}
\end{questions}
I wish to have the environment QUESTIONS to have counters like enumerate. That is, each \begin{question} ... \end{question} should behave just like \item in
\begin{question}
\item
\end{question}
The \begin{question} ... \end{question} environment should take "normal" LaTeX commands.
If possible, I'd wish to have deferred printing to print the answers at the end of the document.
I first tried this
\makeatletter
\newtoks\answerscollect
\newcounter{question}
\setcounter{question}{0}
\def\thequestion{{\bfseries{Question \arabic{question}. }}\\}
\def\answer#1{%
\protected@edef\answertmp{%
\the\answerscollect\vspace{.5\baselineskip}\noindent\thequestion#1\par}%
\par\answerscollect=\expandafter{\answertmp}}
\def\printanswers{\the\answerscollect\answerscollect={}}
\def\initbox{\answerscollect={\par\noindent Answers:\par}}
\newcommand{\question}[1]{\stepcounter{question}\par\noindent\thequestion#1}
\makeatother
but it's not behaving the way I'd love the results to be ...


answerstoo http://ctan.uib.no/macros/latex/contrib/answers/answers.pdf – N3buchadnezzar Apr 12 '13 at 12:53answerspackage not valid. Please state what this package is missing =) – N3buchadnezzar Apr 12 '13 at 13:14answerdo provide solutions, but they are an overkill for the simple task that I want to do. Moreover, it's pretty difficult to tweak them ... I've defined new environments viz.\newenvironment{questions}{\begin{enumerate}}{\end{enumerate}} \newenvironment{question}{\item}{} \newenvironment{answer}{\item}{}I wish to go further and defer printing the answers – Dorogz Apr 12 '13 at 16:15