Text FormattingAbout Left margins in nested Enumerate environment

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
mturan
Posts: 14
Joined: Wed Nov 10, 2010 10:01 pm

About Left margins in nested Enumerate environment

Post by mturan »

Hi all,

I was trying to use enumeration environment in different levels however the text layout doesn't look like the way I want it. I searched through emunitem pdf but I couldn't come up with a solution. I might have missed some points though.

The code I provided somewhat explains the problem whereas the Jpg looks like the way I want it. Any idea is highly appreciated. Thanks

Code: Select all

\documentclass[a4paper,twoside,10pt]{report}

\usepackage[english]{babel} 
\usepackage[T1]{fontenc}
\usepackage[ansinew]{inputenc}
\usepackage{lmodern} 
\usepackage{graphicx} 
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{blindtext}


\begin{document}
\title{Title of this document}
\author{Firstname Lastname}

\maketitle

\pagestyle{plain} %Now display headings: headings / fancy / ...

\chapter{How Do I get it right?}

\section{Enumerate Problem}
What I want is to have the nested list, in the second or third level, start from the left as the main text.
\blindtext

\begin{enumerate}
	\item \blindtext
	\item \blindtext
	\item \blindtext
\begin{enumerate}
	\item \blindtext
	\item \blindtext
\end{enumerate}
\end{enumerate}

\blindtext
\end{document}
Attachments
enumerate.jpg
enumerate.jpg (98.91 KiB) Viewed 4412 times
Last edited by mturan on Wed Mar 09, 2011 8:21 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

About Left margins in nested Enumerate environment

Post by gmedina »

Hi,

you could try something like this:

Code: Select all

\documentclass[a4paper,twoside,10pt]{report}
\usepackage[english]{babel}
\usepackage{enumitem}
\usepackage{blindtext}

\newlist{mylist}{enumerate}{3}
\setlist[mylist]{leftmargin=0pt,nolistsep}
\setlist[mylist,1]{label=\arabic*.,itemindent=30pt}
\setlist[mylist,2]{label=\alph*.,itemindent=43pt}

\begin{document}
\blindtext\par\medskip

\begin{mylist}
   \item \blindtext
   \item \blindtext
   \item \blindtext
\begin{mylist}
   \item \blindtext
   \item \blindtext
\end{mylist}
\end{mylist}

\blindtext
\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
mturan
Posts: 14
Joined: Wed Nov 10, 2010 10:01 pm

About Left margins in nested Enumerate environment

Post by mturan »

Gmedina,

Thanks for the reply. The solution you showed worked for me. However I modified your code since I have already defined nested numbers and letters in my document class file. So here it goes;

Code: Select all

setenumerate{leftmargin=0pt}
setenumerate[1]{itemindent=2cm}
setenumerate[2]{itemindent=3cm}
setenumerate[3]{itemindent=4cm}
Now I have nested list with 1cm increment from the left margin and all of the lines except the first one start from the left margin as I wanted to show in my previous post's attachment.

Respectfully,

MT.
Post Reply