1

Here's my MWE using LuaLaTeX and the scrbook KOMA-Script class:

\documentclass[% % draft, twoside, headings=openany, % parts/chapters start on any page whether it's odd or even DIV=15, % division factor BCOR=12.5mm, % binding correction headsepline=1.5pt, % header line footsepline=0.4pt, % footer line numbers=noenddot, % no dots at the end of section numbering % chapterprefix ]{scrbook} % 11pt, a4paper (default) \usepackage{scrhack} \usepackage[automark]{scrlayer-scrpage} \usepackage[english]{babel} \usepackage[babel]{microtype} \usepackage{mathtools, amssymb} \usepackage[warnings-off={mathtools-colon,mathtools-overbracket}]{unicode-math} % Math fonts \setmathfont{Latin Modern Math} \usepackage{setspace}\setdisplayskipstretch{} \usepackage{enumitem} \setlist[enumerate]{font={\bfseries}} \setlist[enumerate,2]{label=(\roman*), align=left} % shift footer down \ModifyLayer[addvoffset=.6ex]{scrheadings.foot.odd} \ModifyLayer[addvoffset=.6ex]{scrheadings.foot.even} \ModifyLayer[addvoffset=.6ex]{scrheadings.foot.oneside} \ModifyLayer[addvoffset=.6ex]{plain.scrheadings.foot.odd} \ModifyLayer[addvoffset=.6ex]{plain.scrheadings.foot.even} \ModifyLayer[addvoffset=.6ex]{plain.scrheadings.foot.oneside} \begin{document} \onehalfspacing \KOMAoptions{DIV=current} \addtokomafont{pagenumber}{\normalsize\bfseries\sffamily} % page number font \ifoot*{} % inner footer \cfoot*{} % central footer \ofoot*{\pagemark} % outer footer \begin{enumerate} % No. 05 \item[5.] Prove the following: \begin{enumerate} % (i) \item If \(a < b\) and \(c < d\), then \(a + c < b + d\). % (ii) \item If \(a < b\), then \(-b < -a\). % (iii) \item If \(a < b\) and \(c > d\), then \(a - c < b - d\). % (iv) \item If \(a < b\) and \(c > 0\), then \(ac < bc\). % (v) \item If \(a < b\) and \(c < 0\), then \(ac > bc\). % (vi) \item If \(a > 1\), then \(a^2 > a\). % (vii) \item If \(0 < a < 1\), then \(a^2 < a\). % (viii) \item If \(0 \leq a < b\) and \(0 \leq c < d\), then \(ac < bd\). % (ix) \item If \(0 \leq a < b\), then \(a^2 < b^2\). (Use \textbf{(viii)}.) % (x) \item If \(a, b \geq 0\) and \(a^2 < b^2\), then \(a < b\). (Use \textbf{(ix)}, backwards.) \end{enumerate} \end{enumerate} \end{document} 

Here's the compiled result.

enter image description here

My question is: How do I align the start of each \item (which are the "If"s in this specific case)?

I've tried reading the enumitem package documentation for more information on how to use and adjust the parameters: leftmargin, labelindent, labelwidth, labelsep, labelsep*, itemindent, etc.

enter image description here

enter image description here

and I've read several different but related TeX SE questions but I am still rather confused after tinkering with them using \setlist and they would often act weirdly when using nested enumerates (the first and second layer labels would be touching each other or the horizontal space between the second layer label and the items would be to big).

My goal would be to typeset something like this:

enter image description here

Any help would be much appreciated. Thank you.

1 Answer 1

1

Edit:

For the second level of enumerate you need to increase labelwidth so that be wider of items labels, and leftmargin for the same amount + labelsep of the first level of enumerate`. For example:

 \setlist[enumerate,1]{label=\textbf{\arabic*.}, % <--- ccorrected labelsep=1em} % <--- added \setlist[enumerate,2]{label=(\roman*), align=left, labelwidth=2.2em, leftmargin=3.2em} % <--- added 

Wit this change the list will be as follows:

enter image description here

A complete (real) MWE can be:

\documentclass{scrbook} % 11pt, a4paper (default) \usepackage[automark]{scrlayer-scrpage} \usepackage[english]{babel} \usepackage[babel]{microtype} \usepackage[warnings-off={mathtools-colon, mathtools-overbracket}]{unicode-math} % Math fonts \setmathfont{Latin Modern Math} \usepackage{setspace} \setdisplayskipstretch{} \usepackage{enumitem} \setlist[enumerate,1]{label=\textbf{\arabic*.}, % <--- ccorrected labelsep=1em} % <--- added \setlist[enumerate,2]{label=(\roman*), align=left, labelwidth=2.2em, leftmargin=3.2em} % <--- added \begin{document} \begin{enumerate} \item Prove the following: \begin{enumerate}[start=5] % in real document remove this option \item If \(a < b\) and \(c < d\), then \(a + c < b + d\). \item If \(a < b\), then \(-b < -a\). \item If \(a < b\) and \(c > d\), then \(a - c < b - d\). \item If \(a < b\) and \(c > 0\), then \(ac < bc\). \item If \(a < b\) and \(c < 0\), then \(ac > bc\). \item If \(a > 1\), then \(a^2 > a\). \item If \(0 < a < 1\), then \(a^2 < a\). \item If \(0 \leq a < b\) and \(0 \leq c < d\), then \(ac < bd\). \item If \(0 \leq a < b\), then \(a^2 < b^2\). (Use \textbf{(viii)}.) \item If \(a, b \geq 0\) and \(a^2 < b^2\), then \(a < b\). (Use \textbf{(ix)}, backwards.) \end{enumerate} \end{enumerate} \end{document} 
5
  • Ok so I've tried this and it seem to work but how do I solve the distance between nested labels? Commented May 21, 2022 at 6:37
  • I want add a distance between the first-layer label and the second-layer label without affecting the distance between the second-layer label and the second-layer items Commented May 21, 2022 at 6:39
  • @FarrelAhmed, oh I overlook this. I will add this ASAP. Commented May 21, 2022 at 6:42
  • @FarrelAhmed, done! Commented May 21, 2022 at 7:15
  • Ah, I see, I think I'm beginning to understand the parameters more now. I've tried your solutions and used labelsep=0.5em, leftmargin=3em, labelwidth=2.5em instead for my personal taste and it worked! Thank you :D Commented May 21, 2022 at 7:26

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.