使用 Exam 类保持复选框对齐

使用 Exam 类保持复选框对齐

我在多列环境中使用考试类来创建一系列工作表。许多问题都是是/否。如果问题太长,它会换行到下一行并移动答案。有没有办法“固定”答案是/否复选框,使其始终在第一行右对齐并适当换行问题文本?

以下是我目前格式化是/否问题的方式。解决方案不会要求改变当前问题的书写方式,因为有相当多的遗留文档。此外,解决方案不能修改每一个问题,因为并非每个问题都是肯定或否定的。

\documentclass{exam}
\usepackage{multicol}
\newcommand\YesNo{%
\hfill\mbox{\begin{oneparcheckboxes}
    \choice Yes
    \choice No
\end{oneparcheckboxes}}}

\begin{document}
\begin{multicols}{2}
\begin{questions}
\question This question is short\YesNo
\question This question is longer, and will probably wrap to the next line\YesNo

... % lots of questions go here

\end{questions}
\end{multicols}
\end{document}

目前看起来像... 在此处输入图片描述

看起来应该像... 在此处输入图片描述

答案1

使用top-aligned \parboxes 可以工作吗?

在此处输入图片描述

\documentclass{exam}
\usepackage{multicol}% http://ctan.org/pkg/multicol
\newcommand\YesNo{%
\hfill\mbox{\begin{oneparcheckboxes}
    \choice Yes
    \choice No
\end{oneparcheckboxes}}}

\begin{document}
\begin{multicols}{2}
\begin{questions}
\question This question is short\YesNo
\question \parbox[t]{0.5\linewidth}{This question is longer, and will probably wrap to the next line}\YesNo
\question This question is short\YesNo
\question \parbox[t]{0.5\linewidth}{This question is longer, and will probably wrap to the next line}\YesNo
\question This question is short\YesNo
\question \parbox[t]{0.5\linewidth}{This question is longer, and will probably wrap to the next line}\YesNo
\question This question is short\YesNo
\question \parbox[t]{0.5\linewidth}{This question is longer, and will probably wrap to the next line}\YesNo
\question This question is short\YesNo
\question \parbox[t]{0.5\linewidth}{This question is longer, and will probably wrap to the next line}\YesNo
\question This question is short\YesNo
\question \parbox[t]{0.5\linewidth}{This question is longer, and will probably wrap to the next line}\YesNo
\question This question is short\YesNo
\question \parbox[t]{0.5\linewidth}{This question is longer, and will probably wrap to the next line}\YesNo
\question This question is short\YesNo
\question \parbox[t]{0.5\linewidth}{This question is longer, and will probably wrap to the next line}\YesNo
\question This question is short\YesNo
\question \parbox[t]{0.5\linewidth}{This question is longer, and will probably wrap to the next line}\YesNo
\question This question is short\YesNo
\question \parbox[t]{0.5\linewidth}{This question is longer, and will probably wrap to the next line}\YesNo
\end{questions}
\end{multicols}
\end{document}

\parbox宽度( )的选择0.5\linewidth可能根据多项选择样式而变化。

相关内容