Нумерация альтернативных решений в экзаменационном классе

Нумерация альтернативных решений в экзаменационном классе

В настоящее время я пишу решения для прошлогоднего экзамена и обнаружил, что нет возможности пронумеровать решения для одного и того же вопроса, если это необходимо. (Некоторые вопросы заканчиваются несколькими решениями.)

\usepackage[margin=2.54cm, a4paper]{geometry}
\usepackage{amsmath}
\usepackage{amssymb}
\pagestyle{headandfoot}
\runningheader{}{Solution of Advance Mathematics II}{Year 201X}
\runningheadrule
\runningfooter{}{Page \thepage \,of Page \numpages}{}
\newcounter{solution}
\unframedsolutions
\renewcommand{\solutiontitle}{\noindent\textbf{Solution \thequestion: }}
\begin{document}
\begin{titlepage}
    \centering
    \hspace{10cm}\\[5pt]
    \vfill
    {\scshape\Huge School \par}
    \vspace{1cm}
    {\scshape\Large Advanced Mathematics II\par}
    \vspace{1cm}
    {\huge\bfseries Solution Manual\par}
    \vspace{1cm}
    {\Large Trial Exam\par}
    \vspace{1cm}
    {\Large October 201X\par}
    \vspace{1cm}
    {\large \emph{Written by} Someone}
    \vfill
\end{titlepage}
\newpage
\Large \section*{Preface}
blablabla
\newpage
\begin{questions}
\question Suppose $\cos 2\theta=k$, express $\sin^6 \theta-\cos^6 \theta$ in terms of $k$.
\printanswers
\begin{solution}
Notice that 
\begin{align*}
k & =\cos 2\theta\\
& =2\cos^2 \theta-1\\
& =1-2\sin^2 \theta
\end{align*}
Hence, both $\sin^2 \theta$ and $\cos^2 \theta$ can be expressed in terms of $k$ as follow:\\
\begin{equation}
\label{eq:eq1}
    \sin^2 \theta=\dfrac{1-k}{2} \quad \text{and} \quad
\cos^2 \theta=\dfrac{k+1}{2}\\
\end{equation}
Substituting Equation \eqref{eq:eq1} yields
\begin{align*}
    \sin^6 \theta-\cos^6 \theta &= \left(\dfrac{1-k}{3}\right)^3-\left(\dfrac{k+1}{3}\right)^3\\
    &=-\dfrac{k^3+3k}{4}
\end{align*}
\end{solution}
\begin{solution}
aaa
\end{solution}
\end{questions}
\end{document}

введите описание изображения здесь

Я хотел бы сделать нумерацию "Решение 2:", если возможно, и если вопрос имеет только одно решение, я хотел бы увидеть "Решение:" вместо этого. Как я мог это сделать?

решение1

Самый простой способ — добавить среду перечисления внутрь среды решения.

\documentclass{exam}
\usepackage[margin=2.54cm, a4paper]{geometry}
\usepackage{amsmath}
\usepackage{amssymb}
\pagestyle{headandfoot}
\runningheader{}{Solution of Advance Mathematics II}{Year 201X}
\runningheadrule
\runningfooter{}{Page \thepage \,of Page \numpages}{}
%\newcounter{solution}
\unframedsolutions
%\renewcommand{\solutiontitle}{\noindent\textbf{Solution \thequestion: }}
\begin{document}
\begin{titlepage}
    \centering
    \hspace{10cm}\\[5pt]
    \vfill
    {\scshape\Huge School \par}
    \vspace{1cm}
    {\scshape\Large Advanced Mathematics II\par}
    \vspace{1cm}
    {\huge\bfseries Solution Manual\par}
    \vspace{1cm}
    {\Large Trial Exam\par}
    \vspace{1cm}
    {\Large October 201X\par}
    \vspace{1cm}
    {\large \emph{Written by} Someone}
    \vfill
\end{titlepage}
\newpage
\Large \section*{Preface}
blablabla
\newpage
\begin{questions}
\question Suppose $\cos 2\theta=k$, express $\sin^6 \theta-\cos^6 \theta$ in terms of $k$.
\printanswers
\begin{solution}
\begin{enumerate}
\item
Notice that 
\begin{align*}
k & =\cos 2\theta\\
& =2\cos^2 \theta-1\\
& =1-2\sin^2 \theta
\end{align*}
Hence, both $\sin^2 \theta$ and $\cos^2 \theta$ can be expressed in terms of $k$ as follow:\\
\begin{equation}
\label{eq:eq1}
    \sin^2 \theta=\dfrac{1-k}{2} \quad \text{and} \quad
\cos^2 \theta=\dfrac{k+1}{2}\\
\end{equation}
Substituting Equation \eqref{eq:eq1} yields
\begin{align*}
    \sin^6 \theta-\cos^6 \theta &= \left(\dfrac{1-k}{3}\right)^3-\left(\dfrac{k+1}{3}\right)^3\\
    &=-\dfrac{k^3+3k}{4}
\end{align*}
\item
aaa
\end{enumerate}
\end{solution}
\end{questions}
\end{document}

В этой версии используется multisolutionсреда для инициирования решений нумерации.

\documentclass{exam}
\usepackage[margin=2.54cm, a4paper]{geometry}
\usepackage{amsmath}
\usepackage{amssymb}
\pagestyle{headandfoot}
\runningheader{}{Solution of Advance Mathematics II}{Year 201X}
\runningheadrule
\runningfooter{}{Page \thepage \,of Page \numpages}{}
\newcounter{solution}
\unframedsolutions
\newenvironment{multisolution}{%
  \setcounter{solution}{0}%
  \def\solutiontitle{\stepcounter{solution}\noindent\textbf{Solution \thesolution: }}% local definition
  \ignorespaces}%
  {\ignorespaces}
\begin{document}
\begin{titlepage}
    \centering
    \hspace{10cm}\\[5pt]
    \vfill
    {\scshape\Huge School \par}
    \vspace{1cm}
    {\scshape\Large Advanced Mathematics II\par}
    \vspace{1cm}
    {\huge\bfseries Solution Manual\par}
    \vspace{1cm}
    {\Large Trial Exam\par}
    \vspace{1cm}
    {\Large October 201X\par}
    \vspace{1cm}
    {\large \emph{Written by} Someone}
    \vfill
\end{titlepage}
\newpage
\Large \section*{Preface}
blablabla
\newpage
\begin{questions}
\question Suppose $\cos 2\theta=k$, express $\sin^6 \theta-\cos^6 \theta$ in terms of $k$.
\printanswers
\begin{multisolution}
\begin{solution}
Notice that 
\begin{align*}
k & =\cos 2\theta\\
& =2\cos^2 \theta-1\\
& =1-2\sin^2 \theta
\end{align*}
Hence, both $\sin^2 \theta$ and $\cos^2 \theta$ can be expressed in terms of $k$ as follow:\\
\begin{equation}
\label{eq:eq1}
    \sin^2 \theta=\dfrac{1-k}{2} \quad \text{and} \quad
\cos^2 \theta=\dfrac{k+1}{2}\\
\end{equation}
Substituting Equation \eqref{eq:eq1} yields
\begin{align*}
    \sin^6 \theta-\cos^6 \theta &= \left(\dfrac{1-k}{3}\right)^3-\left(\dfrac{k+1}{3}\right)^3\\
    &=-\dfrac{k^3+3k}{4}
\end{align*}
\end{solution}
\begin{solution}
aaa
\end{solution}
\end{multisolution}
\end{questions}
\end{document}

Связанный контент