summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/enumitem/enumitem.tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-01-14 22:05:41 +0000
committerKarl Berry <karl@freefriends.org>2019-01-14 22:05:41 +0000
commit476c59429d32e613e223cab375c292ffddcdaa8d (patch)
tree7f1aeb9291e6b89e0f67751160a70392402f4931 /Master/texmf-dist/doc/latex/enumitem/enumitem.tex
parentf7f1f807d00177577e28ff9d0992e86659b5997f (diff)
enumitem (14jan19)
git-svn-id: svn://tug.org/texlive/trunk@49702 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/enumitem/enumitem.tex')
-rw-r--r--Master/texmf-dist/doc/latex/enumitem/enumitem.tex473
1 files changed, 321 insertions, 152 deletions
diff --git a/Master/texmf-dist/doc/latex/enumitem/enumitem.tex b/Master/texmf-dist/doc/latex/enumitem/enumitem.tex
index 6fad4dcebfb..889606770fd 100644
--- a/Master/texmf-dist/doc/latex/enumitem/enumitem.tex
+++ b/Master/texmf-dist/doc/latex/enumitem/enumitem.tex
@@ -1,5 +1,5 @@
%
-% Copyright (C) 2003-2018 Javier Bezos http://www.texnia.com
+% Copyright (C) 2003-2019 Javier Bezos http://www.texnia.com
%
% This file may be distributed and/or modified under the conditions of
% the MIT License. A version can be found at the end of this file.
@@ -56,7 +56,7 @@
suggestions go to \href{http://www.texnia.com/enumitem.html}%
{\texttt{http://www.texnia.com/enumitem.html}}.}}
-\date{Version 3.6\\2018/11/30}
+\date{Version 3.7\\2019/01/14}
\IfFileExists{enumitem.sty}{\usepackage{enumitem}}{}
@@ -74,6 +74,25 @@ suggestions go to \href{http://www.texnia.com/enumitem.html}%
\maketitle
\tableofcontents
+\newpage
+
+\vspace*{1cm}
+
+\begin{note}
+ Changes and new features with relation to version 3.5 are highlighted
+ with \New{X.X}\hspace{-.5em}. The most recent features could be still
+ unstable. Please, report any issues you find on
+ \texttt{https://github.com/jbezos/enumitem/issues}, which is better
+ than just complaining on an e-mail list or a web forum. Feel free to
+ fork it and make pull requests.
+\end{note}
+
+\begin{warning}
+ Version 3.6 introduced two new keys: |left| and |first|. If your
+ documents define some series with these names, an error is raised.
+ Just rename them, or set the package option |series=override|.
+\end{warning}
+
\section{Introduction}
This package provides most of the flexibility you may want to customize
@@ -81,7 +100,7 @@ the three basic list environments (|enumerate|, |itemize| and
|description|) and to design your own lists, with a |<key>=<value>|
syntax:
\begin{itemize}
-\item Fancy labels and fancy refs, including a syntax similar to that
+\item Fancy labels and fancy refs, including a syntax similar to that
in the \textsf{enumerate} package.
\item Alternative ways for positioning the label, with a new
@@ -102,15 +121,15 @@ resuming.
\end{itemize}
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
+globally the behavior of lists and then override several parameters of,
+say, |enumerate| and then in turn override a few parameters in a
particular instance. The values will be searched in the hierarchy.
The package extends the syntax of the lists to allow an optional
argument where a set of parameters in the form |key=value| are
-available. These keys are equivalent to the well known list parameters
--- please, see a \LaTeX{} manual for a description of them. Next
-sections explains the extensions provided by |enumitem|.
+available. These keys are equivalent to the well known list parameters.
+Please, see a \LaTeX{} manual for a description of them. Next sections
+explains the extensions provided by |enumitem|.
\begin{itemize}
\item
Vertical spacing:
@@ -135,9 +154,9 @@ Horizontal spacing:
\end{itemize}
\begin{example}
- A straighforward example is:
+ A straightforward example is:
\begin{verbatim}
-\begin{itemize}[itemsep=1ex,leftmargin=1cm]
+\begin{itemize}[itemsep=1ex, leftmargin=1cm]
\end{verbatim}
\end{example}
@@ -186,6 +205,12 @@ label:
|inline| and then the environments |enumerate*|, |itemize*| and
|description*|.
+\item To set a numeric label with parenthesis, but a cross-reference
+without them:
+\begin{verbatim}
+\begin{enumerate}[label=(\arabic*), ref=\arabic*]
+\end{verbatim}
+
\end{itemize}
\section{Keys}
@@ -194,6 +219,12 @@ This section describes the keys in displayed lists. Most of them are
available in inline lists, where further keys are available (see
\ref{s.inline}).
+\begin{warning}
+ If the value is completely enclosed in braces, they are removed. If
+ you want the braces, they must be duplicated. This is the default
+ behavior of \textsf{keyval}, which \textsf{enumitem} just emulates.
+\end{warning}
+
\subsection{Label and cross references format}
\begin{desc}
@@ -209,7 +240,7 @@ corresponding syntax.} It works with |\value|, too (provided the widest
label is not to be computed or |widest*| is used, see below).
\begin{note}
- If you prefer setting labels like the \textsf{enumerate} package, use
+ If you prefer setting labels like the \textsf{enumerate} package, use
``short labels'' (see section \ref{s.short}).
\end{note}
@@ -261,9 +292,9 @@ on):
By default, |label| sets also the form of cross references and
|\the...| (overriding the settings in parent hierarchical
levels), but you can define a different format with this key. For
-example, to remove the right parethesis:
+example, to remove the right parenthesis:
\begin{verbatim}
-\begin{enumerate}[label=\emph{\alph*}),ref=\emph{\alph*}]
+\begin{enumerate}[label=\emph{\alph*}), ref=\emph{\alph*}]
\end{verbatim}
\begin{note}
@@ -282,7 +313,7 @@ example, to remove the right parethesis:
The |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 |ref|. You may
- use |\ref{level1}.\ref{level2}| with appropiate |ref| settings, but as
+ use |\ref{level1}.\ref{level2}| with appropriate |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
@@ -306,11 +337,13 @@ example, to remove the right parethesis:
|font=<commands>|\qquad|format=<commands>|
\end{desc}
-Sets the label font. Useful when the label is changed with the
-optional argument of |\item| and in \texttt{description}. The last
-command in |<commands>| can take an argument with the item label. In
+Sets the label font. Useful when the label is changed with the optional
+argument of |\item| and in \texttt{description}. The last command in
+|<commands>| can take an argument with the item label. In
\texttt{description} class setting are in force, so you may want begin
-with |\normalfont|. A synonymous is \texttt{format}.
+with |\normalfont|. A synonymous is \texttt{format}. Actually, this key
+may be used for any stuff to be executed at each |\item|, just before the
+label.
\begin{desc}
|align=left|\qquad |align=right|\qquad |align=parleft|
@@ -342,9 +375,9 @@ to:
\end{verbatim}
\begin{example}
- Although primarily intended for the alignment, this commands has other
- uses (an example is the provided |parleft|). For example, with the
- following all labels with |align=right| are set as superscripts:
+ Although primarily intended for the alignment, this commands has
+ other uses (an example is the provided |parleft|). For example, with
+ the following all labels with |align=right| are set as superscripts:
\begin{verbatim}
\SetLabelAlign{right}{\hss\llap{\textsuperscript{#1}}}
\end{verbatim}
@@ -352,9 +385,9 @@ to:
\end{example}
\begin{note}
- If the last thing in the definition is a skip (typically |\hfil|), it is
- removed sometimes by |description|. If for some reason you want to avoid
- this, just add |\null| at the end.
+ If the last thing in the definition is a skip (typically |\hfil|), it
+ is removed sometimes by |description|. If for some reason you want to
+ avoid this, just add |\null| at the end.
\end{note}
\begin{note}
@@ -377,7 +410,7 @@ a future release.}
\begin{tabular}{cc}
\fbox{\fbox{\strut \texttt{labelindent}}
\fbox{\strut \texttt{labelwidth}}
- \fbox{\strut \texttt{labelsep} $-$ \texttt{itemintent}}}
+ \fbox{\strut \texttt{labelsep} $-$ \texttt{itemindent}}}
&
\fbox{\strut\texttt{itemindent}}\\
\texttt{leftmargin}
@@ -391,11 +424,10 @@ Actually, the layout is more complex because the label box (ie,
takes a negative value.
\begin{note}
- Since |\parindent| is not used as such inside lists, but instead
- is set internally to either |\itemindent| or |\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.
+ Since |\parindent| is not used as such inside lists, but instead is
+ set internally to either |\itemindent| or |\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{note}
\begin{note}
@@ -424,7 +456,7 @@ ignored.
There is a new counter length |\labelindent|.
-The five parameteres are related in the following way:
+The five parameters are related in the following way:
\[
|\leftmargin|+|\itemindent| =
|\labelindent|+|\labelwidth|+|\labelsep|
@@ -469,9 +501,10 @@ left margin (the ``start of text'') is computed with the |labelsep|.
Sets which value is to be computed from the others. The default is
|labelindent=!|, but note some keys set another value (|wide| and
-description |style|s). Computations are done after \textit{all}
-keys has been read. Explicit values are not lost, and so with the
-following hierarchical settings: \begin{verbatim}
+description |style|s). Computations are done after \textit{all} keys
+has been read. Explicit values are not lost, and so with the following
+hierarchical settings:
+\begin{verbatim}
leftmargin=2em
labelindent=1em,leftmargin=!
labelindent=!
@@ -496,10 +529,13 @@ Examples are:
\begin{verbatim}
\begin{itemize}[label=\textbullet, leftmargin=*]
\begin{enumerate}[label=\roman*), leftmargin=*, widest=iii]
-\begin{itemize}[label=\textbullet,
- leftmargin=2pc, labelsep=*]
-\begin{enumerate}[label=\arabic*., leftmargin=2\parindent,
- labelindent=\parindent, labelsep=*]
+\begin{itemize}[label = \textbullet,
+ leftmargin = 2pc,
+ labelsep = *]
+\begin{enumerate}[label = \arabic*.,
+ labelindent = \parindent,
+ leftmargin = 2\parindent,
+ labelsep = *]
\end{verbatim}
The most useful are |labelsep=*| and |leftmargin=*|. With the former
@@ -531,7 +567,7 @@ overrides the default value for the widest printed counter. Sometimes,
if lists are not very long, a value of |a| for |\alph| is more sensible
than the default |m|:
\begin{verbatim}
-\begin{enumerate}[leftmargin=*,widest=a] % Assume standard 2nd level
+\begin{enumerate}[leftmargin=*, widest=a] % Assume standard 2nd level
\end{verbatim}
With no value, the default is restored. With |widest*|, the string is
built using |<integer>| as the value of the counter (e.g., with
@@ -579,14 +615,14 @@ the current list and not from that in the enclosing list/text.
while the item body is indented depending on the label and a fixed
|labelsep|:
\begin{verbatim}
-labelindent=\parindent,
-leftmargin=*
+labelindent = \parindent,
+leftmargin = *
\end{verbatim}
A fairly frequent variant is aligning the label with the surrounding
text (remember |labelindent| is |0pt| by default if it is not the
computed parameter):
\begin{verbatim}
-leftmargin=*
+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
@@ -601,7 +637,7 @@ leftmargin=*
|\parindent|. In this case (remember |labelindent| is the computed
parameter if not set):
\begin{verbatim}
-leftmargin=\parindent
+leftmargin = \parindent
\end{verbatim}
\end{example}
@@ -609,15 +645,15 @@ leftmargin=\parindent
A third pattern would be the label aligned with |\parindent|,
and the item body with |2\parindent|:
\begin{verbatim}
-labelindent=\parindent,
-leftmargin=2\parindent,
-itemsep=*
+labelindent = \parindent,
+leftmargin = 2\parindent,
+itemsep = *
\end{verbatim}
Again, a variant would be the label aligned with the surrounding
- text, and the itembody with |\parindent|:
+ text, and the item body with |\parindent|:
\begin{verbatim}
-leftmargin=\parindent,
-itemsep=*
+leftmargin = \parindent,
+itemsep = *
\end{verbatim}
\end{example}
@@ -645,29 +681,30 @@ Text.
\end{enumerate}
\end{verbatim}
-This is done locally. If you want global resuming, see next section on series.
+This is done locally. If you want global resuming, see next section on
+series.
\begin{desc}
|resume*|
\end{desc}
-Like |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). It should
-be used sparingly---if you are using it often, then very likely you
-want to define a new list (see \ref{s.clone}). Further keys are allowed, and
-in this case the saved options are overriden by those in the current
-list (i.e., the position of \texttt{resume*} does not matters).
-If there is a series of a certain list with
-\texttt{resume*}, options are taken from the list previous to the
-first one, except for \texttt{start}.
+Like |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). It should be
+used sparingly---if you are using it often, then very likely you want
+to define a new list (see \ref{s.clone}). Further keys are allowed, and
+in this case the saved options are overridden by those in the current
+list (i.e., the position of \texttt{resume*} does not matters). If
+there is a series of a certain list with \texttt{resume*}, options are
+taken from the list previous to the first one, except for
+\texttt{start}.
\begin{example}
For example:
\begin{verbatim}
-\begin{enumerate}[resume*,start=1] % or [start=1,resume*]
+\begin{enumerate}[resume*, start=1] % or [start=1, resume*]
\end{verbatim}
- uses the keys in the previuos \texttt{enumerate}, but restarts the
+ uses the keys in the previous \texttt{enumerate}, but restarts the
counter.
\end{example}
@@ -697,15 +734,15 @@ alternative to |resume*=<series>|.
\begin{example}
Consider:
\begin{verbatim}
-\begin{enumerate}[label=\arabic*(a),leftmargin=1cm,series=lafter]
+\begin{enumerate}[label=\arabic*(a), leftmargin=1cm, series=l_after]
\item A
\item B
\end{enumerate}
\end{verbatim}
You get: 1(a) 2(a). You can continue with:
\begin{verbatim}
-\begin{enumerate}[label=\arabic*(b),resume*=lafter]
- % or [label=\arabic*(b),lafter]
+\begin{enumerate}[label=\arabic*(b), resume*=l_after]
+ % or [label=\arabic*(b), l_after]
\item A
\item B
\end{enumerate}
@@ -715,8 +752,8 @@ alternative to |resume*=<series>|.
Note you can add further arguments, which are executed after those
saved at the starting list and therefore take precedence over them --
-in particular, |resume*| itself takes precedence over a
-|start| (e.g., |start=1|) in the the starting list.
+in particular, |resume*| itself takes precedence over a |start| (e.g.,
+|start=1|) in the the starting list.
\begin{note}
Every time a series is started, several commands are defined
@@ -724,6 +761,21 @@ in particular, |resume*| itself takes precedence over a
non-overlapping series.
\end{note}
+\begin{warning}
+ The package may introduce new keys in the future, so using directly
+ |<series>| as a key is a potential source of forward
+ incompatibilities. However, it's safe using a non-letter character
+ other than hyphen or star in the key name (e.g., |!notes| or
+ |m_steps|), as well as uppercase letters and digits, because
+ \textsf{enumitem} will never use them. \New{3.7} If you have defined
+ some series with an all lowercase name and a new conflicting key has
+ been introduced, an alternative to changing their names is the
+ package option |series=override| (the error message is
+ \texttt{Invalid series name `key'}). With it series names take
+ precedence over predefined keys -- but use it only when absolutely
+ necessary.
+\end{warning}
+
\subsection{Penalties}
\begin{desc}
@@ -736,6 +788,9 @@ end of the list, respectively. 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 child lists.
+
+\subsection{Injecting code}
+
\begin{desc}
|before=<code>| \qquad |before*=<code>|
\end{desc}
@@ -752,7 +807,7 @@ and you can access and manipulate the list parameters.
\begin{example}
To have both margins (left and right) set to the widest label:
\begin{verbatim}
-\setlist{leftmargin=*,before=\setlength{\rightmargin}{\leftmargin}}
+\setlist{leftmargin=*, before=\setlength{\rightmargin}{\leftmargin}}
\end{verbatim}
\end{example}
@@ -766,7 +821,7 @@ Same, but just before the list ends.
|first=<code>|\qquad|first*=<code>|
\end{desc}
-Same, but as the very first thing in the list body, so that
+\New{3.6} Same, but as the very first thing in the list body, so that
\begin{verbatim}
\begin{itemize}[first=<code>]
\end{verbatim}
@@ -777,6 +832,61 @@ is the same as
\end{verbatim}
With it you may insert, for example, an |\item|.
+\begin{desc}
+|\EnumitemId|
+\end{desc}
+
+To help in some tasks, a unique numeric identifier is assigned to each
+list, returned by |\EnumitemId|.
+
+\begin{example}
+ Here is an example of how to combine a |\label| with |\EnumitemId|,
+ and |after| to automatically set the width of the list label to the
+ widest one (provided the ref is the same as the label):\footnote{See
+ \texttt{https://tex.stackexchange.com/questions/29322/%
+ how-to-make-enumerate-items-align-at-left-margin}.}
+\begin{verbatim}
+\SetEnumitemKey{widestlabel}
+ {labelwidth = \widthof{\ref{enum-\EnumitemId}},
+ after = \label{enum-\EnumitemId}}
+\end{verbatim}
+Then just use the key |widestlabel|.
+\end{example}
+
+\begin{example}
+ Reverse counting is also doable, but somewhat trickier, and we need
+ some ``external'' help. Here is a possible solution, but not the
+ only one (and very likely not even the best -- for example, |start|
+ is in fact no-op).
+
+\begin{verbatim}
+\usepackage{calc,cleveref,crossreftools}
+\crtrefundefinedtext{0}
+
+\newcounter{revcount}
+\newcommand\revcounter[1]{%
+ \setcounter{revcount}{1+\crtcrefnumber{enum-\EnumitemId}-\value{#1}}}
+\AddEnumerateCounter\revcounter\revcounter{} % the 2nd is dummy
+
+\SetEnumitemKey{revarabic}
+ {label = \revcounter*(\arabic{revcount}),
+ ref = (\arabic{revcount}),
+ after = \label{enum-\EnumitemId}}
+\end{verbatim}
+ Note |ref| must be set separately, because |\revcounter|
+ is not expandable.
+\end{example}
+
+\begin{example}
+ With |first| you can define your own environments for displayed
+ material. A trivial example is:
+\begin{verbatim}
+\newlist{letter}{itemize}{1}
+\setlist[letter]{first=\item[]\itshape, rightmargin=\leftmargin}
+\end{verbatim}
+Here there is no need for a |label|, because it is not used.
+\end{example}
+
\subsection{Description styles}
A key available in |description|.
@@ -812,11 +922,11 @@ necessary. Same as |style=standard,align=parleft,labelwidth=!|.
\begin{warning}
\begin{enumerate}
-\item Mixing boxed and unboxed labels has not a well-defined behaviour.
+\item Mixing boxed and unboxed labels has not a well-defined behavior.
\item When nesting list all combinations are allowed but not all make
sense.
\item Nesting |nextline| lists is not supported (it works, but its
- behaviour might change in the future, because the current one is not
+ behavior might change in the future, because the current one is not
what one could expect).
\end{enumerate}
\end{warning}
@@ -831,7 +941,7 @@ The key |noitemsep| kills the space between items and paragraphs
(i.e., |itemsep=0pt| and |parsep=0pt|), while
|nosep| kills all vertical spacing.\footnote{The key
\texttt{nolistsep}, now deprecated, introduced a thin stretch, which
-was not the intended behaviour.}
+was not the intended behavior.}
\subsection{``Wide'' lists}
@@ -850,7 +960,7 @@ align=left, leftmargin=0pt, labelindent=\parindent,
listparindent=\parindent, labelwidth=0pt, itemindent=!
\end{verbatim}
With |wide=<parindent>| you may set at once another value instead of
-|\parindent|. Of course, these keys can be overriden after
+|\parindent|. Of course, these keys can be overridden after
|wide|, too; for example, remembering that with left-aligned labels
the text is pushed if the they are wider than |labelwidth|, you
can set |labelwidth=1.5em| for a minimal width, or instead of
@@ -880,6 +990,8 @@ example:
...
\end{enumerate}
\end{verbatim}
+You may want to set |ref|, too, if different from the label.
+
Although perhaps not so useful, you can omit |label=| in the
itemize environment under similar conditions, too:
\begin{verbatim}
@@ -893,7 +1005,7 @@ itemize environment under similar conditions, too:
\end{desc}
With this command, you can define new keys (or redefine them), which is
-particularly useful for enumerate to be adapted to especific
+particularly useful for enumerate to be adapted to specific
typographical rules or to extend it for non-Latin scrips. Here
|<replacement>| contains one of the starred versions of
counters.
@@ -923,7 +1035,7 @@ defined can then be used like the others.
\begin{example}
With
\begin{verbatim}
-\SetEnumitemKey{midsep}{topsep=3pt,partopsep=0pt}
+\SetEnumitemKey{midsep}{topsep=3pt, partopsep=0pt}
\end{verbatim}
you may write
\begin{verbatim}
@@ -935,22 +1047,22 @@ defined can then be used like the others.
Another example is multicolumn lists, with \textsf{multicol}:
\begin{verbatim}
\SetEnumitemKey{twocol}{
- itemsep=1\itemsep,
- parsep=1\parsep,
- before=\raggedcolumns\begin{multicols}{2},
- after=\end{multicols}}
+ itemsep = 1\itemsep,
+ parsep = 1\parsep,
+ before = \raggedcolumns\begin{multicols}{2},
+ after = \end{multicols}}
\end{verbatim}
Here, the settings for \texttt{itemsep} and \texttt{parsep} kill the
- stretch and shrink parts. Of course, you may want to define a
- new list.
+ stretch and shrink parts, which in this case improves the result. Of
+ course, you may want to define a new list.
\end{example}
\begin{warning}
The package may introduce new keys in the future, so
- |\SetEnumitemKey| is a potential source of forward
- incompatibilities. However, it's safe using a non-letter character
- other than hyphen or star in the key name (e.g., |:name| or
- |2_col|), because \textsf{enumitem} will not use them.
+ |\SetEnumitemKey| is a potential source of forward incompatibilities.
+ However, it's safe using a non-letter character other than hyphen or
+ star in the key name (e.g., |:name| or |2_col|), as well as uppercase
+ letters and digits, because \textsf{enumitem} will never use them.
\end{warning}
\begin{desc}
@@ -966,7 +1078,7 @@ are translated to the actual value. For example, with:
\end{verbatim}
you might say:
\begin{verbatim}
-\begin{enumerate}[label=numeric,leftmargin=standard]
+\begin{enumerate}[label=numeric, leftmargin=standard]
\end{verbatim}
So, you can left to the final design what |label=numeric| means.
@@ -974,20 +1086,20 @@ So, you can left to the final design what |label=numeric| means.
\label{s.inline}
Inline lists are ``horizontal'' lists set as ordinary text inside a
-paragraph. With this package you can create inline lists, as
-explained below, with |\newlist|, which have their own labels and
-counters. However, very often inline versions of standard lists,
-with the same labelling schema, will be enough -- the package option
-|inline| does that.
+paragraph. With this package you can create inline lists, as explained
+below, with |\newlist|, which have their own labels and counters.
+However, very often inline versions of standard lists, with the same
+labeling schema, will be enough -- the package option |inline| does
+that.
\begin{warning}
Items are boxed, so floats are lost and nested lists are not allowed
(remember many displayed elements are defined as lists). Display math
is forbidden too, and due to an optimization done by \TeX{} when
- bulding lists, explicit hyphenation may be wrong.\footnote{A Knuthian
- ``premature optimization''? Who knows, but anyway Lua\TeX{} has
- removed it, so hyphenation with this engine should be correct.} There
- was a reason for this default setting, namely, this feature was
+ building lists, explicit hyphenation may be wrong.\footnote{A
+ Knuthian ``premature optimization''? Who knows, but anyway Lua\TeX{}
+ has removed it, so hyphenation with this engine should be correct.}
+ There was a reason for this default setting, namely, this feature was
mainly devised for short items (a few words), and the parameter
|itemjoin*| could be useful for logical markup. To overcome these
limitations, you may set |mode=unboxed|, described below.
@@ -1001,19 +1113,19 @@ with the same labelling schema, will be enough -- the package option
With the package option \texttt{inline}, three environments for inline
lists are defined: \texttt{enumerate*}, \texttt{itemize*}, and
-\texttt{description*}. They emulate the behaviour of
-\textsf{paralist} and \textsf{shortlst} in that labels and settings
-are shared with the displayed (ie, ``normal'') lists
-\texttt{enumerate}, \texttt{itemize} and \texttt{description},
-respectively (however, remember resuming is based on environment
-names, not on list types). This applies only to those created with
-\texttt{inline} -- inline lists created with |\newlist| as described
-below are independent and use their own labels and settings.
+\texttt{description*}. They emulate the behavior of \textsf{paralist}
+and \textsf{shortlst} in that labels and settings are shared with the
+displayed (ie, ``normal'') lists \texttt{enumerate}, \texttt{itemize}
+and \texttt{description}, respectively (however, remember resuming is
+based on environment names, not on list types). This applies only to
+those created with \texttt{inline} -- inline lists created with
+|\newlist| as described below are independent and use their own labels
+and settings.
\begin{note}
- Note |inline| is not required if you do not need the inline
- versions of standard lists, but instead you define your own
- standalone inline lists with |\newlist|.
+ Note |inline| is not required if you do not need the inline versions
+ of standard lists, but instead you define your own standalone inline
+ lists with |\newlist|.
\end{note}
\begin{warning}
@@ -1055,7 +1167,7 @@ before=\unskip{: }, itemjoin={{; }}, itemjoin*={{, and }}
If using floats, lists or displayed math inside inline lists is
important, use an alternative ``mode'', which you can activate with
\texttt{mode=unboxed} (the default is \texttt{mode=boxed}). With it,
-floats may be used freely, but misplaced |\item|s are not catched and
+floats may be used freely, but misplaced |\item|s are not caught and
\texttt{itemjoin*} is ignored (a warning is written to the log about
this fact).
@@ -1083,10 +1195,12 @@ this package, and those redefined by this package or defined with
\setlist[itemize]{leftmargin=*}
\setlist[itemize,1]{label=$\triangleleft$}
\setlist[enumerate]{labelsep=*, leftmargin=1.5pc}
-\setlist[enumerate,1]{label=\arabic*., ref=\arabic*}
-\setlist[enumerate,2]{label=\emph{\alph*}),
- ref=\theenumi.\emph{\alph*}}
-\setlist[enumerate,3]{label=\roman*), ref=\theenumii.\roman*}
+\setlist[enumerate,1]{label = \arabic*.,
+ ref = \arabic*}
+\setlist[enumerate,2]{label = \emph{\alph*}),
+ ref = \theenumi.\emph{\alph*}}
+\setlist[enumerate,3]{label = \roman*),
+ ref = \theenumii.\roman*}
\setlist[description]{font=\sffamily\bfseries}
\end{verbatim}
These setting are read in the following order: list, list at the
@@ -1119,24 +1233,29 @@ This allows defining lists with the help of loops.
\end{warning}
\section{Size dependent settings}
+\label{s:sized}
-\New{3.6} The following package option is requrired for making use of
-this feature.
+\New{3.6} For settings depending on the font size, in most cases all
+you need are relative units like |ex| or |em|. Sometimes, you may want
+discrete steps, and a special syntax allows them.
+
+The following package option is required for making use of this
+feature.
\begin{desc}
|sizes| (package option)
\end{desc}
Lengths can contain size-based settings as follows (the value before
-the first $<$ is a default).% TODO -- An alternative |\setlist<size>|.
+the first \texttt{<} is a default).
\begingroup
\makeatletter
\renewcommand\verbatim@font{\normalfont\ttfamily}
\begin{verbatim}
\setlist{
- topsep= 20pt <-10> 6pt <10-> 40pt,
- leftmargin= <-10> 0cm <10> 1cm <10-> 2cm ,
- rightmargin= <-10> 0cm <10> 1cm <10-> 2cm ,
+ topsep = 20pt <-10> 6pt <10-> 40pt,
+ leftmargin = <-10> 0cm <10> 1cm <10-> 2cm ,
+ rightmargin = <-10> 0cm <10> 1cm <10-> 2cm ,
}
\end{verbatim}
\endgroup
@@ -1144,25 +1263,72 @@ the first $<$ is a default).% TODO -- An alternative |\setlist<size>|.
Names are accepted, too: |script|, |tiny|, |footnote|, |small|,
|normal|, |large|, |Large|, |LARGE|, |huge|, |Huge| (ie, remove `size'
from the \LaTeX{} name if necessary). For example:
-% TODO - |\SetEnumitemSizes| to configure it.
\begingroup
\makeatletter
\renewcommand\verbatim@font{\normalfont\ttfamily}
\begin{verbatim}
\setlist{
- topsep= 20pt <-normal> 6pt <normal-> 40pt,
- leftmargin= <-normal> 0cm <normal> 1cm <normal-> 2cm ,
- rightmargin= <-normal> 0cm <normal> 1cm <normal-> 2cm ,
+ topsep = 20pt <-normal> 6pt <normal-> 40pt,
+ leftmargin = <-normal> 0cm <normal> 1cm <normal-> 2cm ,
+ rightmargin = <-normal> 0cm <normal> 1cm <normal-> 2cm ,
}
\end{verbatim}
\endgroup
-Single values take precedence over ranges. In ranges, the last match
-wins. The range |a-b| is $a \le \mbox{size} < b$ (the lower bound is
-included, but not the upper one). These rules allow in the examples
-above the setting for |10| or |normal| in the logical place. Remember
-nominal sizes are not always the real sizes -- for example, with option
-|11pt|, |\normalsize| (and |normal|) is 10.95.
+Single values take precedence over ranges (i. e., specific takes
+precedence over generic). In ranges, the last match wins. The range
+|a-b| is $a \le \mbox{size} < b$ (the lower bound is included, but not
+the upper one). These rules allow in the examples above the setting for
+|10| or |normal| in the logical place. Remember nominal sizes are not
+always the real sizes -- for example, with option |11pt|, |\normalsize|
+(and |normal|) is 10.95. You may precede a value with several single
+qualifiers like
+\texttt{<}|small|\texttt{><}|normal|\texttt{>}|12pt|.\footnote{Note
+this syntax follows closely that of \texttt{\string\DeclareFontShape},
+except in the precedence of single values.} A value before the first
+\texttt{<..>} is considered a default value.
+
+\begin{note}
+ For efficiency reasons, named sizes are assigned only once, when
+ \textsf{enumitem} is loaded, in the assumption they are set by the
+ class, or a local style loaded previously.
+\end{note}
+
+\begin{desc}
+|\SetEnumitemSize{<name>}{<selector>}|
+\end{desc}
+
+\New{3.7} If sizes are modified after loading \textsf{enumitem} or you
+are using a class with non standard sizes (or even you just want
+another names), they can be set or reset with the following tool.
+
+\begin{example}
+A trivial example:
+\begin{verbatim}
+\SetEnumitemSize{normal}{\normalsize}
+\SetEnumitemSize{large}{\large}
+\end{verbatim}
+\end{example}
+
+\begin{desc}
+|\setlist|\texttt{\string<}|<size>|\texttt{\string>}%
+ |[<names>,<levels>]{<keys/values>}|
+\end{desc}
+
+\New{3.7} An extension to |\setlist| described below which adds the
+definitions, but only for the given size (either single or a range).
+The precedence rules for sizes also apply here (so that the order of
+|\setlist|'s are relevant), and size dependent keys as defined by this
+procedure take precedence over the rest of the keys. For example:
+\begingroup
+\makeatletter
+\renewcommand\verbatim@font{\normalfont\ttfamily}
+\begin{verbatim}
+\setlist<-normal>[enumerate]{nosep}
+\end{verbatim}
+\endgroup
+
+However, only a size qualifier is accepted in each |\setlist|.
\section{Cloning the basic lists}
\label{s.clone}
@@ -1201,8 +1367,8 @@ label=\arabic{stepsii}.\arabic{stepsi}
\begin{warning}
For consistency with the counter naming schema in \LaTeX, list levels
- are also named internally with a roman numeral, ie, |<list>|i,
- |<list>|ii, |<list>|iii, etc. For this reason (both counter and list
+ are also named internally with a roman numeral, ie, |<list>i|,
+ |<list>ii|, |<list>iii|, etc. For this reason (both counter and list
names), defining two lists as, say, |books| and |booksi| leads to
unexpected results (currently without any warning, which should be
fixed).
@@ -1235,6 +1401,11 @@ No number (or 0) means ``all levels'' and no name means ``all lists''; no
optional argument means ``all lists at all levels''.
The starred form |\setlist*| adds the settings to the previous ones.
+You may restrict the additions to a certain font size, as explained in
+section \ref{s:sized}. It must be noted the latter have a higher
+precedence than the starred ones (i. e., settings added for some sizes
+take precedence over settings added for all sizes, so that the most
+specific value for a key is applied).
\begin{desc}
|\setlistdepth{<integer>}|
@@ -1318,7 +1489,7 @@ because its name is different.
\section{Package options}
-Besides |inline|, |ignoredisplayed|, |sizes| and
+Besides |inline|, |ignoredisplayed|, |sizes|, |series=override| and
|shortlabels|, the following option is available.
\begin{desc}
@@ -1332,15 +1503,15 @@ even redefine the existing ones.
\section{The trivlist issue}
\LaTeX{} uses a simplified version of |list| named |trivlist| to set
-displayed material, like |center|, |verbatim|, |tabbing|,
-|theorem|, etc., even if conceptually they are not lists.
-Unfortunately, |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.
+displayed material, like |center|, |tabbing|, |theorem|, etc., even if
+conceptually they are not lists. Unfortunately, |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 |trivlist| so that the default settings for
the current level (ie, those set by the corresponding |clo|
-files) are set again. In standard \LaTeX{} that is usually redundand,
+files) are set again. In standard \LaTeX{} that is usually redundant,
but if we want to fine tune lists, not resetting the default values
could be a real issue (particularly if you use the |nosep|
option).
@@ -1358,8 +1529,6 @@ If for some reason you do not want to change |trivlist| and preserve
the original definition, you can use the package option
|ignoredisplayed|.
-% TODO - Document it may be applied to quote, tabbing, etc.
-
\New{3.6} If, on the other hand, you want to also apply the changes for
all lists to trivlists, just set the package option |includedisplayed|.
@@ -1614,7 +1783,7 @@ 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 (of
-course, this simple solution is far from satistactory):
+course, this simple solution is far from satisfactory):
\begin{verbatim}
\newcommand\litem[1]{\item{\bfseries #1,\enspace}}
\begin{itemize}[label=\textbullet]
@@ -1642,10 +1811,10 @@ no ha mucho tiempo que viv\'{\i}a un hidalgo de los de
\hrule
\vskip6pt
-This format in not infrequent at all and a tool for defining them is
-on the way and at a very advanced stage. It has not been include in
-version 3.0 because I'm not sure if the proper place is this package
-or \textsf{titlesec} and it is not stable enough yet.
+% This format in not infrequent at all and a tool for defining them is
+% on the way and at a very advanced stage. It has not been include in
+% version 3.0 because I'm not sure if the proper place is this package
+% or \textsf{titlesec} and it is not stable enough yet.
\subsection{Known issues}
@@ -1656,15 +1825,15 @@ List resuming is based on environment names, and when a
|\newenvironment| contains a list you may want to use |\begin{<list>}|
and |\end{<list>}|. Using the corresponding low-level commands (ie,
|\<list>| and |\end<list>|) is not an error, but it is your
-responsability to make sure the result is correct.
+responsibility to make sure the result is correct.
-\item The behaviour of mixed boxed labels (including enumerate and
+\item The behavior of mixed boxed labels (including enumerate and
itemize) and unboxed labels is not well-defined. The same applies to
boxed and unboxed inline lists (which could even raise an error).
\item
Similarly, resuming a series and a list at the same time is allowed,
-too, but again its behaviour is not well-defined.
+too, but again its behavior is not well-defined.
\item (3.5.2) An incompatibility with 2.x has popped up -- if you were
using the optional argument to pass a value to a |\ref| or other
@@ -1681,9 +1850,9 @@ punctuation between items). Two modes are provided: |boxed| and
|unboxed|.
\item |\setlist| is \textsf{calc}-savvy (eg, for use in loops),
-and you can set diferent lists and levels at once. \item All lengths
+and you can set different lists and levels at once. \item All lengths
related to labels can take the value |*| (and not only
-|labelsep| and |leftmargin|). Its behaviour has been made
+|labelsep| and |leftmargin|). Its behavior has been made
consistent and there is new value |!| which does not compute the
widest label.
@@ -1693,9 +1862,9 @@ case you are using |resume|).
\item |resume*| can be combined with other keys.
\item Lists can be gathered globally using series, so that they are
-considered a single list. To start a series just use
-|series=<series-name>| and then resume it with |resume=<series-name>| or
-|resume*=<series-name>|.
+considered a single list. To start a series just use
+|series=<series-name>| and then resume it with |resume=<series-name>|
+or |resume*=<series-name>|.
\item The ``experimental'' |fullwidth| has been replaced by a new key
|wide|.
@@ -1716,7 +1885,7 @@ has been removed. It is more flexible at the cost of having a more
\subsection{Bug fixes}
\begin{itemize}
-\item Star values (eg, |leftmargin=*|) could not be overriden
+\item Star values (eg, |leftmargin=*|) could not be overridden
and new values were ignored.
\item |nolistsep| as the first of several keys was not always
recognized and therefore treated like a short label