我如何正确对齐问题和选项文本,以便下一行不从最左边开始,但缩进/对齐保持不变(如图所示)?
MWE 连接
\documentclass[a4paper]{article}
\RequirePackage{etex}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[version=4,layout=stacked]{mhchem}
\usepackage{multicol}
\usepackage{siunitx}
\usepackage{amsmath,amssymb,mathtools}
\usepackage{tasks}
\usepackage{tikz}
\usepackage[box,completemulti,separateanswersheet,nopage,noshuffle]{automultiplechoice}
\begin{document}
\AMCrandomseed{1237893}
\AMCboxStyle{shape=oval}
\def\AMCformQuestion#1{{\sc Q #1:}}
\def\AMCbeginQuestion#1#2{\par\noindent{\bf Q #1}#2\hspace*{1em}}
\setdefaultgroupmode{withoutreplacement}
%%%%%%%%%%%%%%%%%%%%%%
\element{general}{
\begin{question}{QuestionChemicalBondingStageA- 37 }
In nitrogen family, the \ce{H-X-H} bond angle in the hydrides gradually becomes closer to \ang{90} on going from \ce{N} to \ce{Sb}. This shows that gradually
\begin{choicescustom}
\begin{tasks}[label={}](2)
\task* \correctchoice{ The crystal lattice of ice is mostly formed by covalent as well as hydrogen bonds}
\task* \correctchoice{ The density of water increases when heated from \SI{0}{\celsius} to \SI{4}{\celsius} due to the change in the structure of the cluster of water molecules}
\task* \correctchoice{ Above \SI{4}{\celsius} the thermal agitation of water molecules increases. Therefore, intermolecular distance increase and water starts expanding}
\task* \correctchoice{ The density of water increases from \SI{0}{\celsius} to a maximum at \SI{4}{\celsius} because the entropy (disorder) of the system increases}
\end{tasks}
\end{choicescustom}
\end{question}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\onecopy{1}{
\insertgroup{general}
\AMCcleardoublepage
\AMCformBegin
%%% beginning of the answer sheet header
\begin{multicols*}{2}
\AMCform
\end{multicols*}
}
\end{document}
给出以下输出,我想修改它,如图所示。
以“ 90º 从 开始”开头的行应该直接开始于“ 在氮气中...... ”下方,而不是“Q 1”下方。
与选项完全相同,例如在选项 CI 中,文本从文本下方开始,而不是从选项名称下方开始。
编辑:经过反复尝试,我发现答案/选项中的缩进问题是由于任务包造成的。我仍然无法使用以下方法解决它
\settasks{
item-indent = 2.5em
}
有问题的压痕仍然来自 AMC 包。任何提醒都值得感激!
答案1
的文本question
必须封装在内,\parbox
以对齐两行(或更多行)。
其余设置负责处理其余的事情。
以下代码验证当question
数字有两位数时是否保持正确的对齐。
经过 automultiplechoice.sty 2021/02/12 v1.5.0
测试
automultiplechoice.sty 2018/12/29 v1.4.0
% !TeX TS-program = pdflatex
\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[box,completemulti,separateanswersheet,nopage,noshuffle]{automultiplechoice}
\RequirePackage{etex}
\usepackage[version=4,layout=stacked]{mhchem}
\usepackage{multicol}
\usepackage{siunitx}
\usepackage{amsmath,amssymb,mathtools}
\usepackage{tasks}
\usepackage{tikz}
\usepackage{showframe} %test margins
%%************************************************* added <<<<<<<<<<<<<<
\makeatletter
\renewcommand\AMCrep@perso[2]{\AMC@mem@answer{#1}\AMCanswer{#1}{\hspace*{0.5em}\parbox[c]{0.88\textwidth}{#2}}}
\makeatother
\newlength{\buffspace}
\setlength{\buffspace}{3.2ex}
\newcommand{\setbuffspace}[1]{%
\ifnum #1>9\relax
\setlength{\buffspace}{1.9ex}%
\else\setlength{\buffspace}{3.2ex}%
\fi
\hspace*{\buffspace}%
}
\renewcommand{\AMCbeginQuestion}[2]{\noindent{\bf Q #1}\setbuffspace{\theAMCquestionaff}}
\setlength{\AMCinterBquest}{4ex}% % space inter questions <<<<<<<<<<
\settasks{% added <<<<<<<<<<
item-indent=3.2em, % align with question text
before-skip = 0.5ex, %add space with the question,
after-item-skip = 1.5ex plus 0.7ex minus 0.7ex, % item separation
}
%%********************************************************************************
\begin{document}
\AMCrandomseed{1237893}
\AMCboxStyle{shape=oval}
\setdefaultgroupmode{withoutreplacement}
%%%%%%%%%%%%%%%%%%%%%%
\element{general}{%
\begin{question}{QuestionChemicalBondingStageA- 37 }% <<<<<<<<<<
\parbox[t]{0.9\textwidth}{In nitrogen family, the \ce{H-X-H} bond angle in the hydrides gradually becomes closer to \ang{90} on going from \ce{N} to \ce{Sb}. This shows that gradually}
\begin{choicescustom}[]
\begin{tasks}[label={}](2)
\task* \correctchoice{ The crystal lattice of ice is mostly formed by covalent as well as hydrogen bonds.}
\task* \correctchoice{ The density of water increases when heated from \SI{0}{\celsius} to \SI{4}{\celsius} due to the change in the structure of the cluster of water molecules.}
\task* \correctchoice{ Above \SI{4}{\celsius} the thermal agitation of water molecules increases. Therefore, intermolecular distance increase and water starts expanding.}
\task* \correctchoice{ The density of water increases from \SI{0}{\celsius} to a maximum at \SI{4}{\celsius} because the entropy (disorder) of the system increases.}
\end{tasks}
\end{choicescustom}
\end{question}
\setcounter{AMCquestionaff}{9} % test double digits alignment <<<<<
\begin{question}{QuestionChemicalBondingStageA- 37 }% <<<<<<<<<<<
\parbox[t]{0.9\textwidth}{In nitrogen family, the \ce{H-X-H} bond angle in the hydrides gradually becomes closer to \ang{90} on going from \ce{N} to \ce{Sb}. This shows that gradually.}
\begin{choicescustom}[]
\begin{tasks}[label={}](2)
\task* \correctchoice{ The crystal lattice of ice is mostly formed by covalent as well as hydrogen bonds.}
\task* \correctchoice{ The density of water increases when heated from \SI{0}{\celsius} to \SI{4}{\celsius} due to the change in the structure of the cluster of water molecules.}
\task* \correctchoice{ Above \SI{4}{\celsius} the thermal agitation of water molecules increases. Therefore, intermolecular distance increase and water starts expanding.}
\task* \correctchoice{ The density of water increases from \SI{0}{\celsius} to a maximum at \SI{4}{\celsius} because the entropy (disorder) of the system increases.}
\end{tasks}
\end{choicescustom}
\end{question}
}% end element
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\onecopy{1}{%
\insertgroup{general}
\AMCcleardoublepage
\AMCformBegin
%%% beginning of the answer sheet header
\setlength{\AMCformVSpace}{5ex}
\begin{multicols*}{2}
\AMCform
\end{multicols*}
}
\end{document}