在下面的例子中,我对缩进不是很满意。
我认为缩进应该如下:
- 标题与问题名称对齐
parindent
问题内容为否- 子问题无缩进
(a)
- 答案行无缩进
我可以在考试包的哪里配置它?
\documentclass[addpoints]{exam}
\firstpageheader{Exam}{}{}
\runningheader{Exam}{}{}
\qformat{
\large\textbf{Problem \thequestiontitle}
\quad (\thepoints)\hfill
\vrule depth 1.5em width 0pt
}
\begin{document}
\begin{questions}
\titledquestion{Foobar}[10]
In the following...\par
\begin{parts}
\part What is foo?
\fillwithdottedlines{1cm}
\end{parts}
\end{questions}
\end{document}
答案1
该类exam
有一些钩子可以将命令插入到列表中。最初定义为\newcommand\questionshook{}
,
\newcommand\partshook{}
以及其他,可以使用
\renewcommand\questionshook{<newcomands>}
\renewcommand\partshook{<newcomands>}
, ETC。
我发现改变“在以下...”缩进的唯一解决方案是在前面插入一个负空格。希望这是可以接受的。
% !TeX TS-program = pdflatex
\documentclass[addpoints]{exam}
\usepackage{showframe} % show margins
\renewcommand{\partshook}{% added <<<<<<<<<<<<
\setlength{\leftmargin}{0pt}
\setlength{\labelwidth}{-\labelsep}%
\def\makelabel##1{\hskip-\leftmargin##1}%
}
\renewcommand{\questionshook}{% added <<<<<<<<<
\setlength{\leftmargin}{0pt}%
\setlength{\labelwidth}{-\labelsep}%
}
\firstpageheader{Exam}{}{}
\runningheader{Exam}{}{}
\qformat{%
\parbox{\textwidth}{\large\textbf{Problem \thequestiontitle}\quad (\thepoints)\smallskip \\}% changed <<<<<<<<<
}
\begin{document}
\begin{questions}
\titledquestion{Foo}[10]
\hspace*{-\leftmargin}In the following... % changed <<<<<<<<<<<<<
\begin{parts}
\part What is foo?
\fillwithdottedlines{1cm}
\fillwithdottedlines{1cm}
\part What is bar?
\fillwithdottedlines{1cm}
\fillwithdottedlines{1cm}
\end{parts}
\end{questions}
\begin{questions}
\titledquestion{Bar}[15]
\hspace*{-\leftmargin}In the following...\par
\begin{parts}
\part What is bar?
\fillwithdottedlines{1cm}
\end{parts}
\end{questions}
\begin{questions}
\titledquestion{Baz}[20]
\hspace*{-\leftmargin}In the following...\par
\begin{parts}
\part What is baz?
\fillwithdottedlines{1cm}
\end{parts}
\end{questions}
\end{document}