如果我在课堂上写填空题exam
,像这样:
\documentclass[addpoints]{exam}
\begin{document}
\begin{questions}
\question [3] The protagonist, originally from \makebox[2in]{\dotfill}, has to travel up the \makebox[2in]{\dotfill} River to retrieve \makebox[2in]{\dotfill}.
\end{questions}
\end{document}
线条没有正确断开,而是一直延伸到页面边缘,如下所示:
我可以强制\\
换行,这确实会产生可接受的结果:
但这似乎很笨拙。有没有更优雅的方法来处理这种情况?
答案1
你也可以让点扩大,而不是留白,这样换行就容易多了
\documentclass[addpoints]{exam}
\newcommand\mydotfill[1]{{\def\hfill{\hskip #1 plus 1fill\relax}\nolinebreak\dotfill}}
\begin{document}
\begin{questions}
\question [3] The protagonist, originally from \mydotfill{2in}, has to travel up the \mydotfill{2in} River to retrieve \mydotfill{2in}.
\end{questions}
\end{document}