1

I am fairly new to LaTEX. I am writing a large document in which I need to number every clause so I am using the Enumerate in LaTEX which works fine. Sometimes I need to Write the Clauses in 2 or more levels. So I am using nested "Enumerate" Solutions. But When I go to Level II, there is a small additional space in the first row of the particular Clause. However, the remaining rows of the clauses are perfectly justified as required. The problem doesn't occur while writing text in Enumerate Level I. How Can I edit so that the Enumerate Level II or more also shows fully justified text as in Level I?

Please Help!!!

Minimal Code Example is as under:

\documentclass[a4paper, 12pt, twoside]{thesis}

\usepackage[square, numbers, comma, sort&compress]{natbib}

\usepackage{verbatim} 

\usepackage{lipsum}  

\usepackage{textcomp}

\usepackage{vector} 

\usepackage{url}
\usepackage{natbib}

\usepackage[compact]{titlesec}

\titleformat{\chapter}[display]
   {\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{01pt}{\Huge}
\titlespacing*{\chapter}{0pt}{01pt}{01pt}

\setlength{\parskip}{6pt}

\usepackage{fancyhdr}

\usepackage[document]{ragged2e}

\usepackage{enumitem}
\usepackage{etoolbox}

\usepackage{array}

\titleformat{\chapter}[display]{\normalfont\bfseries}{}{0pt}{\huge}

\titleformat{\section}{\normalfont\upshape\bfseries}{\thesection}{2.7em}{\large}

\titleformat{\subsection}{\normalfont\upshape}{\thesubsection}{2.5em}{\normalsize}

\titleformat{\paragraph}{\normalfont\upshape}{\thesubsection}{1em}{\normalsize}

\setcounter{secnumdepth}{4}

\begin{document}
\mainmatter

\pagestyle{fancy} 

\renewcommand{\chaptermark}[1]{ \markboth{#1}{} }
\renewcommand{\sectionmark}[1]{ \markright{#1}{} }
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}%

\addtocontents{toc}{\vspace{2em}} 

\justifying

\pretolerance=10000

\begin{enumerate}[leftmargin=4.5em,labelsep=2.7em,align=right,label={\thesection.\arabic*}]

\item \lipsum

\vspace{0.5em}

\begin{itemize}

\item \lipsum

\end{itemize}

\end{enumerate}

\end{document}
  • Please add a minimal code that we can test. – user156344 Apr 12 '19 at 14:12
  • Edit the question, add it to the question. – user156344 Apr 12 '19 at 14:30
  • For the second level, enumitem calculates \labelwidth as a negative value, presumably to get \labelsep (which stays the same as the first level) to fit into a given space. Use \begin{itemize}[labelwidth=1em] for example. – John Kormylo Apr 12 '19 at 15:19
1

This solution stores the default values before starting enumerate. Alternatively, you can use [labelwidth=*, labelsep=*] but the results are not quite the same.

\documentclass[a4paper, 12pt, twoside]{thesis}

\usepackage[square, numbers, comma, sort&compress]{natbib}

\usepackage{verbatim} 

\usepackage{lipsum}  

\usepackage{textcomp}

\usepackage{vector} 

\usepackage{url}
\usepackage{natbib}

\usepackage[compact]{titlesec}

\titleformat{\chapter}[display]
   {\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{01pt}{\Huge}
\titlespacing*{\chapter}{0pt}{01pt}{01pt}

\setlength{\parskip}{6pt}

\usepackage{fancyhdr}

\usepackage[document]{ragged2e}

\usepackage{enumitem}
\usepackage{etoolbox}

\usepackage{array}

\titleformat{\chapter}[display]{\normalfont\bfseries}{}{0pt}{\huge}

\titleformat{\section}{\normalfont\upshape\bfseries}{\thesection}{2.7em}{\large}

\titleformat{\subsection}{\normalfont\upshape}{\thesubsection}{2.5em}{\normalsize}

\titleformat{\paragraph}{\normalfont\upshape}{\thesubsection}{1em}{\normalsize}

\setcounter{secnumdepth}{4}
\newcommand{\normalwidth}{}% reserve global names
\newcommand{\normalsep}{}

\begin{document}
\mainmatter

\pagestyle{fancy} 

\renewcommand{\chaptermark}[1]{ \markboth{#1}{} }
\renewcommand{\sectionmark}[1]{ \markright{#1}{} }
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}%

\addtocontents{toc}{\vspace{2em}} 

\justifying

\pretolerance=10000

\edef\normalwidth{\the\labelwidth}%
\edef\normalsep{\the\labelsep}%

\begin{enumerate}[leftmargin=4.5em,labelsep=2.7em,align=right,label={\thesection.\arabic*}]

\item \lipsum[1-2]

\vspace{0.5em}

\item \the\labelwidth~\the\labelsep

\begin{itemize}[labelwidth=\normalwidth, labelsep=\normalsep]
\item \the\labelwidth~\the\labelsep
\item \lipsum[3-4]
\end{itemize}

\begin{itemize}[labelwidth=*, labelsep=*]
\item \the\labelwidth~\the\labelsep
\item \lipsum[3-4]
\end{itemize}

\end{enumerate}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.