The fillin
command seems to accept only absolute length values. However, you can leave out the fillin
and put a default horizontal line with \hrulefill
. It is possible to add something after the line, in the MWE below there is a space and a period (\ .
).
A disadvantage is that the correct answer is not specified, which means that it is not shown in answer mode. A solution is to combine fillin
with a horizontal line, however the baseline differs slightly. Using the package xhfill
you can adjust the baseline. Results using different viewers, different zoom levels, or in print are not guaranteed to be consistent.
MWE:
\documentclass[answers]{exam}
\usepackage{xhfill}
\begin{document}
\begin{questions}
\question The magic word is \hrulefill\ .
\question Where is the baseline? \fillin[low]\hrulefill
\question The normal word is \fillin[correct answer][5cm]\xrfill[-1pt]{0.2mm}
\end{questions}
\end{document}
Result:
![enter image description here](https://cdn.statically.io/img/i.sstatic.net/PTXic.png)