How to properly align/indent questions (question text) and options?

Added by aman saurav over 2 years ago

How do i align the question and the option text properly such that the next line doesnt start from that far left but the indent/alignment is maintained as shown?

MWE Attached
Gives the following output ( attached) which i would like to modify as shown.

Requirement - the line starting with " 90º on going from " should be starting directly below " In nitrogen... " and not below "Q 1."

Exact same thing with options, like in option C I would like the text to start below the text and not below the option name.

mainfile.tex (1.8 kB)

mainfile.pdf (92.1 kB)


Replies (6)

RE: How to properly align/indent questions (question text) and options? - Added by Rafael Rodriguez over 2 years ago

Maybe adding something like:

\settasks{
item-indent = 2em
}

could solve the indentation for the answers.

RE: How to properly align/indent questions (question text) and options? - Added by aman saurav over 2 years ago

can you show me an example of where you'd put it?

i put it right after \begin{document} but it didnt help.

i tried putting an absurdly high value ( 14.33em ) and the result was as shown.

it didnt solve my issue, but it atleast clarified it somewhat, that for answers its the tasks package issue ( perhaps) and for question its AMC issue.

Screenshot_2021-09-07_at_9.48.41_PM.png - high em value of 14.33 (71 kB)

RE: How to properly align/indent questions (question text) and options? - Added by Rafael Rodriguez over 2 years ago

Sorry for the wrong advice. I normally use tasks outside of auto-multiple-choice and the item-indent is honored.
I attach a mainfile.tex where instead of using tasks and choicescustom I just use choices.
What's your aim using tasks?

mainfile.tex (1.7 kB)

DOC-sujet.pdf (39.4 kB)

RE: How to properly align/indent questions (question text) and options? - Added by Frédéric Bréal over 2 years ago

\usepackage{linegoal}

\parbox[t]{\linegoal}{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}

RE: How to properly align/indent questions (question text) and options? - Added by aman saurav over 2 years ago

@rafael i use customchoices because i wanted to enumerate horizontally instead of vertically. Check out this link. [[https://tex.stackexchange.com/questions/595805/using-multicols-or-tasks-to-enumerate-horizontally-instead-of-vertically-in-auto]]

@gerard your solution helped. but instead of writing it for every question is it possible to define it for every question at the beginning of the document or something?

in addition i used choices instead of customchoices, it showed me some error of "perhaps a missing item" when i ignored the error, the output was correct.

So two questions
1. how to define the linegoal at the beginning of document?
2. is there any issue or resolution to using choices or customchoices.

RE: How to properly align/indent questions (question text) and options? - Added by Frédéric Bréal over 2 years ago

how to define the linegoal at the beginning of document?

I don't know.

is there any issue or resolution to using choices or customchoices

Another idea but english language is not my native english, so may be i misunderstood your request .

\usepackage{hlist,linegoal}
\parbox[t]{\linegoal}{
In nitrogen family, the \ch{H-X-H} bond angle in the hydrides gradually becomes closer to \ang{90} on going from \ch{N} to \ch{Sb}. This shows that gradually}

\def\AMCbeginAnswer{\hlist[label=,left margin=1em]2}
\def\AMCendAnswer{\endhlist}
\begin{choicescustom}

\hitem \correctchoice{The crystal lattice of ice is mostly formed by covalent as well as hydrogen bonds}
\hitem  \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}
\hitem  \correctchoice{Above  \SI{4}{\celsius}  the thermal agitation of water molecules increases. Therefore, intermolecular  distance increase and water starts expanding}
\hitem  \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{choicescustom}

I use chemformula package \ch{} instead mhchem \ce{}.

(1-6/6)