1

Im trying to make it so that the numbering in my document is a bit to the left of the margin, while the section titles and main body of text is aligned to the margin. I also want the nested listing to be to the left right next to the margin.

To better explain I have inserted a picture of how I want it to look like.

enter image description here

But the code I've used to achieve this is just a mess.

\documentclass[12pt]{article}
\usepackage{amsmath} 
\usepackage{enumitem}

\title{Sample Text}
\date{}

\begin{document}
\maketitle
\section*{4.1 - Sample Text}

\begin{enumerate}[leftmargin=-1cm]
\setcounter{enumi}{4100}{}  
\item
\begin{enumerate}[leftmargin=1cm, label=\emph{\alph*})]
\item
 Sample Text

 Sample Text\\

\item Sample Text\\

\end{enumerate}
\item 
\hspace{0.85cm} Sample Text

\hspace{0.85cm} Sample Text
\end{enumerate}

\section*{4.2 - Sample Text}

\begin{enumerate}[leftmargin=-1cm]
\setcounter{enumi}{4200}{}  
\item 
\begin{enumerate}[leftmargin=1cm, label=\emph{\alph*})]
\item Sample Text

\end{enumerate}
\end{enumerate}

\end{document}

I was wondering if anyone could help me find a more elegant solution to my problem.

3
  • 1
    Please, can you add a compilable minimal working example? In other words can you take your code and attach it?
    – Sebastiano
    Commented Apr 20, 2018 at 21:37
  • Changed it to display code instead of image of the code.
    – user160713
    Commented Apr 20, 2018 at 21:47
  • I have seen. Perfect! Thus we can compilable your code and solve your problem.
    – Sebastiano
    Commented Apr 20, 2018 at 21:48

1 Answer 1

1

Here is a simple code, using the enumitem relevant keys. Unrelated: I took the liberty to replace the hyphens is the sections titles with a more correct endash.

\documentclass[12pt]{article}
\usepackage[showframe]{geometry}
\usepackage{amsmath}
\usepackage{enumitem}

\title{Sample Text}
\setlist[enumerate]{leftmargin=0pt}
\setlist[enumerate, 1]{labelwidth =3.6em, align = left, itemsep = 4ex}
\setlist[enumerate, 2]{label=\llap{\emph{\alph*})}, itemsep =\baselineskip}
\date{}

\begin{document}
\maketitle
\section*{4.1 – Sample Text}

\begin{enumerate}[start = 4101]
\item
\begin{enumerate}
\item
 Sample Text

 Sample Text
\item Sample Text
\end{enumerate}
\item
Sample Text

Sample Text
\end{enumerate}

\section*{4.2 –Sample Text}

\begin{enumerate}[start = 4201]
\item
\begin{enumerate}
\item Sample Text

\end{enumerate}
\end{enumerate}

\end{document} 

enter image description here

You must log in to answer this question.