我想用它answers
来生成包含部分、子部分、子子部分的问题的解决方案文件。以下是 MWE:
\documentclass[12pt,a4paper]{article}
\usepackage{answers}
%\usepackage[nosolutionfiles]{answers}
\Newassociation{sol}{enumerate}{ans}
\usepackage{enumitem}
\setenumerate[1]{label=\arabic*),leftmargin=*,labelindent= \parindent,widest=99),align=left}
\setenumerate[2]{label=\alph*),leftmargin=*,labelindent= \parindent,widest=a),align=left}
\setenumerate[3]{label=\roman*),leftmargin=*,labelindent=\parindent,widest=viii),align=left}
\newcommand{\enumerateparams}{\relax}
%The previous line is required when solution file is produced. An `\enumerateparams' is added to every \begin{enumerate}. Without this an error message is produced.
\begin{document}
\Opensolutionfile{ans}[ans1]
\begin{Filesave}{ans}
\begin{center}
{\bfseries\large Marking Scheme\\
MMTE-006 }\\
2018 \end{center}
{\bfseries The solution presented in the marking scheme may be one of the possible solutions. Marks may be given for any other correct solution.}
\restartlist{enumerate}
\setlist[enumerate,1]{resume}
\end{Filesave}
\section{Problems}
\begin{enumerate}
\item First exercise
\begin{enumerate}
\item exercise 1. Part a
\item part b\begin{enumerate}
\item part b sub-part i)
\end{enumerate}
\end{enumerate}
\begin{sol}\item
\begin{enumerate}
\item Part a solution.
\item part b
\begin{enumerate}
\item Solution of part b), sub-part i)
\end{enumerate}
\end{enumerate}
\end{sol}
\item Second exercise
\begin{sol}
\item Second solution.
\end{sol}
\end{enumerate}
\Closesolutionfile{ans}
\section{Solutions}
\input{ans1}
\end{document}
但是,当未生成解决方案文件且解决方案以内联方式包含时,列表编号会出现问题。(注释掉这些行\usepackage{answers}
,\input{ans1}
并从该行中删除注释\usepackage[nosolutionfiles]{answers}
)解决方案的编号以 a) 开头,然后继续到 i)、A) 等,而不是 1)、a)、i) 等。这是输出:
这可以修复吗?