Ich möchte für meine Schüler einen einfachen Frage- und Antwortbogen erstellen. Ich hätte gern so etwas:
\section{Differential Equations}
\begin{questions}
\begin{question}
... Question here ...
\end{question}
\begin{answer}
... Answer here ...
\end{answer}
\end{questions}
Ich möchte, dass die Umgebung QUESTIONS Zähler wie enumerate hat. Das heißt, jeder \begin{question} ... \end{question}
sollte sich genauso verhalten wie \item
in
\begin{question}
\item
\end{question}
Die \begin{question} ... \end{question}
Umgebung sollte „normale“ LaTeX-Befehle annehmen.
Wenn möglich, würde ich mir eine Druckverzögerung wünschen, um die Antworten am Ende des Dokuments auszudrucken.
Ich habe das zuerst versucht
\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
aber es verhält sich nicht so, wie ich mir die Ergebnisse wünschen würde ...
Antwort1
Einfache Verwendung des exam
Pakets:
\documentclass{exam}
%\printanswers
\begin{document}
\section{Differential Equations}
\begin{questions}
\question ... Short question here ... \answerline[Short answer]
\question ... Question here ...
\begin{solution}[.2in]
... Answer here ...
\end{solution}
\question Long descriptive question about everything
\begin{solutionorlines}[2in]
Long descriptive answer is a long descriptive answer that is a long descriptive answer that is along descriptive answer that is along descriptive answer that is along descriptive answer that is a lie.
\end{solutionorlines}
\question Draw an arrow showing north direction.
\begin{solutionorbox}[2in]
$\uparrow$
\end{solutionorbox}
\end{questions}
\ifprintanswers
Stuff to appear only when answers \textbf{are} being printed.
\else
Stuff to appear only when answers \textbf{are not} being printed.
\fi
\end{document}
Das Kommentieren und Aufheben des Kommentars \printanswers
führt zu einem der folgenden beiden Ergebnisse:
1)
2)
Ich sehe keine Funktionseinbußen im Vergleich zu Deinem Beispiel.