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
Best Answer
I made the following changes to exam.cls.
First I added a \printquestions option.
Then later on
Next, I modify the solution environment. If I don't print the questions, then I wanted the solution environment to act as a \question.
Next, I add a quest environment which can be hidden. However, this would need to be used instead of \question.
One annoying thing is that itemize lists, parts and subparts won't work in the environment I defined (I believe this is due to the \question call initializing some variables which I don't initialize. Therefore, I created some basic itemize list commands using the tabular environment.
Some more part commands could be defined like this.