Your problem is due to the fact that on one hand you use the enumitem
package but then you also define your own lists via the list
environment of LaTeX. The enumitem
package doesn't know about your new list and gets confused.
Basically what happens is that the following code in \enit@preset
makes the wrong choice:
\ifnum\@listdepth=\@ne
\enit@outerparindent\parindent
\else
\parindent\enit@outerparindent
\fi
The idea of this code is to save the outer \parindent
value in \enit@outerparindent
when we enter the first level of lists and if we enter a nested list reuse the saved value instead. Now unfortunately your new list doesn't know about this so nothing gets saved. But if the enumerate
is entered it is in fact already on level 2 and therefore \parindent
gets the current value of \enit@outerparindent
which is, of course, still zero.
So either you simply give listparindent
and explicit value when you call enumarate, e.g.
\begin{enumerate}[parsep=0pt,listparindent=15pt]
or, if you like this properly fixed you could set \enit@outerparindent
in your definition of exercises
if it exists (i.e., if enumitem
was loaded), e.g.,
\makeatletter
\newenvironment{exercises}%
{\begin{list}{\exitem}{%
\@ifundefined{enit@outerparindent}{}% if this command exists set it, otherwise do nothing
{\ifnum\@listdepth=\@ne
\enit@outerparindent\parindent
\else
\parindent\enit@outerparindent
\fi
}%
\usecounter{exercise}%
\small%
\setlength{\itemindent}{\exlabelwidth}%
\addtolength{\itemindent}{\labelsep}%
\setlength{\labelwidth}{\exlabelwidth}%
\addtolength{\labelwidth}{\exsymbolwidth}%
\addtolength{\labelwidth}{\exlabelsep}%
\setlength{\leftmargin}{0.0cm}%
\setlength{\itemsep}{0.0cm}%
\setlength{\parsep}{0.0cm}%
\setlength{\listparindent}{\parindent}%
}%
}%
{\end{list}}
\makeatother
Because of the @
signs you need \makeatletter ...\makeatother
.
Best Answer
You can create a command that acts like
\item[description title]
:You can remove the
\\
if you don’t want a line break. The style of the title is easy to change.Your
enumerate
environment will look like: