在文件類考試中如何控制問題的縮排

在文件類考試中如何控制問題的縮排

我使用 qformat 將問題設定為我想要的格式,但是我無法讓「問題」像前面的段落一樣在左邊距齊平。我已經包含了程式碼和輸出的圖像。我真正想要的是有問題的 Q 直接位於表示允許的 A 下方。有人能幫忙嗎?

\documentclass{exam}
\usepackage[a4paper,left=1cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\usepackage{setspace}
\setlength\parindent{0pt}

\begin{document}
 \qformat{\textbf{\quad Question \thequestion. (Marks \totalpoints)\hfill} }
 {\huge\textbf{Section II}}

 {\large\textbf{Attempt All Questions}
        
\textbf{Allow about 45 Minutes for these questions}\newline}

%\newgeometry{left=0.5cm}
\begin{questions}
   

%\fillwithlines{2cm}
\question What is the time

\question[3]
Whas is the color of the ocean


\question[3]
What is the color of the sky

\fillwithlines{2cm}
\singlespacing
\end{questions}
\end{document}

在此輸入影像描述

我所追求的那種佈局。 在此輸入影像描述

答案1

這裡是。您應該使用\renewcommand{\questionshook}並更改左邊距。手冊第 4.4 節中有更多資訊。

\documentclass{exam}
\usepackage[a4paper,left=1cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\usepackage{setspace}
\setlength\parindent{0pt}

\renewcommand{\questionshook}{%
\setlength{\leftmargin}{0pt}%
\setlength{\labelwidth}{-\labelsep}%
}

\begin{document}
\qformat{\textbf{Question \thequestion. (Marks \totalpoints)}\hfill}
 
{\huge\textbf{Section II}}

{\large\textbf{Attempt All Questions}
        
\textbf{Allow about 45 Minutes for these questions}\newline}

\begin{questions}
\question What is the time

\question[3]
Whas is the color of the ocean


\question[3]
What is the color of the sky

\fillwithlines{2cm}
\singlespacing
\end{questions}
\end{document}

結果

相關內容