在考试中的 qformat 问题后添加空格

在考试中的 qformat 问题后添加空格

我在考试课上对问题标题有一个习惯qformat。对于有文字的问题,我希望问题和文字之间有空格。这 \vspace似乎行不通,而且这个问题 \vrule depth 2cm width 0pt似乎只有当我把它放在 中时才能正常工作qformat,但我不想这样做,因为我有一些问题带有文本,而有些则没有——没有文本的问题会在问题部分和问题标题之间留出太多空间。

在此处输入图片描述

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

\usepackage{tikz}

\usepackage{showframe}

\begin{document}

\qformat{\textbf{Question \thequestion} (\totalpoints\ marks)\hfill}

% supposed to have a \newpage and different spacing between ones with no question text and ones with question text.
\newcommand{\newquestion}{\question}
% There should be a command which works and adds sapce.
%\newcommand{\newquestionwithtext}{\newquestion????}

\begin{questions}
% vpsace just doesn't seem to work.
\newquestion\vspace{5cm}
Small Sister is a character in Orge Georwell's book 4891. They famously use the quote "Happy is sad. Is this loss? Lorem Ipsus".

\begin{parts}
\part[2] Explain how the rapid inflation following the big bang has affected the intertextuality of 4891.
\end{parts}

% This adds space between the first line and the second line.
% From https://tex.stackexchange.com/a/353157/200609, it works in qformat but that's not a solution for me.
\newquestion\vrule depth 2cm width 0pt
Small Sister is a character in Orge Georwell's book 4891. They famously use the quote "Happy is sad. Is this loss? Lorem Ipsus".
\begin{parts}
\part[2] Explain how the rapid inflation following the big bang has affected the intertextuality of 4891.
\end{parts}

\newquestion
% This spacing is fine.

\begin{parts}
\part[2] How do you count to 3?
\end{parts}


\end{questions}

\end{document}

答案1

我重新定义\newquestion 为在自定义之后和文本之前\newquestion{<vertical space>}添加一些垂直空白。\qformat

对于没有文字的问题,\question效果很好。

X

% !TeX TS-program = pdflatex

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

\usepackage{tikz}
\usepackage{showframe}

\qformat{\textbf{Question \thequestion} (\totalpoints\ marks)\hfill}

\newcommand{\newquestion}[1]{\question\parbox[t][#1]{\linewidth}{}\par}% changed <<<<<<

\begin{document}
    
    \begin{questions}
        \newquestion{5cm} % adds 5cm of blank space     
        Small Sister is a character in Orge Georwell's book 4891. They famously use the quote "Happy is sad. Is this loss? Lorem Ipsus".
        
        \begin{parts}
            \part[2] Explain how the rapid inflation following the big bang has affected the intertextuality of 4891.
        \end{parts}     
        
        \newquestion{2cm} % adds 2cm of blank space     
        Small Sister is a character in Orge Georwell's book 4891. They famously use the quote "Happy is sad. Is this loss? Lorem Ipsus".
        \begin{parts}
            \part[2]  Explain how the rapid inflation following the big bang has affected the intertextuality of 4891.
        \end{parts}
        
        \question % normal question, no space added
        
        \begin{parts}
            \part[2] How do you count to 3?
        \end{parts}     
        
    \end{questions}
    
\end{document}

相关内容