考试部分对齐

考试部分对齐

代码:

\documentclass[11pt]{exam}
\RequirePackage{xspace, setspace}
\printanswers

\usepackage[margin=1in]{geometry}
\usepackage{wrapfig}
\usepackage{enumitem}

\singlespacing

\parindent 0ex
\begin{document} 
    \begin{questions}
        %\newpage
        \addpoints
        \question[15] Here's the question.
        \begin{parts}
            \part What's the solution for part a?
            \begin{solution}
                Here's the solution for part a.     
            \end{solution}
            \part What's the solution for part b?
            \begin{solution}
                Here's the solution for part b.     
            \end{solution}
        \end{parts}
        Hint: Here's the hint for part b. %Want to put in parts while retaining margin
    \end{questions}
\end{document}

输出: 在此处输入图片描述

有没有办法获取代码里面的提示部分,同时parts保留原有的questions环境余地?

答案1

您正在寻找\uplevel命令(或者\fullwidth提示是否应该使用考试的整个宽度)。

\documentclass[11pt]{exam}
\RequirePackage{xspace, setspace}
\printanswers

\usepackage[margin=1in]{geometry}
\usepackage{wrapfig}
\usepackage{enumitem}

\singlespacing

\parindent 0ex

\begin{document} 
    \begin{questions}
        %\newpage
        \addpoints
        \question[15] Here's the question.
        \begin{parts}
            \part What's the solution for part a?
            \begin{solution}[12in]
                Here's the solution for part a.     
            \end{solution}
            \part What's the solution for part b?
            \uplevel{Hint: Here's the hint for part b.}

            \begin{solution}
                Here's the solution for part b.     
            \end{solution}
        \end{parts}
    \end{questions}
\end{document}

在此处输入图片描述

相关内容