\fillwithlines 考试中没有出现上级拉伸

\fillwithlines 考试中没有出现上级拉伸

\fillwithlines{\stretch{1}}在 -esque 环境中使用该命令时\uplevel,不会显示线条。当将长度指定为 fillwithlines 时,不会发生此问题。

\documentclass{exam}
\usepackage[utf8]{inputenc}
\usepackage{showframe}

\begin{document}
\begin{questions}
\question The apples and oranges say it takes two to tangarine.

\begin{parts}
\part[5] The bananas have come to say hello!

\uplevel{
\fillwithlines{\stretch{1}}
}
\begin{EnvUplevel}
\fillwithlines{\stretch{1}}
\end{EnvUplevel}

\part[5] The bananas have come to say hello!

\begin{EnvUplevel}
\fillwithlines{10cm}
\end{EnvUplevel}
\end{parts}
\end{questions}
\end{document}

编译后的 LaTeX 代码显示,第一个问题没有行,而第二个问题有。

答案1

这可能是一个错误。我对\uplevel命令做了相同的更改以使其正常工作。

b

使用文档类别:考试 2021/02/26 版本 2.7

\documentclass{exam}
\usepackage[utf8]{inputenc}
\usepackage{showframe}

\makeatletter

\long\def\uplevel#1{% changed <<<<<
    \saved@totalleftmargin=\leftskip
    \par\bigskip
    \leftskip=\@totalleftmargin
    \advance\leftskip-\leftmargin
    \advance\@totalleftmargin-\leftmargin
    \advance\linewidth\leftmargin   
    #1%
    \advance\linewidth-\leftmargin  
    \advance\@totalleftmargin+\leftmargin
    \leftskip=\saved@totalleftmargin
\nobreak
}

\renewenvironment{EnvUplevel}
{\saved@totalleftmargin=\@totalleftmargin
    \par\bigskip\bgroup%
    \leftskip=\@totalleftmargin
    \advance\leftskip-\leftmargin
    \advance\@totalleftmargin-\leftmargin
    \advance\linewidth\leftmargin
}
{\egroup\@totalleftmargin=\saved@totalleftmargin\nobreak}

\makeatother

\begin{document}
    
\begin{questions}
    \question The apples and oranges say it takes two to tangarine. 

    \begin{parts}
        
        
        \part[5] The \textbf{bananas} have come to say hello! \verb|\fillwithlines{\stretch{1}}|
        \uplevel{
            \fillwithlines{\stretch{1}}
        }
    
        \part[15] The \textbf{pears} have come to say hello! \verb|\fillwithlines{\stretch{1}}|
        
        \begin{EnvUplevel}
            \fillwithlines{\stretch{1}}
        \end{EnvUplevel}
    
        
        \part[25]  The \textbf{grapes} have come to say hello!  \verb|\fillwithlines{3cm}|  
            
        \begin{EnvUplevel}
            \fillwithlines{3cm}
        \end{EnvUplevel}
    
    
    \end{parts}

\end{questions}

\end{document}

相关内容