3

I'm trying to create my first exam using documentclass{exam}, and saw in their documentation (http://mirrors.ctan.org/macros/latex/contrib/exam/examdoc.pdf , page 44) that there is a \fillin command, which will create a blank line that a paper-pencil test taker could fill in, and optionally the test creator can enter the answer, and decide whether or not to have the answer appear when printing.

When I compile with the \fillin command I get the common "Undefined control sequence" error.

I compile with xelatex, but tried on ShareLaTex as well and received the same error. Is there something I'm missing? An option or package I need to include? Any help is much appreciated, here's a minimal working example:

\documentclass[addpoints,answers]{exam}

\begin{document}

\section{Introduction}

\begin{questions}

    \question How many fingers am I holding up? \fillin

    \question[1] Did you know the average human head weighs \fillin[8] pounds?

\end{questions}

\end{document}
4
  • It works here. Please post the code that reproduces the error.
    – user11232
    Commented Sep 20, 2015 at 2:45
  • I had thought about that, but when I tried it on ShareLatex it also didn't work, though I don't know what version ShareLatex uses... Thanks for your comment.
    – dannit
    Commented Sep 20, 2015 at 2:46
  • Sorry @Harish Kumar, did you edit your comment? My comment was in regards to your suggesting I update my distribution. I suppose I'll have to try that now, it'll take some time. Thanks again, if it works I'll post back.
    – dannit
    Commented Sep 20, 2015 at 2:49
  • Yes. I saw it late that you tried on sharelatex. The code you posted works for me. :)
    – user11232
    Commented Sep 20, 2015 at 2:53

1 Answer 1

1

Since 2012/08/20, Version 2.401β of exam has

\fillin[<CorrectAnswer>]{<width>}

As of today, ShareLaTeX is only running TeX Live 2014 with exam at version 2011/05/22 Version 2.4, and is therefore short on the above command.

Easiest would be do download exam.cls and upload it as part of your project.

enter image description here

enter image description here

\documentclass[addpoints,answers]{exam}

\begin{document}

\section{Introduction}

\begin{questions}

\question How many fingers am I holding up? \fillin

\question[1] Did you know the average human head weighs \fillin[8] pounds?

\end{questions}

\end{document}
1
  • You and @Harish Kumar were right, updating my version of LaTex did the trick, and thank you for the info on ShareLaTex. Thanks a lot to you both.
    – dannit
    Commented Sep 20, 2015 at 4:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .