![判断题](https://linux22.com/image/375336/%E5%88%A4%E6%96%AD%E9%A2%98.png)
我正在写一些 True 和 False 题用于考试。我使用的代码有一个小问题。问题是当问题数量超过 9 个时,问题陈述的对齐方式会发生变化。我需要所有问题都处于相同的对齐级别。我使用的代码来自某人的解决方案,我不记得了。也许可能是其中之一,解决方案 1,解决方案 2, 和解决方案 3
一个简短的工作示例是
\documentclass[10pt,a4paper]{exam}
%%%%%%%%%%% TRUE or FALSE %%%%%%%%%%%%%
\newcommand*\TrueFalse{TRUE\hspace*{8pt} FALSE\hspace*{8pt}}
\newlength\mylena
\newlength\mylenb
\settowidth\mylena{\TrueFalse}
\newcommand\TF[1]{%
\setlength\mylenb{\linewidth}
\addtolength\mylenb{-\mylena}
\parbox[t]{\mylena}{\TrueFalse}\parbox[t]{\mylenb}{#1}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\begin{questions}
\question\TF{The types of statistical inferences are estimation of parameters and testing of hypotheses.}
\question\TF{The types of statistical estimation of parameters are point estimation and interval estimation.}
\question\TF{Point estimators may be more useful than interval estimators because probability statements are attached to point estimates.}
\question\TF{The types of statistical inferences are an estimation of parameters and testing of hypotheses.}
\question\TF{The types of statistical estimation of parameters are point estimation and interval estimation.}
\question\TF{Point estimators may be more useful than interval estimators because probability statements are attached to point estimates.}
\question\TF{The types of statistical inferences are an estimation of parameters and testing of hypotheses.}
\question\TF{The types of statistical estimation of parameters are point estimation and interval estimation.}
\question\TF{Point estimators may be more useful than interval estimators because probability statements are attached to point estimates.}
\question\TF{The types of statistical inferences are an estimation of parameters and testing of hypotheses.}
\question\TF{The types of statistical estimation of parameters are point estimation and interval estimation.}
\question\TF{Point estimators may be more useful than interval estimators because probability statements are attached to point estimates.}
\end{questions}
\end{document}
答案1
幸运的是,考试使用\questionlabel
来格式化问题编号。也许可以使用 来\makebox
代替\hbox
。我只是先尝试了这个。
\documentclass[10pt,a4paper]{exam}
%%%%%%%%%%% TRUE or FALSE %%%%%%%%%%%%%
\newcommand*\TrueFalse{TRUE\hspace*{8pt} FALSE\hspace*{8pt}}
\newlength\mylena
\newlength\mylenb
\settowidth\mylena{\TrueFalse}
\newcommand\TF[1]{%
\setlength\mylenb{\linewidth}
\addtolength\mylenb{-\mylena}
\parbox[t]{\mylena}{\TrueFalse}\parbox[t]{\mylenb}{#1}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand{\questionlabel}{\hbox to 1.3em{\thequestion.\hfill}}
\begin{document}
\begin{questions}
\question\TF{The types of statistical inferences are estimation of parameters and testing of hypotheses.}
\question\TF{The types of statistical estimation of parameters are point estimation and interval estimation.}
\question\TF{Point estimators may be more useful than interval estimators because probability statements are attached to point estimates.}
\question\TF{The types of statistical inferences are an estimation of parameters and testing of hypotheses.}
\question\TF{The types of statistical estimation of parameters are point estimation and interval estimation.}
\question\TF{Point estimators may be more useful than interval estimators because probability statements are attached to point estimates.}
\question\TF{The types of statistical inferences are an estimation of parameters and testing of hypotheses.}
\question\TF{The types of statistical estimation of parameters are point estimation and interval estimation.}
\question\TF{Point estimators may be more useful than interval estimators because probability statements are attached to point estimates.}
\question\TF{The types of statistical inferences are an estimation of parameters and testing of hypotheses.}
\question\TF{The types of statistical estimation of parameters are point estimation and interval estimation.}
\question\TF{Point estimators may be more useful than interval estimators because probability statements are attached to point estimates.}
\end{questions}
\end{document}