3

I'm attempting to use the exam document class to write an exam for my class, and for some reason this particular exam is not leaving space for their answers when I use the [noanswers] argument to the document class. Here is the markup:

\documentclass[noanswers]{exam}

% Additional LaTeX Packages

\usepackage{graphicx}

% Font and Typography Settings

\usepackage{beton}
\renewcommand{\bfdefault}{sbc}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{euler}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[babel=true]{microtype}

\pagestyle{headandfoot}
\headrule
\firstpageheader{CS 1411 -- Principles of Programming I}
    {Exam II}
    {Spring 2013}
\runningheader{CS 1411 -- Principles of Programming I}
    {Exam II, Page \thepage\ of \numpages}
    {Spring 2013}

\begin{document}

\begin{questions}

\question PROBLEM TEXT
\begin{parts}
\part function
\begin{solution}[\stretch{1}]
    PART A SOLUTION
\end{solution}

\part PART B
\begin{solution}[\stretch{1}]
    PART B SOLUTION
\end{solution}
\end{parts}

\question PROBLEM TEXT
\begin{parts}
\part PART A
\begin{solution}[\stretch{1}]
    PART A SOLUTION
    \begin{center}
        \includegraphics[scale=0.60]{Images/exam-2-problem-2.pdf}
    \end{center}
\end{solution}
\part PART B
\begin{solution}[\stretch{1}]
    PART B SOLUTION
\end{solution}
\end{parts}

\question PROBLEM TEXT
\begin{solution}[\stretch{1}]
\begin{verbatim}
PYTHON CODE IN VERBATIM MODE
\end{verbatim}
\end{solution}

\end{questions}

\end{document}

Via pdflatex the generated PDF contains the solutions as I would expect when using the [answers] argument to the document class. Switching to [noanswers] simply prints the questions leaving no space for the solutions. Any suggestions would be much appreciated.

ggelfond
  • 981
  • I get the expected result once a missing \begin{questions} is added just before the first \question command. Do you still get the problem mentioned after adding the missing command? – Gonzalo Medina Feb 20 '13 at 16:39
  • Hi Gonzalo, yes I still have the problem after adding the \begin{questions}. This was a copy/paste error in my working example. I'll update the code sample in the original post. – ggelfond Feb 20 '13 at 20:22
  • 3
    Perhaps it is then a problem of outdated packages(s)? Which version of the exam class are you using? – Gonzalo Medina Feb 20 '13 at 22:19
  • It works fine for me under pdflatex using exam.cls version 2011/05/22 Version 2.4 by Philip Hirschhorn. Try using solutionorbox -- you should see the space exam is making (or not making) for the solution. – Sean Allred Mar 06 '13 at 18:09

0 Answers0