我正试图准备一些LaTeX考试,并希望能够有多部分的问题,其中一些部分有他们自己的序言,这是我有困难。
作为我希望它出现的一个例子(点只是用来缩进的):
( 1)以下是适用于整个问题的一些可预见性问题。
...a)这里是问题的第一部分。
...Here是将适用于b部分和c部分的另一些序言。
...b)这里是问题的第二部分。
...c)这里是问题的第三部分。
...Here是问题最后一部分的最后序言。
...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}我希望有一种方法可以有效地“暂停”部件环境,只返回问题环境--有吗?
我知道我可以结束部分并重新启动,手动覆盖开始部分,但这感觉像是一个完全的机器人,我认为一定有一个更好的方法。
非常感谢!
发布于 2020-05-31 22:04:11
您可以使用\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}

https://stackoverflow.com/questions/62114870
复制相似问题