Suppose I am using the exam class. There is an option \printanswers
to print solutions, otherwise solutions aren't printed. I would like to suppress questions and just print the solutions. Is this possible?
Edit
I've added a basic work-around, but perhaps there is a better way to do this? Here's a demo using the modified exam class, found here.
% Document
\documentclass[12pt]{exam2}
\usepackage[margin=1.0in]{geometry}
\usepackage{fancyhdr}
\usepackage{amsmath}
\pagestyle{fancy}
\lhead{The author}
\rhead{The assignment}
\setcounter{section}{1}
\unframedsolutions
% Preamble
\printquestions
\printanswers
\begin{document}
\numberwithin{question}{section}
\begin{questions}
\begin{quest}
What is $\int_{0}^{5} x^2 dx$?
\end{quest}
\begin{solution}
This integral can be calculated as
\begin{align}
\int_{0}^{5} x^3 &= \Big[ \frac{x^3}{3} \Big|_{0}^{5} \notag \\
&= \frac{5^{3}}{3}
\end{align}
\end{solution}
\begin{quest}
The next question would go here
\questp{a}{Part a of the question}
\questsp{i}{Subpart of a}
\questspnob{More information}
\end{quest}
\begin{solution}
The next answer would go here
\begin{parts}
\part Parts works in solution environment
\begin{subparts}
\subpart Here is a subpart
\end{subparts}
\end{parts}
\end{solution}
\end{questions}
\end{document}
Questions and answers
% Preamble:
\printquestions
\printanswers
Questions only
% Preamble:
\printquestions
%\printanswers
Answers only
% Preamble:
%\printquestions
\printanswers
question
, dropping the question content is difficult -- in my point of view this is a designflaw
ofexam.cls
, unless I've missed some crucial aspectanswers
package is harder to use, but allows you to spit out the answers to a separate file to be\input
at will.answers
package will generate a separate file of answers. Then you can\input
that file in a document for answers only. The package isn't hard to use for just this purpose.