我只想对一个部分重新编号,而不是所有部分\parts
重新编号。
我在手册中找到了这一点:
\renewcommand{\thepartno}{\Roman{partno}}
但这使得所有的编号都\part
成为罗马数字。
我在手册中找不到哪里可以对某个部分重新编号。
\documentclass[a4paper]{exam}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{paralist}
\usepackage{enumerate}
\renewcommand{\thepartno}{\Roman{partno}}
\begin{document}
\smallskip
\begin{questions}
\question Which of the following is continuous at $x = 0$ ?
\begin{center}
\begin{parts}
\part $f\left(x\right) = \vert x \vert$
\part $f\left(x\right) = e^{x}$
\part $f\left(x\right) = \ln\left(e^{x} - 1 \right)$
\end{parts}
\end{center}
\begin{oneparchoices}
\choice I only
\choice II only
\choice I and II only
\choice II and III only
\choice none
\end{oneparchoices}
\begin{solution}
\end{solution}
\vspace{\stretch{2}}
\end{questions}
\end{document}
答案1
您可以使用
\renewcommand{\thepartno}{\Roman{partno}}
在环境内部parts
保持本地更改:
\documentclass[a4paper]{exam}
\begin{document}
\begin{questions}
\question Which of the following is continuous at $x = 0$ ?
\begin{parts}
\renewcommand{\thepartno}{\Roman{partno}}
\part $f\left(x\right) = \vert x \vert$
\part $f\left(x\right) = e^{x}$
\part $f\left(x\right) = \ln\left(e^{x} - 1 \right)$
\end{parts}
\question Which of the following is continuous at $x = 0$ ?
\begin{parts}
\part $f\left(x\right) = \vert x \vert$
\part $f\left(x\right) = e^{x}$
\part $f\left(x\right) = \ln\left(e^{x} - 1 \right)$
\end{parts}
\end{questions}
\end{document}
附注:您可以使用\label
,\ref
机制来避免手动编号:
\documentclass[a4paper]{exam}
\begin{document}
\begin{questions}
\question Which of the following is continuous at $x = 0$ ?
\begin{parts}
\renewcommand{\thepartno}{\Roman{partno}}
\part\label{abs} $f\left(x\right) = \vert x \vert$
\part\label{exp} $f\left(x\right) = e^{x}$
\part\label{log} $f\left(x\right) = \ln\left(e^{x} - 1 \right)$
\end{parts}
\begin{oneparchoices}
\choice \ref{abs} only
\choice \ref{exp} only
\choice \ref{abs} and~\ref{exp} only
\choice \ref{exp} and~\ref{log} only
\choice none
\end{oneparchoices}
\end{questions}
\end{document}