在考试课中,将文字放在问题部分之间

问题描述 投票:0回答:1

我正试图用LaTeX准备一些考试,希望能够有多部分的问题,其中一些部分有自己的序言,我有困难。

举个例子,我希望它如何出现(点只是用来缩进)。

1)这里是一些适用于整个问题的序言。

...a)这里是问题的第一部分。

.here is some further preamble that will apply for part b and part c.

...b)这里是问题的第二部分。

...c)这里是问题的第三部分。

.here is some final preamble for the last part of the question.

.d)这里是问题的最后一部分。

我正在努力寻找一种方法来插入序言。目前我只能满足于将序言插入到下面的相关部分,但这并不理想。

\documentclass{exam}
\begin{document}
\begin{questions}
\question
Here is some preamble for the question that will apply throughout.
\begin{parts}
\part
Here is the first part of the question.
\part
Here is some further preamble that will apply for part b and c. Here is the second part of the question.
\part
Here is the third part of the question.
\part
Here us some final preamble for the last part of the question. Here is the final part of the question.
\end{parts}
\end{questions}
\end{document}

我希望有一种方法可以有效地 "暂停 "部分环境,只返回到问题环境--有吗?

I 我知道我可以结束部分并重新开始,手动覆盖起始部分,但这感觉就像一个大杂烩,我想一定有更好的方法。

非常感谢

latex typesetting
1个回答
1
投票

你可以使用 \uplevel 宏或 EnvUplevel 环境中,将指令放在你的问题的各个部分之间。

\documentclass{exam}
\begin{document}
\begin{questions}
\question
Here is some preamble for the question that will apply throughout.
\begin{parts}
\part
Here is the first part of the question.

\uplevel{test}

\part
Here is some further preamble that will apply for part b and c. Here is the second part of the question.
\part
Here is the third part of the question.

\begin{EnvUplevel}
test
\end{EnvUplevel}
\part
Here us some final preamble for the last part of the question. Here is the final part of the question.
\end{parts}
\end{questions}
\end{document}

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.