考试 `parts` 在 `multicols` 中:从左到右编号

考试 `parts` 在 `multicols` 中:从左到右编号

exam类中的某些情况下,我希望partssubparts枚举从左到右(跨)读取列,而不是从高到低(向下)读取列。这是一个工作示例:

在此处输入图片描述 在此处输入图片描述

\documentclass{exam}
\usepackage{amsmath,pgf,tikz,pgfplots,multicol}

%Lengthens \fillin answer lines and raises text above the line so text isn't cut off by the answer line, see documentation http://mirror.utexas.edu/ctan/macros/latex/contrib/exam/examdoc.pdf and this question https://tex.stackexchange.com/questions/352246/vertical-spacing-between-fillin-in-exam 
\setlength\fillinlinelength{4cm}
\setlength\answerclearance{1.25ex}

%Customizes spacing between list items, and adjusts spacing betwen multicols to match. From https://tex.stackexchange.com/questions/597536/exam-parts-in-multicols-left-to-right-numbering/597560#597560
\setlength{\itemsep}{8mm}
\setlength{\multicolsep}{\itemsep}

%The following is to make a node style answer which has by default text opacity=0 but changes to text opacity=1 when \printanswers is issued. See:
%https://tex.stackexchange.com/questions/485101/put-exam-answerline-blanks-as-nodes-inside-tikzpicture
%https://tex.stackexchange.com/questions/497877/how-to-reveal-tikz-plot-with-printanswers-in-exam-class/497901
\tikzset{answer/.style={draw,text opacity=0},answer plot/.style={opacity=0}}
\let\oldprintanswers\printanswers
\def\printanswers{\oldprintanswers\tikzset{answer/.style={text opacity=1}, answer plot/.style={opacity=1}}}
%\printanswers

\begin{document}
\begin{questions}
\question[12]
For the rational function
\begin{equation*}
f(x)=\frac{3x+5}{x+2},
\end{equation*}

\begin{parts}
\part[2] Use polynomial division to rewrite $f(x)$ in mixed fraction form $q(x)+\frac{r(x)}{d(x)}$.
\begin{solution}
\begin{equation*}
f(x)=3-\frac{1}{x+2}
\end{equation*}
\end{solution}
\vspace*{\stretch{1}}

\part Use transformations of the parent function $\frac{1}{x}$ to graph $f(x)$.
\begin{center}
\begin{tikzpicture}
\begin{axis}[grid,
axis x line=middle, axis y line=middle, xlabel={$x$}, ylabel={$f(x)$}, height=8cm,
xtick={-5,-4,...,5}, ytick={-5,-4,...,5},
xmin=-6, xmax=6, ymin=-6, ymax=6]
\addplot[domain=-6:-2.1, samples=100, mark=none, thick, blue, answer plot]{3-1/(x+2)};
\addplot[domain=-1.9:6, samples=100, mark=none, thick, blue, answer plot]{3-1/(x+2)};
\addplot +[mark=none, dashed, blue, answer plot] coordinates {(-2, -6) (-2, 6)};
\addplot +[mark=none, dashed, blue, answer plot] coordinates {(-6, 3) (6, 3)};
\end{axis}
\end{tikzpicture}
\end{center}
\vspace*{\stretch{1}}

\part[6] Find the following function features:
\begin{subparts}
\begin{multicols}{2}
\subpart \small{\textbf{Domain:}} \fillin[$(-\infty,-2)\cup(-2,\infty)$]
\columnbreak
\subpart \small{\textbf{Range:}} \fillin[$(-\infty,3)\cup(3,\infty)$]
\end{multicols}

\begin{multicols}{2}
\subpart \small{\textbf{Increasing:}} \fillin[$(-\infty,-2)\cup(-2,\infty)$]
\columnbreak
\subpart \small{\textbf{Decreasing:}} \fillin[$\emptyset$]
\end{multicols}

\begin{multicols}{2}
\subpart \small{\textbf{$x$-intercept(s):}} \fillin[$\left\langle -\frac{5}{3},0\right\rangle$]
\columnbreak
\subpart \small{\textbf{$y$-intercept:}} \fillin[$\left\langle 0,\frac{5}{2}\right\rangle$]
\end{multicols}

\begin{multicols}{2}
\subpart \small{\textbf{Asymptotes:}} \fillin[$x=-2, y=3$]
\columnbreak
\subpart \small{\textbf{Maxima/minima:}} \fillin[None]
\end{multicols}
\end{subparts}
\vspace*{\stretch{1}}

\part[6] Find the following function limits:
\begin{subparts}
\begin{multicols}{2}
\subpart $\lim_{x\to 3^{-}} f(x)=$ \fillin[$-\infty$]
\subpart $\lim_{x\to 3^{+}} f(x)=$ \fillin[$\infty$]
\subpart $\lim_{x\to 3} f(x)=$ \fillin[$DNE$]
\columnbreak
\subpart $\lim_{x\to 4} f(x)=$ \fillin[$-1$]
\subpart $\lim_{x\to \infty} f(x)=$ \fillin[$-2$]
\subpart $\lim_{x\to -\infty} f(x)=$ \fillin[$-2$]
\end{multicols}
\end{subparts}
\vspace*{\stretch{1}}
\end{parts}

\end{questions}
\end{document}

有效的方法:我很高兴subparts(c) 中的人跨栏阅读,而 (d) 中的人顺栏阅读。

无效的方法:间距不一致。从左到右(跨)列读取的parts和比从高到低(向下)列读取的和具有更多的垂直空间。subpartspartssubparts

这个问题类似,但我想要定义自定义枚举/逐项列举/任务。我想继续使用预定义的partssubparts这样我就不会失去它们的exam类功能。

答案1

环境之间的间距multicols由 定义\multicolsep。在另一个问题 (d) 中,间距由列表项定义,即\itemsep。因此,以下命令应为您提供相等的间距:

\setlength{\multicolsep}{\itemsep}

编辑:例如,如果您想要更改 s 中的间距\subpart,则必须在 中输入相关定义\subparthook。大多数构造都有钩子,请参阅考试类文档中的第 4.10 节(自定义列表参数)。

定制化

\renewcommand\subpartshook{%
  \setlength{\itemsep}{8mm}%
  \setlength{\multicolsep}{\itemsep}%
}

在此处输入图片描述

相关内容