# \fillin command from exam class not working: Undefined control sequence

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}

• It works here. Please post the code that reproduces the error. – user11232 Sep 20 '15 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 Sep 20 '15 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 Sep 20 '15 at 2:49
• Yes. I saw it late that you tried on sharelatex. The code you posted works for me. :) – user11232 Sep 20 '15 at 2:53

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.

\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}

• 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 Sep 20 '15 at 4:31