summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/enumitem/enumitem.tex
blob: ee15d9ff848c1373dea0e7e9b3c8eba54785e7a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
% +--------------------------------------------------+
% | Typeset this file to document enumitem.sty       |
% +--------------------------------------------------+
%
% Copyright (c) 2003-2009 by Javier Bezos.
% All Rights Reserved.
%
% This file is part of the enumitem distribution release 2.2
% -----------------------------------------------------------
% 
% It may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
%   http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2003/12/01 or later.
% 
% This work has the LPPL maintenance status "maintained".
% 
% The Current Maintainer of this work is Javier Bezos.

\documentclass{article}

\usepackage{hyperref}

%\usepackage{pslatex}

\title{Customizing lists\\with the\\\textsf{enumitem} package}

\author{Javier Bezos\footnote{For bug reports, comments and
suggestions go to \href{http://www.tex-tipografia.com/enumitem.html}%
{\texttt{http://www.tex-tipografia.com/enumitem.html}}.
English is not my strong point, so contact me when you
find mistakes in the manual. Other packages by the same author:
\textsf{gloss} (with Jos\'e Luis D\'{\i}az), \textsf{accents,
tensind, esindex, dotlessi, titlesec, titletoc}.}}

\date{Version 2.2\\2009-05-18}

\IfFileExists{enumitem.sty}{\usepackage{enumitem}}{}

\addtolength{\topmargin}{-3pc}
\addtolength{\textwidth}{6pc}
\addtolength{\oddsidemargin}{-2pc}
\addtolength{\textheight}{7pc}

\raggedright
\parindent1.8em
\parskip0pt

\begin{document}

\maketitle

\section{Introduction}

When I began to use \LaTeX{} several year ago, two particular points
annoyed me because I found customizing them was very complicated
---headlines/footlines and lists.  A new way to redefine the former is
accomplished in my own \textit{titlesec} package, but none was
availiable to customize the latter except:
\begin{itemize}
\item \textsf{enumerate}, which just allows to change the label and
it does it pretty well (or almost, as in Spanish a standard label is
\textit{a}) which cannot be set with \verb|\emph{a})| and one must
write \verb|\itshape a\/\upshape)|).

\item \textsf{mdwlist}, which only ``provides some vaguely useful
list-related commands and environments,'' as its manual states,
and not a coherent way of handling lists.

\item \textsf{paralist}, which provides lists within a paragraph (the
original purpose of this package), a few other hard-wired
specific changes and the optional argument of \textsf{enumerate}.
Note \textsf{enumitem} does not allow grouping items within
a paragraph yet.
\end{itemize}

One of the main drawbacks of the standard \verb|list| is its weird
parameters, whose meaning is not always obvious.  In order to provide
a cleaner interface two approaches were possible: either defining new
lists, or introducing a new syntax making the standard lists easier to
customize.  For marks I took the first approach in titlesec, just
because I did not manage to find a satisfactory solution with the
\LaTeX{} internal macros, but since lists are in some sense more
``complete'' than sections and marks, I have taken here the second
approach.

In the interface a sort of ``inheritance'' is used. You can
set globally the behaviour of lists and then override several
parameters of, say, enumerate and then in turn override
a few paremeters of a particular instance. The values will
be searched in the hierarchy.

This is basically an advance of a project which I am working
on which will add this kind of inheritance to other structures
of \LaTeX{}.

\section{The package}

This package is intended to ease customizing the three
basic list environments: \verb|enumerate|, \verb|itemize| and
\verb|description|. It extends their syntax to allow
an optional argument where a set of parameters in the
form \verb|key=value| are available:
\begin{itemize}
\item
Vertical spacing:
\begin{itemize}
\item \verb|topsep|
\item \verb|partopsep|
\item \verb|parsep|
\item \verb|itemsep|
\end{itemize}
\item
Horizontal spacing:
\begin{itemize}
\item \verb|leftmargin|
\item \verb|rightmargin|
\item \verb|listparindent|
\item \verb|labelwidth|
\item \verb|labelsep|
\item \verb|itemindent|
\end{itemize}
\end{itemize}

These are equivalent to the well known list parameters, but
two of them, namely \verb|leftmargin| and \verb|labelsep|,
can have in addition the special value of \verb|*| as
described below. 

The following new parameters are provided:
\begin{itemize}

\item \verb|font|. Sets the label font. Useful when the label is
changed with the optional argument of \verb|\item|.

\item \verb|label|.  Sets the label to be used in the current level.
A set of starred versions of \verb|\alph|, \verb|\Alph|,
\verb|\arabic|, \verb|\roman| and \verb|\Roman|, without argument
stand for the current counter in \verb|enumerate|.\footnote{Actually,
the asterisk is currently the argument but things may change.
Consider them as starred variants and follow the corresponding
syntax.} Thus
\begin{verbatim}
\begin{enumerate}[label=\emph{\alph*})]
\end{verbatim}
prints \textit{a}), \textit{b}), and so on (this is a
standard style in Spanish).

A fancier example (which looks ugly, but it is intended only
to illustrate what is possible; requires \textsf{color} and
\textsf{pifont}):
\begin{verbatim}
\begin{enumerate}[label=\protect\fcolorbox{blue}{yellow}{\ding{\value*}},
                  start=172]
\end{verbatim}

\item \verb|label*| is like \verb|label| but its value is appended to 
the current label. For example, the follollowing defines a 
\verb|legal| list (1., 1.1., 1.1.1., and so on):
\begin{verbatim}
\newlist{legal}{enumerate}{10}
\setlist[legal]{label*=\arabic*.}
\end{verbatim}


\item \verb|ref|. By default, \verb|label| sets also the form of cross
references and \verb|\the...|, but you can define a
different format. For
example, to remove the right parethesis:
\begin{verbatim}
\begin{enumerate}[label=\emph{\alph*}),ref=\emph{\alph*}]
\end{verbatim}
In both \verb|label| and \verb|ref|, the counters can be
used as usual:
\begin{verbatim}
\begin{enumerate}[label=\theenumi.\arabic*.]
\end{verbatim}
or
\begin{verbatim}
\begin{enumerate}[label=\arabic{enumi}.\arabic*.]
\end{verbatim}
(provided the current level is the second one).

Note the \verb|label|s are \textit{not} accumulated to form
the reference. If you want, say, something like 1.\textit{a}
from 1) as first level and \textit{a}) as second level,
you must set it with \verb|ref|. You may use
\verb|\ref{level1}.\ref{level2}| with appropiate \verb|ref|
settings, but as Robin Fairbairns points out in the \TeX{} FAQ
\begin{quote}
\dots{} [that] would be both tedious and error-prone. What is more, it 
would be undesirable, since you would be constructing a visual 
representation which is inflexible (you could not change all the 
references to elements of a list at one fell swoop).
\end{quote}
This is sensible and I recommend to follow the advice, but sometimes
you might want something like:
\begin{verbatim}
... subitem \ref{level2} of item \ref{level1} ...
\end{verbatim}

Both \verb|label| and \verb|ref| are moving arguments, and fragile
commands must be protected \textit{except} the counters.

\item \verb|leftmargin=*|.  Sets the label width to the width of
the current label, using the default value of \textit{0} in
\verb|\arabic*|, \textit{viii} in \verb|\roman*|, \textit{m} in
\verb|\alph*| and similarly in uppercase forms.  The left
margin is then set to \verb|labelwidth| $+$ \verb|labelsep|.
You can give a value to the key \verb|widest|, and it will
be used to set the margin.  For example:
\begin{verbatim}
\begin{itemize}[label=\textbullet, leftmargin=*]
\begin{enumerate}[label=\roman*), leftmargin=*, widest=iii]
\end{verbatim}

Put in in other words, the label starts at the same place as the
surrounding text (but see \verb|labelindent| below), then comes the
label, the space after it as set by \verb|labelsep| and the item body.

\item \verb|labelsep=*|. Similar to the previous one
but here the label sep is set to \verb|leftmargin| $-$
\verb|labelwidth|.
\begin{verbatim}
\begin{itemize}[label=\textbullet,
                leftmargin=2pc, labelsep=*]
\end{verbatim}

As before, the label starts at the same place as the surrounding text,
then comes the label, the space after it and the item body.  The
difference between \verb|labelsep=*| and \verb|leftmargin=*| is that
in the former the item body begins at a fixed place (namely,
\verb|leftmargin|), while the latter begins at a variable place
depending on the label (but always the same within a list, of course).
Most of times, what you would want is \verb|leftmargin=*|.

Unfortunately, \verb|labelsep| has not a default value
to be applied to all lists---simply the current value
is used. If you nest a \verb|leftmargin=*| within a
\verb|labelsep=*|, the value to compute the left margin
is not what you could expect. The way \LaTeX{} assigns values
to the list parameters is one of the things which makes
redefining lists a mess, but with \textsf{enumitem} you can
set default values for every list, as described below.
In this case, all you need is:
\begin{verbatim}
\setlist{itemsep=.5em}
\end{verbatim}

% \textbf{Note.} Version 0.2 computes the values even with
% the settings predefined by the classes (only partially
% tested). Please, let me know if a class gives a wrong
% result.

\item \verb|widest|. To be used in conjunction with any of the
two previous keys, if desired. It overrides the default
values for the label width. Sometimes, if lists are not very
long, a value of \verb|a| for \verb|\alph| is more sensible
than \verb|m|:
\begin{verbatim}
\begin{enumerate}[leftmargin=*,widest=a] % Assume standard 2nd level
\end{verbatim}

\item \verb|labelindent|. Blank space before the label
with \verb|leftmargin=*| and \verb|labelsep=*|, and in
\verb|description|. Example:
\begin{verbatim}
\begin{enumerate}[label=\arabic*., leftmargin=2\parindent, 
                  labelindent=\parindent, labelsep=*]
\end{verbatim}

Since \verb|\parindent| is not used as such inside lists, but instead
is set internally to either \verb|itemindent| or \verb|listparindent|,
when used as the value of a parameter \textsf{enumitem} returns the
global value, i.  e., the value it has outside the outermost list.
\end{itemize}

The horizontal space in the left margin of the current level
is distributed in the following way:
\begin{center}
\begin{tabular}{cc}
\fbox{\fbox{\strut \texttt{labelindent}}
  \fbox{\strut \texttt{labelwidth}}
  \fbox{\strut \texttt{labelsep} $-$ \texttt{itemintent}}}
&
\fbox{\strut\texttt{itemindent}}\\
\texttt{leftmargin}
\end{tabular}
\end{center}
Remember \verb|labelsep| spans part of \verb|leftmargin| and 
\verb|itemindent| if the latter is not zero. This is often
somewhat confusing, so remember that if you want a separation
between label and item \textit{body} of, say, 6pt, and the item
indent is 8pt, then \verb|labelsep| should be $6 + 8$. The
foregoing discussion about how the \verb|*| values are computed
presumes \verb|itemindent| is 0 pt, but any other value it is
taken into account.

\begin{itemize}
    
\item \verb|align|. How the label is aligned. Two values
are possible: \verb|left| and the default \verb|right|.
The parameters controlling the label spacing should be
properly set, either by hand or more conveniently with
the \verb|*| settings:
\begin{verbatim}
\begin{enumerate}[label=\Roman*., align=left, leftmargin=*]
\end{verbatim}

\item \verb|start|. Sets the number of the first item.

\item \verb|resume|. Makes the counter to be continued
from the previous \verb|enumerate|, instead of resetting it
to 1.
\begin{verbatim}
\begin{enumerate}
\item First item.
\item Second item.
\end{enumerate}
Text.
\begin{enumerate}[resume]
\item Third item
\end{enumerate}
\end{verbatim}

\item \verb|resume*| is like \verb|resume| but the options from the
previous list are used, too.  This option must be restricted to the
optional argument in a environment (this is the only place where it
makes sense) and further keys are not allowed. It should be used
sparingly---if you are using it often, then very likely you want
to define a new list (see below). 

\item \verb|beginpenalty|, \verb|midpenalty| and \verb|endpenalty| set
the penalty at the beginning of a list, between items and at the end
of the list.  Please, refer to your \LaTeX{} or \TeX{} manual about
how penalties control page breaks. Unlike other parameters, when a
list starts their values are not reset to the default, thus they
apply to the enclosed lists, too.

\item \verb|before| and \verb|before*| executes code before the list
starts (more precisely, in the second argument of the \verb|list|
environment used to define them).  The former sets the code to be
executed, overriding any previous value, while the starred form adds
the code to the existing one (in the setting hierarchy, see below,
\textit{not} with relation to the enclosing list).  It can contain,
say, rules and text, but this has not been extensively tested.

\item \verb|after| and \verb|after*| is the same but just before
the list ends.

\end{itemize}

A key are available in \verb|description|
\begin{itemize}
\item \verb|style|. Sets the \textit{style}, with the
following values:
\begin{itemize}

\item \verb|nextline|: if the label does not fit in the margin, the 
text continues in the next line, otherwise it is placed in a box of 
width \verb|leftmargin|, ie, the item body never sticks into the left 
margin. 

\item \verb|sameline|: like \verb|nextline| but if the label does not 
fit in the margin the text continues in the same line.

\item \verb|multiline|: the label is placed in a parbox whose width is 
\verb|leftmargin|, with several lines if necessary.

\item \verb|unboxed|: much like the standard \verb|description|, but 
the label is not boxed to avoid uneven spacing and unbroken labels if 
they are long.
\end{itemize}
\end{itemize} 

A few predefined valueless keys might be useful:
\begin{itemize}
\item \verb|noitemsep| kills the space between items
and paragraphs (ie, \verb|itemsep=0pt| and \verb|parsep=0pt|).
\item \verb|nolistsep| kills all vertical spacing.
\item \verb|fullwidth| is still somewhat experimental. The
leftmargin is null and the label is part of the text. Here
\verb|labelsep| sets the separation between the label and the first
word.
You may want to set \verb|itemindent| and \verb|listparindent|
to \verb|\parindent|, too.
\end{itemize}

% If you think the addition of \verb|\parskip| and \verb|\parsep|
% is annoying, you can use \verb|listskip| ($=$ \verb|\topsep| $-$
% \verb|\parskip|) and \verb|itemskip| ($=$ \verb|\itemsep| $-$
% \verb|\parsep|).

Global changes, to be applied to all of these list, are also
possible:
\begin{itemize}
\item \verb|\setenumerate[level]{format}|
\item \verb|\setitemize[level]{format}| 
\item \verb|\setdescription{format}|
\item \verb|\setlist[level]{format}|
\end{itemize}
Where \verb|level| is the list level in \verb|list|, and the
corresponding level in \verb|enumerate| and \verb|itemize|.  Without
\verb|level|, the format applies to all levels.  Here list does not
mean any list but only the three ones handled by this package.
Example:
\begin{verbatim}
\setlist{noitemsep}
\setlist[1]{\labelindent=\parindent} % << Usually a good idea
\setitemize{leftmargin=*}
\setitemize[1]{label=$\triangleleft$}
\setenumerate{labelsep=*, leftmargin=1.5pc}
\setenumerate[1]{label=\arabic*., ref=\arabic*}
\setenumerate[2]{label=\emph{\alph*}),
                 ref=\theenumi.\emph{\alph*}}
\setenumerate[3]{label=\roman*), ref=\theenumii.\roman*}
\setdescription{font=\sffamily\bfseries}
\end{verbatim}
These setting are read in the following order: list,
list at the current level, enumerate/itemize/description,
and enumerate/itemize at the current level; if a key
has several values, the last one, ie. the most specific
one, is applied. Finally, the
optional argument, if any, is applied. \LaTeX{} provides
a set of macros to change many of these parameters, but
setting them with the package is more consistent and
sometimes more flexible at the cost of being more
``explicit'' (and verbose).

No attempt has been made (yet) to discriminate the font size
(\verb|\normalsize|, \verb|\small|\dots). Suggestions are
most welcome.

\subsection{\textsf{enumerate}-like labels}

With the package option \texttt{shortlabels} you can use an
\textsf{enumerate}-like syntax, where \verb|A|, \verb|a|, \verb|I|,
\verb|i| and \verb|1| stand for \verb|\Alph*|, \verb|\alph*|,
\verb|\Roman*|, \verb|\roman*| and \verb|\arabic*|.  This is intended
mainly as a sort of compatibility mode with the \textsf{enumerate}
package, and therefore the following special rule applies: if the very
first option (at any level) is not recognized as a valid key, then it
will be considered a label with the \textsf{enumerate}-like syntax.  For
example:
\begin{verbatim}
\begin{enumerate}[i), labelindent=\parindent]
...
\end{enumerate}
\end{verbatim}
Although perhaps not so useful, you can omit \verb|label=| in the
itemize environment under similar conditions, too:
\begin{verbatim}
\begin{itemize}[\textbullet]
...
\end{itemize}
\end{verbatim}

In addition, you can define new keys (or redefine them), which is
particularly useful for enumerate to be adapted to especific
typographical rules or to extend it for non-Latin scrips:
\begin{verbatim}
\SetEnumerateShortLabel{<key>}{<replacement>}
\end{verbatim}
where \verb|<replacement>| contains one of the starred versions of 
counters. For example:
\begin{verbatim}
\SetEnumerateShortLabel{i}{\textsc{\roman*}}
\end{verbatim}
redefines \verb|i| so that items using this key are numbered with
small caps roman numerals.

\subsection{Cloning the three basic lists}

As of version 2.0 the three lists can be cloned so that you can 
define ``logical'' environments behaving like them. To define a
new lists (or redefine a existing one), use \verb|\newlist| (or 
\verb|\renewlist|), which the following syntax:
\begin{verbatim}
\newlist{<name>}{<type>}{<max-depth>}
\end{verbatim}
where \verb|<type>| is \verb|enumerate|, \verb|itemize| or 
\verb|description|. Then you can (in fact you must, at least the 
label) set the new list with \verb|\setlist|:
\begin{verbatim}
\newlist{ingredients}{itemize}{1}
\setlist[ingredients]{label=\textbullet}
\newlist{steps}{enumerate}{2}
\setlist[steps,1]{label=(\arabic*)}
\setlist[steps,2]{label=(\arabic*)}
\end{verbatim}
The optional argument of \verb|\setlist| has an extended
syntax---names say which lists applies the settings to, and numbers
the level.  Do not use this syntax in the three basic lists, but that
above, except if you redefine them.

\subsection{New counters}

With
\begin{verbatim}
\AddEnumerateCounter{<LaTeX counter>}{<TeX count>}{<widest label>}
\end{verbatim}
a counter representation is ``registered'' so that \textsf{enumitem}
recognizes it.  Intended mainly for non Latin scripts, but also useful
in Latin scripts.  For example:
\begin{verbatim}
\def\ctext#1{\expandafter\@ctext\csname c@#1\endcsname}
\def\@ctext#1{\ifcase#1\or First\or Second\or Third\or
Fourth\or Fifth\or Sixth\fi}
\AddEnumerateCounter{\ctext}{\@ctext}{Second}
\end{verbatim}

\subsection{Package option \texttt{loadonly}}

With this package option the package is loaded but the three
lists are not redefined. You can create your own lists, yet, or
even redefine the existing ones.

\section{Three patterns}

Three list layouts could be considered very
frequent. Let us apply the parameters above to define them.

The first pattern aligns the label with the surrounding
\verb|\parindent| while the item body is indented depending
on the label and a fixed \verb|labelsep|:
\begin{verbatim}
labelindent=\parindent,
leftmargin=*
\end{verbatim}
A fairly frequent variant is when  the label is aligned with
the surrounding text:
\begin{verbatim}
leftmargin=*
\end{verbatim}
The former looks better in the first level while the latter
seems preferable in subsequent ones. That can be easily
set with
\begin{verbatim}
\setlist{leftmargin=*}
\setlist[1]{labelindent=\parindent} % Only the level 1
\end{verbatim}

The second pattern aligns the item body with the surrounding
\verb|\parindent|. In this case:
\begin{verbatim}
leftmargin=\parindent
\end{verbatim}

A third pattern would be to align the label with \verb|\parindent|
and the item body with \verb|2\parindent|:
\begin{verbatim}
labelindent=\parindent,
leftmargin=2\parindent,
itemsep=*
\end{verbatim}
Again, a variant would be to align the label with the surrounding
text and the itembody with \verb|\parindent|:
\begin{verbatim}
leftmargin=\parindent,
itemsep=*
\end{verbatim}

Note here \verb|\parindent| means the global value applied
to normal paragraphs.

\section{The trivlist issue}

\LaTeX{} uses a simplified version of \verb|list| named 
\verb|trivlist| to set displayed material, like \verb|center|, 
\verb|quote|, etc., even if conceptually they are not lists. 
Unfortunately, \verb|trivlist| uses the current list settings, which 
has the odd side effect that changing the vertical spacing of lists 
also changes sometimes the spacing in these environments.

This package modifies \verb|trivlist| so that the default settings for 
the current level (ie, those set by the corresponding \verb|clo| 
files) are set again. In standard \LaTeX{} that is usually redundand, 
but if we want to fine tune lists, not resetting the default values 
could be a real issue (particularly if you use the \verb|nolistsep| 
option).

A minimal control of vertical spacing has been made possible with
\begin{itemize}
\item \verb|\setdisplayed[level]{format}|
\end{itemize}
but \verb|trivlist| itself, which is not used directly very
often, does not accept an optional argument. This feature
is not intended as a full-fledge \verb|trivlist| formatter.

If for some reason you do not want to change \verb|trivlist|
and preserve the original definition, you can use the
package option \verb|ignoredisplayed|.

\section{Samples}

\expandafter\ifx\csname setenumerate\endcsname\relax

Please, install first the package and then typeset this
document again.

\else

In these samples we set \verb|\setlist{noitemsep}|

\setlist{noitemsep}
\small

\vskip6pt
\goodbreak
\hrule
\vskip6pt

\begin{verbatim}
En un lugar de la Mancha, de cuyo nombre no quiero acordarme,
no ha mucho tiempo que viv\'{\i}a un hidalgo de los de
\begin{enumerate}[labelindent=\parindent,leftmargin=*]
  \item lanza en astillero,
  \item adarna antigua,
  \item roc\'{\i}n flaco, y
  \item galgo corredor.
\end{enumerate}
Una olla de algo m\'{a}s vaca que carnero, salpic\'{o}n las m\'{a}s
noches, duelos y quebrantos los s\'{a}bados...
\end{verbatim}

En un lugar de la Mancha, de cuyo nombre no quiero acordarme,
no ha mucho tiempo que viv\'{\i}a un hidalgo de los de
\begin{enumerate}[labelindent=\parindent,leftmargin=*]
\item lanza en astillero,
\item adarna antigua,
\item roc\'{\i}n flaco, y
\item galgo corredor.
\end{enumerate}
Una olla de algo m\'{a}s vaca que carnero, salpic\'{o}n las m\'{a}s
noches, duelos y quebrantos los s\'{a}bados...


\vskip6pt
\goodbreak
\hrule
\vskip6pt

With \verb|\begin{enumerate}[leftmargin=*]|

En un lugar de la Mancha, de cuyo nombre no quiero acordarme,
no ha mucho tiempo que viv\'{\i}a un hidalgo de los de
\begin{enumerate}[leftmargin=*]
\item lanza en astillero,
\item adarna antigua,
\item roc\'{\i}n flaco, y
\item galgo corredor.
\end{enumerate}
Una olla de algo m\'{a}s vaca que carnero, salpic\'{o}n las m\'{a}s
noches, duelos y quebrantos los s\'{a}bados...

\vskip6pt
\goodbreak
\hrule
\vskip6pt

With \verb|\begin{enumerate}[leftmargin=\parindent]|

En un lugar de la Mancha, de cuyo nombre no quiero acordarme,
no ha mucho tiempo que viv\'{\i}a un hidalgo de los de
\begin{enumerate}[leftmargin=\parindent]
\item lanza en astillero,
\item adarna antigua,
\item roc\'{\i}n flaco, y
\item galgo corredor.
\end{enumerate}
Una olla de algo m\'{a}s vaca que carnero, salpic\'{o}n las m\'{a}s
noches, duelos y quebrantos los s\'{a}bados...

\vskip6pt
\goodbreak
\hrule
\vskip6pt

With
\begin{verbatim}
\begin{enumerate}[labelindent=\parindent, leftmargin=*,
                  label=\Roman*., widest=IV, align=left]
\end{verbatim}

En un lugar de la Mancha, de cuyo nombre no quiero acordarme,
no ha mucho tiempo que viv\'{\i}a un hidalgo de los de
\begin{enumerate}[labelindent=\parindent, leftmargin=*,
                  label=\Roman*., widest=IV, align=left]
\item lanza en astillero,
\item adarna antigua,
\item roc\'{\i}n flaco, y
\item galgo corredor.
\end{enumerate}
Una olla de algo m\'{a}s vaca que carnero, salpic\'{o}n las m\'{a}s
noches, duelos y quebrantos los s\'{a}bados...

\vskip6pt
\goodbreak
\hrule
\vskip6pt

With \verb|\begin{enumerate}[label=\fbox{\arabic*}]|. A reference to
the first item is \ref{i:first}

En un lugar de la Mancha, de cuyo nombre no quiero acordarme,
no ha mucho tiempo que viv\'{\i}a un hidalgo de los de
\begin{enumerate}[label=\fbox{\arabic*}]
\item \label{i:first}lanza en astillero,
\item adarna antigua,
\item roc\'{\i}n flaco, y
\item galgo corredor.
\end{enumerate}
Una olla de algo m\'{a}s vaca que carnero, salpic\'{o}n las m\'{a}s
noches, duelos y quebrantos los s\'{a}bados...

\vskip6pt
\goodbreak
\hrule
\vskip6pt

With nested lists.

\begin{verbatim}
En un lugar de la Mancha, de cuyo nombre no quiero acordarme,
no ha mucho tiempo que viv\'{\i}a un hidalgo de los de
\begin{enumerate}[label=\alph*), labelindent=\parindent,
     leftmargin=*, start=12]
  \item lanza en astillero,
  \begin{enumerate}[label=\alph{enumi}.\roman*), leftmargin=*, start=8]
    \item adarna antigua,
  \end{enumerate}
  \item roc\'{\i}n flaco, y
  \begin{enumerate}[label=\alph{enumi}.\roman*), leftmargin=*, resume]
    \item galgo corredor.
  \end{enumerate}
\end{enumerate}
Una olla de algo m\'{a}s vaca que carnero, salpic\'{o}n las m\'{a}s
noches, duelos y quebrantos los s\'{a}bados...
\end{verbatim}

En un lugar de la Mancha, de cuyo nombre no quiero acordarme,
no ha mucho tiempo que viv\'{\i}a un hidalgo de los de
\begin{enumerate}[label=\alph*), labelindent=\parindent,
     leftmargin=*, start=12]
\item lanza en astillero,
\begin{enumerate}[label=\alph{enumi}.\roman*), leftmargin=*, start=7]
\item adarna antigua,
\end{enumerate}
\item roc\'{\i}n flaco, y
\begin{enumerate}[label=\alph{enumi}.\roman*), leftmargin=*, resume]
\item galgo corredor.
\end{enumerate}
\end{enumerate}
Una olla de algo m\'{a}s vaca que carnero, salpic\'{o}n las m\'{a}s
noches, duelos y quebrantos los s\'{a}bados...

\vskip6pt
\goodbreak
\hrule
\vskip6pt


\begin{verbatim}
En un lugar de la Mancha, de cuyo nombre no quiero acordarme,
no ha mucho tiempo que viv\'{\i}a un hidalgo de los de
\begin{description}[font=\sffamily\bfseries, leftmargin=3cm,
    style=nextline]
  \item[Lo primero que ten\'{\i}a el Quijote] lanza en astillero,
  \item[Lo segundo] adarna antigua,
  \item[Lo tercero] roc\'{\i}n flaco, y
  \item[Y por \'{u}ltimo, lo cuarto] galgo corredor.
\end{description}
Una olla de algo m\'{a}s vaca que carnero, salpic\'{o}n las m\'{a}s
noches, duelos y quebrantos los s\'{a}bados...
\end{verbatim}

En un lugar de la Mancha, de cuyo nombre no quiero acordarme,
no ha mucho tiempo que viv\'{\i}a un hidalgo de los de
\begin{description}[font=\sffamily\bfseries, leftmargin=3cm,
    style=nextline]
\item[Lo primero que ten\'{\i}a el Quijote] lanza en astillero,
\item[Lo segundo] adarna antigua,
\item[Lo tercero] roc\'{\i}n flaco, y
\item[Y por \'{u}ltimo, lo cuarto] galgo corredor.
\end{description}
Una olla de algo m\'{a}s vaca que carnero, salpic\'{o}n las m\'{a}s
noches, duelos y quebrantos los s\'{a}bados...

\vskip6pt
\goodbreak
\hrule
\vskip6pt

Same, but with \verb|sameline|.

En un lugar de la Mancha, de cuyo nombre no quiero acordarme,
no ha mucho tiempo que viv\'{\i}a un hidalgo de los de
\begin{description}[font=\sffamily\bfseries, leftmargin=3cm,
    style=sameline]
\item[Lo primero que ten\'{\i}a el Quijote] lanza en astillero,
\item[Lo segundo] adarna antigua,
\item[Lo tercero] roc\'{\i}n flaco, y
\item[Y por \'{u}ltimo, lo cuarto] galgo corredor.
\end{description}
Una olla de algo m\'{a}s vaca que carnero, salpic\'{o}n las m\'{a}s
noches, duelos y quebrantos los s\'{a}bados...

\vskip6pt
\goodbreak
\hrule
\vskip6pt

Same, but with \verb|multiline|. Note the text overlaps if
the item body is too short.

En un lugar de la Mancha, de cuyo nombre no quiero acordarme,
no ha mucho tiempo que viv\'{\i}a un hidalgo de los de
\begin{description}[font=\sffamily\bfseries, leftmargin=3cm,
    style=multiline]
\item[Lo primero que ten\'{\i}a el Quijote] lanza en astillero,
\item[Lo segundo] adarna antigua,
\item[Lo tercero] roc\'{\i}n flaco, y
\item[Y por \'{u}ltimo, lo cuarto] galgo corredor.
\end{description}
Una olla de algo m\'{a}s vaca que carnero, salpic\'{o}n las m\'{a}s
noches, duelos y quebrantos los s\'{a}bados...

\fi

\normalsize

\section{Afterword}

\subsection{\LaTeX{} lists}

As it is well known, \LaTeX{} predefines three lists: enumerate,
itemize and description.  This is a very frequent classification which
one can also find in, say, HTML. However, there is a more general
model based in three fields---namely, label, title, and body---, so
that enumerate and itemize has label (numbered and unnumbered) but
no title, while description has title but no label. In this model,
one can have a description with entries marked with labels, as for
example:
\begin{verbatim}
\newcommand\litem[1]{\item{\bfseries #1,\enspace}}
\begin{itemize}[label=\textbullet]
\litem{Lo primero que ten\'{\i}a el Quijote} lanza en astillero,
... etc.
\end{verbatim}

\vskip6pt
\goodbreak
\hrule
\vskip6pt

\newcommand\litem[1]{\item{\bfseries #1,\enspace}}
En un lugar de la Mancha, de cuyo nombre no quiero acordarme,
no ha mucho tiempo que viv\'{\i}a un hidalgo de los de
\begin{itemize}[label=\textbullet]
\litem{Lo primero que ten\'{\i}a el Quijote} lanza en astillero,
\litem{Lo segundo} adarna antigua,
\litem{Lo tercero} roc\'{\i}n flaco, y
\litem{Y por \'{u}ltimo, lo cuarto} galgo corredor.
\end{itemize}

\vskip6pt
\goodbreak
\hrule
\vskip6pt

This format in not infrequent at all and I thing any future
development of this package has to take it into account.

\subsection{Known issues}

Description styles other than the default one don't group
labels if they are nested.

You must use the \LaTeX{} syntax for environments, with \verb|\begin| 
and \verb|\end|.

\subsection{Acknowledgements}

I wish to thank particularly the comments and suggestions from Lars
Madsen, which has found some bugs, too.

\end{document}