我正在出考试题目,想让试卷上的题目编号对齐。
这是我迄今为止的努力:
\documentclass{article}
\usepackage[a4paper, portrait, margin=0.5in]{geometry}
\usepackage{fontspec}
\usepackage{anyfontsize}
\renewcommand{\familydefault}{\sfdefault}
\newcommand{\RNum}[1]{\uppercase\expandafter{\romannumeral #1\relax}}
\setsansfont{Times New Roman} \fontsize{11.5pt}{13.8pt}\selectfont
\begin{document}
\thispagestyle{empty}
\noindent \textbf{Formatting for Questions} \\
\\
\textbf{1} \hspace{0.5495cm} \textbf{(a)} \hspace{0.2cm} Question here \\
\hspace*{0.8525cm} \textbf{(a)} \hspace{0.1525cm} Question here \\
\hspace*{1.6775cm} Question here \\
\hspace*{0.8525cm} \textbf{(a)} \hspace{0.14cm} \textbf{(i)} \hspace{0.1485cm} Question here \\
\hspace*{0.8525cm} \textbf{(b)} \hspace{0.1175cm} \textbf{(i)} \hspace{0.1485cm} Question here \\
\hspace*{0.8525cm} \textbf{(d)} \hspace{0.1175cm} \textbf{(i)} \hspace{0.1485cm} Question here \\
\hspace*{1.6645cm} \textbf{(i)} \hspace{0.15cm} Question here \\
\hspace*{1.55175cm} \textbf{(ii)} \hspace{0.15cm} Question here \\
\hspace*{1.43925cm} \textbf{(iii)} \hspace{0.1515cm} Question here \\
\hspace*{2.4cm} Question here \\
\hspace*{0.8525cm} \textbf{(b)} \hspace{0.1285cm} Question here \\
\hspace*{0.8525cm} \textbf{(c)} \hspace{0.17375cm} Question here \\
\hspace*{0.8525cm} \textbf{(d)} \hspace{0.12825cm} Question here \\
\hspace*{0.8525cm} \textbf{(e)} \hspace{0.1735cm} Question here \\
\hspace*{0.865cm} Question here
\end{document}
如上所示,我一直在使用\hspace
它来对齐问题编号,但是由于子问题的组合无穷无尽,它效率很低,而且稍微不准确。
(a)
、、、等(b)
(d)
开始在红线处(不在一起结束)- 第二列
Question here
,(i)
开始在蓝线处(忽略(ii)
和(iii)
) (i)
、、、等(ii)
(iii)
结尾在绿线处(不一起出发)- 第四
Question here
列开始在黄线处
任何帮助都将不胜感激。提前致谢!
答案1
enumitem 包允许问题本地对齐。使用shortlabels
选项,您可以通过添加所需的标签类型来简单地修改标签。
\documentclass{article}
\usepackage[a4paper, portrait, margin=0.5in]{geometry}
%\usepackage{fontspec}
\usepackage[shortlabels]{enumitem}
\usepackage{anyfontsize}
\renewcommand{\familydefault}{\sfdefault}
\newcommand{\RNum}[1]{\uppercase\expandafter{\romannumeral #1\relax}}
%\setsansfont{Times New Roman} \fontsize{11.5pt}{13.8pt}\selectfont
\begin{document}
\thispagestyle{empty}
\noindent \textbf{Formatting for Questions} \\
\\
\begin{enumerate}[1,leftmargin=10mm]
\item Question here
\item Question here
\item \begin{enumerate}[(a),leftmargin=18pt]
\item Question here
\item Question here
\item Question here
\begin{enumerate}[(i),leftmargin=16pt]
\item Question here
\item Question here
\item Question here
\item Question here
\end{enumerate}
\item Question here
\end{enumerate}
\item Question here
\item Question here
\end{enumerate}
\end{document}