I would like to indent the first line of list items in enumerate
. To do this,
I have defined several kinds of enumerate
-like environments (see below).
In enumerateI
, I just use a non-zero \itemindent
. All the labels are then
moved to the right compared to the standard enumerate
. The distance between
"2." and "(a)" on line "ZZZ" is wrong too.
In enumerateII
, I add \itemindent
to \labelsep
. Labels on lines "XXX",
"YYY" and "WWW" are then at the same position as with enumerate
, but the "(a)"
on line "ZZZ" is not vertically aligned with the "(a)" and "(b)" on lines "YYY"
and "WWW".
In enumerateIII
, I set \itemindent
to 0 if @noparlist
is true. The
alignment of "(a)" on line "ZZZ is now correct, but this time, "WWW" is not
indented anymore and "(b)" is not vertically aligned with the "(a)"'s.
[Note: I have tested @noparlist
, but I don't understand how this switch
differs from @inlabel
and @noparitem
. LaTeX's "source2e" is quite obscure
about this, so if someone could clarify the meaning of these switches, I would
really appreciate that. Should this be a separate question? Anyway, in the cases considered here, it makes no difference.]
I have also tried to modify the lines containing \itemindent
in the
definition of \@item
from "latex.ltx", but without success.
So, my question is the following: how to get the same alignment as with
enumerateII
on lines "XXX", "YYY" and "WWW", and the same as with
enumerateIII
on line "ZZZ"? I know that similar questions have already been
asked before, but I would like an automatic solution not using the enumitem
package. Redefining \@item
is acceptable, if not too daring.
Here is my code:
\documentclass{article}
\makeatletter
\newlength\standardlabelsep
\setlength\standardlabelsep{5pt}
\newlength\myitemindent
\setlength\myitemindent{\parindent}
\newenvironment{enumerateI}{%
\begin{enumerate}%
\setlength\itemindent{\myitemindent}%
\setlength\labelsep{\standardlabelsep}%
}{\end{enumerate}}
\newenvironment{enumerateII}{%
\begin{enumerate}%
\setlength\itemindent{\myitemindent}%
\setlength\labelsep{\standardlabelsep}%
\addtolength\labelsep{\itemindent}%
}{\end{enumerate}}
\newenvironment{enumerateIII}{%
\begin{enumerate}%
\setlength\itemindent{\myitemindent}%
\setlength\labelsep{\standardlabelsep}%
\addtolength\labelsep{\myitemindent}%
\if@noparlist
\setlength\itemindent{0pt}%
\fi
}{\end{enumerate}}
\newcommand\XXX{XXX\dotfill\break xxx\dotfill\hfill}
\newcommand\YYY{YYY\dotfill\break yyy\dotfill\hfill}
\newcommand\ZZZ{ZZZ\dotfill\break zzz\dotfill\hfill}
\newcommand\WWW{WWW\dotfill\break www\dotfill\hfill}
\makeatother
\begin{document}
Standard \verb|enumerate|:
\begin{enumerate}
\item
\XXX
\begin{enumerate}
\item
\YYY
\end{enumerate}
\item
\begin{enumerate}
\item
\ZZZ
\item
\WWW
\end{enumerate}
\end{enumerate}
\verb|enumerateI|:
\begin{enumerateI}
\item
\XXX
\begin{enumerateI}
\item
\YYY
\end{enumerateI}
\item
\begin{enumerateI}
\item
\ZZZ
\item
\WWW
\end{enumerateI}
\end{enumerateI}
\verb|enumerateII|:
\begin{enumerateII}
\item
\XXX
\begin{enumerateII}
\item
\YYY
\end{enumerateII}
\item
\begin{enumerateII}
\item
\ZZZ
\item
\WWW
\end{enumerateII}
\end{enumerateII}
\verb|enumerateIII|:
\begin{enumerateIII}
\item
\XXX
\begin{enumerateIII}
\item
\YYY
\end{enumerateIII}
\item
\begin{enumerateIII}
\item
\ZZZ
\item
\WWW
\end{enumerateIII}
\end{enumerateIII}
\end{document}
minipage
, something like this:\begin{minipage}[t]{\textwidth-\itemindent-\leftmargini} \begin{{enumerateII} ... \end{enumerateII} \end{minipage}
. For this you need add packagecalc
in document preamble.list
in minipage` have different margins, see thelatex.ltx
'manual' ;-)minipage
is not an automatic solution. I would prefer to use the standard LaTeX syntax but redefineenumerate
and, if needed,\@item
. To do this, I would need to understand how this macro works, in particular the meaning of the switches@inlabel
,@noparitem
and@noparlist
...