在考试文档类中,如何使用EnvUplevel进行跨多页的解答?

在考试文档类中,如何使用EnvUplevel进行跨多页的解答?

在考试文档类中,如何使用 EnvUplevel 来获取跨多页的解决方案?这是我的代码。(如果解决方案在一页之内,它就可以完美运行)(我使用的是页面大小 a5)

\documentclass[answers]{exam}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
% \Aboxed in the following
\usepackage{mathtools}

% page size
\usepackage{geometry}
\geometry{
    papersize={140mm,210mm},
    twoside=True,
    inner=15mm,
    outer=15mm,
    bindingoffset=7mm,
    top=20mm,
    bottom=22.5mm   
}

\extrawidth{.5in}

\header{\oddeven{}{\thepage}}%
    {{\small 18MAT41 - Jan/Feb 2021}}%
    {\oddeven{\thepage}{}}
\footer{}{{\small Visit entuition.org to unlock all QRs}}{}

\begin{document}

\begin{questions}
% Question 1 
% \renewcommand{\thequestion}{5}
\question 
\begin{parts}
% Question 1a
\part
    Show that $w = \log z$, $z \neq 0$ is analytic and hence find $\displaystyle{dw \over dz}$.

% Solution 1a
\begin{EnvUplevel}
\begin{TheSolution}
        Given,
    \[w = \log z \tag{1}\] 
    We know, 
    \[ z = r e^{i \theta} \]
    Substituting $z$ in (1),
    \begin{align*}
        w &= \log ( r e^{i \theta}) \\
        w &= \log r + \log e^{i \theta} \\
        w &= \log r + i \theta \tag{2}
    \end{align*}
    We know,
    \[ w = u+ iv \tag{3}\]
    Comparing (2) and (3),
    \begin{align*}
            u &= \log r           &     v &= \theta
    \end{align*}
    Partially differentiate with respect to $r$,
    \begin{align*}
            u_r &= {1 \over r} &        v_r &= 0 \tag{4}
    \end{align*}
    Partially differentiate with respect to $\theta$,
    \begin{align*}
            u_{\theta} &= 0    &        v_{\theta} &= 1 \tag{5} 
    \end{align*}
        We know CR equations are,
        \begin{align*}
            r u_r &= v_{\theta} \\
            r v_r &= -u_{\theta}
        \end{align*}
        From (4) and (5),
        \begin{align*}
            r u_r &= r \cdot {1 \over r} = 1 = v_\theta \\
            r v_r &= r \cdot 0 = 0 = -u_\theta
        \end{align*}
        The CR equations are satisfied. Hence $w = \log z$ is analytic.\\
        We know, 
        \[{dw \over dz} = e^{-i \theta}(u_r + iv_r)\]
        Substituting $u_r$ and $v_r$ from (4),
        \begin{align*}
            {dw \over dz} &= e^{-i \theta} \left( {1 \over r} + i \, 0 \right) \\
            {dw \over dz} &= {1 \over re^{i \theta}} \\
            \Aboxed{{dw \over dz} &= {1 \over z}}
        \end{align*}
        
\end{TheSolution}
\end{EnvUplevel} 

\end{parts}
\end{questions}
\end{document}

答案1

EnvUpLevel 将内容放入 中\vbox,该 无法被破坏。这使用\trivlist

\documentclass[answers]{exam}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
% \Aboxed in the following
\usepackage{mathtools}

% page size
\usepackage{geometry}
\geometry{
    papersize={140mm,210mm},
    twoside=True,
    inner=15mm,
    outer=15mm,
    bindingoffset=7mm,
    top=20mm,
    bottom=22.5mm
}

\extrawidth{.5in}

\header{\oddeven{}{\thepage}}%
    {{\small 18MAT41 - Jan/Feb 2021}}%
    {\oddeven{\thepage}{}}
\footer{}{{\small Visit entuition.org to unlock all QRs}}{}

% compute \leftmargin for each level
\settowidth{\leftmargin}{10.\hskip\labelsep}%
\edef\exammargini{\the\leftmargin}%
\settowidth{\leftmargin}{(m)\hskip\labelsep}%
\edef\exammarginii{\the\leftmargin}%
\settowidth{\leftmargin}{vii.\hskip\labelsep}%
\edef\exammarginiii{\the\leftmargin}%
\settowidth{\leftmargin}{($\psi$)\hskip\labelsep}%
\edef\exammarginiv{\the\leftmargin}%

\makeatletter
\newenvironment{myuplevel}{\ifnum\@listdepth>0
    \leftmargin=\csname exammargin\@roman\@listdepth\endcsname\relax
    \advance\@totalleftmargin-\leftmargin
  \fi
  \trivlist
  \ifnum\@listdepth>0
    \leftskip=-\csname exammargin\@roman\@listdepth\endcsname\relax
    \advance\@listdepth-1
  \fi
  \item}{\endtrivlist}
\makeatother

\begin{document}

\begin{questions}
% Question 1 
% \renewcommand{\thequestion}{5}
\question 
\begin{parts}
% Question 1a
\part
    Show that $w = \log z$, $z \neq 0$ is analytic and hence find $\displaystyle{dw \over dz}$.

% Solution 1a
\begin{myuplevel}
\begin{TheSolution}
        Given,
    \[w = \log z \tag{1}\] 
    We know, 
    \[ z = r e^{i \theta} \]
    Substituting $z$ in (1),
    \begin{align*}
        w &= \log ( r e^{i \theta}) \\
        w &= \log r + \log e^{i \theta} \\
        w &= \log r + i \theta \tag{2}
    \end{align*}
    We know,
    \[ w = u+ iv \tag{3}\]
    Comparing (2) and (3),
    \begin{align*}
            u &= \log r           &     v &= \theta
    \end{align*}
    Partially differentiate with respect to $r$,
    \begin{align*}
            u_r &= {1 \over r} &        v_r &= 0 \tag{4}
    \end{align*}
    Partially differentiate with respect to $\theta$,
    \begin{align*}
            u_{\theta} &= 0    &        v_{\theta} &= 1 \tag{5} 
    \end{align*}
        We know CR equations are,
        \begin{align*}
            r u_r &= v_{\theta} \\
            r v_r &= -u_{\theta}
        \end{align*}
        From (4) and (5),
        \begin{align*}
            r u_r &= r \cdot {1 \over r} = 1 = v_\theta \\
            r v_r &= r \cdot 0 = 0 = -u_\theta
        \end{align*}
        The CR equations are satisfied. Hence $w = \log z$ is analytic.\\
        We know, 
        \[{dw \over dz} = e^{-i \theta}(u_r + iv_r)\]
        Substituting $u_r$ and $v_r$ from (4),
        \begin{align*}
            {dw \over dz} &= e^{-i \theta} \left( {1 \over r} + i \, 0 \right) \\
            {dw \over dz} &= {1 \over re^{i \theta}} \\
            \Aboxed{{dw \over dz} &= {1 \over z}}
        \end{align*}
        
\end{TheSolution}
\end{myuplevel}

\end{parts}
\end{questions}
\end{document}

相关内容