| 1 |
% \iffalse |
| 2 |
% File paralist.dtx |
| 3 |
% Copyright 1998-2017 Bernd Schandl |
| 4 |
% Copyright 2013 Julian Gilbey (modifications in v2.4) |
| 5 |
% email [email protected] |
| 6 |
% |
| 7 |
% Documentation and documented source code for the paralist package. |
| 8 |
% |
| 9 |
% See the README file for instructions. |
| 10 |
% |
| 11 |
% This file can be redistributed and/or modified under the terms |
| 12 |
% of the LaTeX Project Public License distributed from CTAN |
| 13 |
% archives in the directory macros/latex/base/lppl.txt; either |
| 14 |
% version 1 of the license, or (at your option) any later version. |
| 15 |
% |
| 16 |
% \fi |
| 17 |
%% \CharacterTable |
| 18 |
%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z |
| 19 |
%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z |
| 20 |
%% Digits \0\1\2\3\4\5\6\7\8\9 |
| 21 |
%% Exclamation \! Double quote \" Hash (number) \# |
| 22 |
%% Dollar \$ Percent \% Ampersand \& |
| 23 |
%% Acute accent \' Left paren \( Right paren \) |
| 24 |
%% Asterisk \* Plus \+ Comma \, |
| 25 |
%% Minus \- Point \. Solidus \/ |
| 26 |
%% Colon \: Semicolon \; Less than \< |
| 27 |
%% Equals \= Greater than \> Question mark \? |
| 28 |
%% Commercial at \@ Left bracket \[ Backslash \\ |
| 29 |
%% Right bracket \] Circumflex \^ Underscore \_ |
| 30 |
%% Grave accent \` Left brace \{ Vertical bar \| |
| 31 |
%% Right brace \} Tilde \~} |
| 32 |
%% |
| 33 |
% \iffalse |
| 34 |
%<*dtx> |
| 35 |
\ProvidesFile{paralist.dtx}% |
| 36 |
%</dtx> |
| 37 |
%<package>\ProvidesPackage{paralist}% |
| 38 |
%<driver>\ProvidesFile{paralist.drv}% |
| 39 |
% \fi |
| 40 |
% \ProvidesFile{paralist.dtx}% |
| 41 |
[2017/01/22 v2.7 Extended list environments] |
| 42 |
% \iffalse |
| 43 |
%<*driver> |
| 44 |
\documentclass[11pt]{ltxdoc} |
| 45 |
\usepackage[defblank,neverdecrease]{paralist} |
| 46 |
|
| 47 |
%% Comment out the next line if you want the documentation for the source code. |
| 48 |
\OnlyDescription |
| 49 |
|
| 50 |
%% Uncomment the next two lines for a change history. |
| 51 |
%% See also the instructions above. |
| 52 |
%% \AtBeginDocument{\RecordChanges} |
| 53 |
%% \AtEndDocument{\PrintChanges} |
| 54 |
|
| 55 |
%% Uncomment the next two lines for a command index. |
| 56 |
%% See also the instructions above. |
| 57 |
%% \AtBeginDocument{\CodelineIndex} |
| 58 |
%% \AtEndDocument{\setcounter{IndexColumns}{2}\PrintIndex} |
| 59 |
|
| 60 |
\begin{document} |
| 61 |
\DocInput{paralist.dtx} |
| 62 |
\end{document} |
| 63 |
%</driver> |
| 64 |
% \fi |
| 65 |
% |
| 66 |
% \changes{v1.0 (1998/10/09)}{}{Initial version} |
| 67 |
% \changes{v1.1 (1998/10/18)}{}{Added some examples} |
| 68 |
% \changes{v1.2 (1999/01/10)}{1999/01/07}{Most of the package and the |
| 69 |
% documentation rewritten} |
| 70 |
% \changes{v1.5 (1999/03/15)}{1999/03/15}{Released under LPPL} |
| 71 |
% \changes{v1.7 (1999/04/01)}{1999/03/31}{Use \cs{GetFileInfo}} |
| 72 |
% \changes{v1.9 (2000/03/05)}{2000/03/05}{Email and WWW changed} |
| 73 |
% \changes{v2.2 (2001/09/30)}{2001/09/30}{WWW changed} |
| 74 |
% \changes{v2.2a (2001/10/02)}{2001/10/02}{Minor documentation changes} |
| 75 |
% \changes{v2.3 (2002/03/10)}{2002/03/10}{Several changes in code} |
| 76 |
% \changes{v2.3a (2002/03/10)}{2002/03/10}{Couple of changes} |
| 77 |
% \changes{v2.3b (2002/03/18)}{2002/03/18}{Fix handling of flags} |
| 78 |
% \changes{v2.4 (2013/06/09)}{2013/06/09}{Extra option for label width (JDG)} |
| 79 |
% \changes{v2.5 (2015/12/30)}{2015/12/30}{Fix excess space introduced in v2.4} |
| 80 |
% \changes{v2.6 (2016/08/07)}{2016/08/07}{Fix of inparaitem and inparadesc} |
| 81 |
% \changes{v2.7 (2017/01/22)}{2017/01/22}{Fix of labelwidth problem introduced in v2.4} |
| 82 |
% |
| 83 |
% \GetFileInfo{paralist.dtx} |
| 84 |
% \CheckSum{1059} |
| 85 |
% |
| 86 |
% \makeatletter |
| 87 |
% \renewenvironment{theglossary}{% |
| 88 |
% \glossary@prologue \GlossaryParms \let\item\@idxitem \ignorespaces}{} |
| 89 |
% \makeatother |
| 90 |
% |
| 91 |
% \MakeShortVerb{\|} |
| 92 |
% |
| 93 |
% \let\package\textsf |
| 94 |
% \let\tab\indent |
| 95 |
% \IndexMin3cm |
| 96 |
% |
| 97 |
% \title{\package{paralist}\thanks{Package version \fileversion{} of |
| 98 |
% \filedate{}.} \\ Extended List Environments} |
| 99 |
% \author{Bernd Schandl \\ {\small |[email protected]|}} |
| 100 |
% \date{Printed on \today} |
| 101 |
% \maketitle |
| 102 |
% |
| 103 |
% \begin{abstract} |
| 104 |
% This package provides some new list environments. Itemized and enumerated |
| 105 |
% lists can be typeset within paragraphs, as paragraphs and in a compact |
| 106 |
% version. Most environments have optional arguments to format the labels. |
| 107 |
% Additionally, the \LaTeX\ environments |itemize| and |enumerate| can be |
| 108 |
% extended to use a similar optional argument. |
| 109 |
% \end{abstract} |
| 110 |
% |
| 111 |
% \section{Introduction} |
| 112 |
% |
| 113 |
% In a posting to |comp.text.tex| in May 1998, someone asked about the |
| 114 |
% possibility of an enumerated environment that |
| 115 |
% \begin{inparaenum}[(a)] |
| 116 |
% \item can be used within paragraphs, |
| 117 |
% \item takes care of enumeration and |
| 118 |
% \item has items that can be referenced. \label{pl2} |
| 119 |
% \end{inparaenum} |
| 120 |
% Another posting mentioned the package \package{theapa} as |
| 121 |
% a possible solution. Now that I was looking for that kind of environment and |
| 122 |
% found those old postings, I had a look at \package{theapa} and decided to |
| 123 |
% take out the part about list environments and rewrite it a little bit. |
| 124 |
% |
| 125 |
% Over time, compact versions of |enumerate|, |itemize| and |description| have |
| 126 |
% been added and optional arguments for most environments make it possible to |
| 127 |
% define a special way of formatting the labels. |
| 128 |
% |
| 129 |
% \section{Package Options} |
| 130 |
% |
| 131 |
% Certain parts of the package are only executed if appropriate options are |
| 132 |
% specified. |
| 133 |
% \begin{compactdesc} |
| 134 |
% \renewcommand*\makelabel[1]{\hspace\labelsep |
| 135 |
% \normalfont\mdseries\sffamily #1} |
| 136 |
% \item[newitem/olditem] With \textsf{newitem} (set by default), the \LaTeX\ |
| 137 |
% environment |itemize| will be redefined to have an optional argument to |
| 138 |
% specify the format of the label. See Section~\ref{sec:format}. |
| 139 |
% Specifying \textsf{olditem} will leave |itemize| as it is. |
| 140 |
% \item[newenum/oldenum] With \textsf{newenum} (set by default), the \LaTeX\ |
| 141 |
% environment |enumerate| will be redefined to have an optional argument |
| 142 |
% to specify the format of the label. See Section~\ref{sec:format}. |
| 143 |
% Specifying \textsf{oldenum} will leave |enumerate| as it is. |
| 144 |
% \item[alwaysadjust] The width of the labels of the environments |
| 145 |
% |compactenum|, |enumerate|, |compactitem| and |itemize| is always |
| 146 |
% adjusted to the actual label. For the default labels, this means that |
| 147 |
% the label width is usually decreased. |
| 148 |
% \item[neveradjust] The width of the labels is never adjusted, not even for |
| 149 |
% environments where you defined the labels manually using the optional |
| 150 |
% argument. This option is ignored if option \textsf{alwaysadjust} is used |
| 151 |
% as well. |
| 152 |
% \item[neverdecrease] If the width of the labels is adjusted, this option |
| 153 |
% avoids the decrease of the width. Here is an example why this might make |
| 154 |
% sense. If no \textsf{\dots adjust} option is specified, then the |
| 155 |
% indentation of the \cs{item} in |\begin{enumerate}| and |
| 156 |
% |\begin{enumerate}[1.]| is different although they have the same |
| 157 |
% labels. |
| 158 |
% \item[defblank] The two environments |inparablank| and |asparablank| will |
| 159 |
% be defined. See Section~\ref{sec:blank}. |
| 160 |
% \changes{v2.0 (2001/03/03)}{2001/03/03}{New options \textsf{pointlessenum} |
| 161 |
% and \textsf{pointedenum}} |
| 162 |
% \item[pointlessenum] The items in the enumerated environments are labeled |
| 163 |
% and referenced as in ``1'', ``1.1'', ``1.1.1'' and ``1.1.1.1''. See |
| 164 |
% also Section~\ref{sec:format}. |
| 165 |
% \item[pointedenum] The items in the enumerated environments are labeled |
| 166 |
% as in ``1.'', ``1.1.'', ``1.1.1.'' and ``1.1.1.1.'' and referenced |
| 167 |
% without the trailing point. See also Section~\ref{sec:format}. This |
| 168 |
% option is ignored if \textsf{pointlessenum} is used. |
| 169 |
% \item[flushright] The labels in the four lists mentioned above are set |
| 170 |
% flush right. As this is the \LaTeX\ default, this is also the default |
| 171 |
% for this package. |
| 172 |
% \item[flushleft] The labels in the four lists mentioned above are set |
| 173 |
% flush left. |
| 174 |
% \changes{v1.9 (2000/03/05)}{2000/03/05}{New options |
| 175 |
% \textsf{cfg}/\textsf{nocfg}} |
| 176 |
% \item[cfg] The configuration file |paralist.cfg| is loaded if it |
| 177 |
% exists. (default) |
| 178 |
% \item[nocfg] The configuration file is not loaded. |
| 179 |
% \end{compactdesc} |
| 180 |
% The option \textsf{increaseonly} is deprecated; use \textsf{neverdecrease} |
| 181 |
% instead. |
| 182 |
% |
| 183 |
% \section{Formatting the Labels} |
| 184 |
% \label{sec:format} |
| 185 |
% |
| 186 |
% All the itemized and enumerated environments have optional arguments to |
| 187 |
% specify the format of the labels. The following examples will only work if |
| 188 |
% you have loaded \package{paralist} \emph{without} the options |
| 189 |
% \textsf{olditem} and \textsf{oldenum}. |
| 190 |
% |
| 191 |
% Using the \LaTeX\ standard classes, |itemize| uses the following symbols |
| 192 |
% for the labels of the four list levels: {\textbullet} |
| 193 |
% {\normalfont\bfseries \textendash} {\textasteriskcentered} |
| 194 |
% {\textperiodcentered}. If you want to change this for a particular |
| 195 |
% environment, just say something like\\ |
| 196 |
% \tab|\begin{itemize}[$\star$]|\\ |
| 197 |
% and $\star$ will be used instead of the default symbol. |
| 198 |
% |
| 199 |
% The optional argument of the enumerated environment is a little more |
| 200 |
% complicated, but whoever has worked with David Carlisle's |
| 201 |
% \package{enumerate} package can skip the rest of the section since exactly |
| 202 |
% the same mechanism (and almost the same code) is used. |
| 203 |
% |
| 204 |
% The tokens |A|, |a|, |I|, |i|, and |1| can be used in the optional argument |
| 205 |
% to produce the counter with one of the styles \cs{Alph}, \cs{alph}, |
| 206 |
% \cs{Roman}, \cs{roman} and \cs{arabic}.\footnote{% |
| 207 |
% The set of tokens can be extended. Look for \cs{pl@hook} in the code |
| 208 |
% section.} |
| 209 |
% These letters may be surrounded by any other string involving any other |
| 210 |
% \TeX\ expression. However, the tokens |A a I i 1| must be inside a |{ }| |
| 211 |
% group if they should not be taken as special. A few examples follow.\\ |
| 212 |
% \tab|\begin{enumerate}[(i)]|\\ |
| 213 |
% produces the labels (i), (ii), (iii) \dots\\ |
| 214 |
% \tab|\begin{enumerate}[{example} a)]|\\ |
| 215 |
% produces example a), example b), example c) \dots\\ |
| 216 |
% \tab|\begin{enumerate}[{A}-1]|\\ |
| 217 |
% produces A-1, A-2, A-3 \dots\\ |
| 218 |
% \tab|\begin{enumerate}[\bfseries {Item} I]|\\ |
| 219 |
% produces \textbf{Item I}, \textbf{Item II}, \textbf{Item III} \dots |
| 220 |
% |
| 221 |
% Note that in the last example |[\textbf{Item I}]| does not work because |
| 222 |
% the special token |I| is inside a group. |
| 223 |
% |
| 224 |
% The \cs{ref} command produces only the counter without the surrounding text, |
| 225 |
% so in the examples above you would get i, a, 1 and I respectively if you |
| 226 |
% referenced the first item. |
| 227 |
% |
| 228 |
% If the labels use roman (as in the first example above), an attempt |
| 229 |
% is made to determine the widest necessary label, assuming the |
| 230 |
% maximum item number is at most~7. If this is not the case, and the |
| 231 |
% labels might be wider than this, one can use a second optional |
| 232 |
% argument specifying the widest label number, for example:\\ |
| 233 |
% \tab|\begin{enumerate}[(i)][8]|\\ |
| 234 |
% which will produce the labels (i), (ii), \dots, (vii), (viii), (ix) |
| 235 |
% and so on, with everything up to (xvi) fitting |
| 236 |
% comfortably.\footnote{This feature was introduced in version 2.4 of |
| 237 |
% this package, and it would be wise therefore, if using this |
| 238 |
% feature in portable documents, to specify |
| 239 |
% \texttt{\char`\\usepackage\char`\{paralist\char`\}[2013/06/09]} |
| 240 |
% when loading the package.} |
| 241 |
% |
| 242 |
% \DescribeMacro{\pointedenum} |
| 243 |
% \DescribeMacro{\pointlessenum} |
| 244 |
% There are also two package options and two corresponding macros to format |
| 245 |
% the labels and references of enumerated environments. The option |
| 246 |
% \textsf{pointedenum} and the macro |\pointedenum| format the labels as in |
| 247 |
% ``1.'', ``1.1.'', ``1.1.1.'' and ``1.1.1.1.'' and the references without the |
| 248 |
% trailing point. The option \textsf{pointlessenum} and the macro |
| 249 |
% |\pointlessenum| do not use the trailing point in the labels either. |
| 250 |
% |
| 251 |
% While the package options make a global change, the macros can be used for a |
| 252 |
% local change or to define a special environment, for example\\ |
| 253 |
% \tab|\newenvironment{myenum}%|\\ |
| 254 |
% \tab| {\pointedenum\begin{enumerate}}%|\\ |
| 255 |
% \tab| {\end{enumerate}}|\\ |
| 256 |
% Note that |\begin{enumerate}| is used \emph{after} |\pointedenum|, otherwise |
| 257 |
% the optional argument of enumerate would not work (in case you want to use |
| 258 |
% them within the same environment which doesn't really make sense). |
| 259 |
% |
| 260 |
% \DescribeMacro{\paradescriptionlabel} |
| 261 |
% In the document classes, the label format for the |description| environment |
| 262 |
% is defined as\\ |
| 263 |
% \tab|\newcommand*\descriptionlabel[1]{%|\\ |
| 264 |
% \tab| \hspace\labelsep\normalfont\bfseries #1}|.\\ |
| 265 |
% This is also used by |compactdesc|. For the environments |inparadesc| and |
| 266 |
% |asparadesc|, there is a separate macro called \cs{paradescriptionlabel} |
| 267 |
% defined (almost) like this:\\ |
| 268 |
% \tab|\newcommand*\paradescriptionlabel[1]{%|\\ |
| 269 |
% \tab| \normalfont\bfseries #1}|. |
| 270 |
% |
| 271 |
% |
| 272 |
% \section{Defaults for Labels and Margins} |
| 273 |
% |
| 274 |
% If you want your lists labeled differently than the \LaTeX\ default |
| 275 |
% throughout your document, it is a bit awkward to use the optional argument |
| 276 |
% of the environments all the time. Therefore three macros are provided |
| 277 |
% to define the labels and the left margins of the list environments. |
| 278 |
% |
| 279 |
% Note that the macros defining the labels do \emph{not} adapt the left |
| 280 |
% margins of the list environments because this may have unexpected side |
| 281 |
% effects. If you want that change, you have to explicitly use |
| 282 |
% \cs{setdefaultleftmargin}. |
| 283 |
% |
| 284 |
% If in any of the following three macros an argument is empty, then |
| 285 |
% the according label or margin is left unchanged. |
| 286 |
% |
| 287 |
% \DescribeMacro{\setdefaultitem} |
| 288 |
% The default labels of itemized environments can be set by using the macro |
| 289 |
% \cs{setdefaultitem} which needs four arguments. To get the \LaTeX\ default |
| 290 |
% labels say\\ |
| 291 |
% \tab|\setdefaultitem{\textbullet}%|\\ |
| 292 |
% \tab| {\normalfont\bfseries \textendash}%|\\ |
| 293 |
% \tab| {\textasteriskcentered}{\textperiodcentered}|\\ |
| 294 |
% (which is of course silly because you don't need to do anything if you want |
| 295 |
% to stick with the default labels). If you want a triangle |
| 296 |
% ($\,\triangleright$) instead of the endash for level two just say\\ |
| 297 |
% \tab|\setdefaultitem{}{$\triangleright$}{}{}|. |
| 298 |
% |
| 299 |
% \DescribeMacro{\setdefaultenum} |
| 300 |
% The labels of enumerated lists are formatted with \cs{setdefaultenum} |
| 301 |
% using the mechanism described in Section~\ref{sec:format}. The \LaTeX\ |
| 302 |
% default labels could be defined by\\ |
| 303 |
% \tab|\setdefaultenum{1.}{(a)}{i.}{A.}|.\\ |
| 304 |
% If you want capital Roman letters for level three, just say\\ |
| 305 |
% \tab|\setdefaultenum{}{}{I.}{}|. |
| 306 |
% |
| 307 |
% \DescribeMacro{\setdefaultleftmargin} |
| 308 |
% To change the left margin of the lists, use \cs{setdefaultleftmargin}. |
| 309 |
% The length \cs{leftmargin}$\,n$ specifies the indentation of a list of level |
| 310 |
% $n$ with respect to the list of level $n-1$ or the surrounding text |
| 311 |
% (if $n=1$). The environments that use \cs{leftmargin}$\,n$ are (at least) |
| 312 |
% |enumerate|, |compactenum|, |itemize| and |compactitem| (maybe a few more |
| 313 |
% that I am not aware of). The \LaTeX\ settings could be defined by\\ |
| 314 |
% \tab|\setdefaultleftmargin{2.5em}{2.2em}{1.87em}{1.7em}{1em}{1em}|.\\ |
| 315 |
% In \textsf{twocolumn} mode \LaTeX\ uses a smaller margin for the first, |
| 316 |
% fifth and sixth level which could be defined by\\ |
| 317 |
% \tab|\setdefaultleftmargin{2em}{}{}{}{.5em}{.5em}|. |
| 318 |
% |
| 319 |
% The macros \cs{defaultitem}, \cs{defaultenum} and |\defaultleftmargin| |
| 320 |
% should not be used anymore. They are only kept for backward compatibility |
| 321 |
% with package versions~$<2.1$. |
| 322 |
% |
| 323 |
% If some of your changes should appear in \emph{every} document that uses |
| 324 |
% \package{paralist}, put them in a file |paralist.cfg| which is read at the |
| 325 |
% end of the package in case it exists (unless you specified the option |
| 326 |
% \textsf{nocfg}). |
| 327 |
% |
| 328 |
% \section{New Environments} |
| 329 |
% |
| 330 |
% \subsection{Enumerated Environments} |
| 331 |
% |
| 332 |
% \DescribeEnv{asparaenum} |
| 333 |
% The environment |asparaenum| is an enumerated environment in which the |
| 334 |
% items are formatted as separate paragraphs. |
| 335 |
% |
| 336 |
% As an example, we use |asparaenum| within this paragraph. |
| 337 |
% \begin{asparaenum} |
| 338 |
% \item Every \cs{item} is basically set as a separate paragraph. The second |
| 339 |
% line is \emph{not} indented (this is a feature, not a bug). |
| 340 |
% \item The next \cs{item} looks like this and is labeled. \label{pl1} |
| 341 |
% \end{asparaenum} |
| 342 |
% The example was produced by the following piece of code: |
| 343 |
%\begin{verbatim} |
| 344 |
% \begin{asparaenum} |
| 345 |
% \item Every ... |
| 346 |
% \item The next ... \label{pl1} |
| 347 |
% \end{asparaenum} |
| 348 |
%\end{verbatim} |
| 349 |
% By saying |\ref{pl1}| we get \ref{pl1}. |
| 350 |
% |
| 351 |
% \DescribeEnv{inparaenum} |
| 352 |
% The |inparaenum| environment formats an enumerated list within a paragraph, |
| 353 |
% just like the one in the introduction. |
| 354 |
% |
| 355 |
% The example in the introduction was set by the following commands: |
| 356 |
%\begin{verbatim} |
| 357 |
% ... of an enumerated environment that |
| 358 |
% \begin{inparaenum}[(a)] |
| 359 |
% \item can be used within paragraphs, |
| 360 |
% \item takes care of enumeration and |
| 361 |
% \item has items that can be referenced. \label{pl2} |
| 362 |
% \end{inparaenum} |
| 363 |
% Another posting mentioned ... |
| 364 |
%\end{verbatim} |
| 365 |
% By saying |\ref{pl2}| we get \ref{pl2}. |
| 366 |
% |
| 367 |
% \DescribeEnv{compactenum} |
| 368 |
% The |compactenum| environment is just a compact version of the standard |
| 369 |
% |enumerate| environment. All the vertical skips are set to zero (actually |
| 370 |
% they are adjustable, see Section~\ref{sec:Finetuning}). |
| 371 |
% |
| 372 |
% \subsection{Itemized Environments} |
| 373 |
% |
| 374 |
% \DescribeEnv{asparaitem} |
| 375 |
% The |asparaitem| environment is very similar to |asparaenum|. It just uses |
| 376 |
% symbols instead of enumerating the items. The environment has an optional |
| 377 |
% argument which specifies the symbol. For an example see |
| 378 |
% Section~\ref{sec:Nesting-Environments}. |
| 379 |
% |
| 380 |
% \DescribeEnv{inparaitem} |
| 381 |
% Similar to |inparaenum| I added an environment |inparaitem| which also |
| 382 |
% has an optional argument. I don't really know why anybody would use it, but |
| 383 |
% I added it because of symmetry. |
| 384 |
% |
| 385 |
% \DescribeEnv{compactitem} |
| 386 |
% The |compactitem| environment is again just a compact version of the |
| 387 |
% standard |itemize| environment with all the vertical skips set to zero. |
| 388 |
% So by using this environment |
| 389 |
% \begin{compactitem}[$\circ$] |
| 390 |
% \item you can save some space and |
| 391 |
% \item specify the symbol. |
| 392 |
% \item Let me add a longer item so that you can see that we have a different |
| 393 |
% indentation than in the |asparaitem| environment. |
| 394 |
% \end{compactitem} |
| 395 |
% The code of the example above is |
| 396 |
%\begin{verbatim} |
| 397 |
% \begin{compactitem}[$\circ$] |
| 398 |
% \item you can save some space and |
| 399 |
% \item specify the symbol. |
| 400 |
% \item Let me add ... |
| 401 |
% \end{compactitem} |
| 402 |
%\end{verbatim} |
| 403 |
% |
| 404 |
% \subsection{Descriptive Environments} |
| 405 |
% |
| 406 |
% \DescribeEnv{asparadesc} |
| 407 |
% The |asparadesc| environment is again very similar to |asparaenum|. It just |
| 408 |
% uses the optional arument of \cs{item} as the ``intro'' for the paragraph. |
| 409 |
% |
| 410 |
% \DescribeEnv{inparadesc} |
| 411 |
% Again similar to |inparaenum|, I added an environment |inparadesc|. Probably |
| 412 |
% nobody would use it but I added it because of symmetry. |
| 413 |
% |
| 414 |
% \DescribeEnv{compactdesc} |
| 415 |
% The |compactdesc| environment is copied from the \LaTeX{} standard classes |
| 416 |
% with all the vertical skips set to zero. By the way, does anybody know why |
| 417 |
% |description| has to be defined by the document class and is not defined in |
| 418 |
% |ltlists.dtx|? |
| 419 |
% |
| 420 |
% \subsection{Blank Environments} |
| 421 |
% \label{sec:blank} |
| 422 |
% |
| 423 |
% Someone requested list environments that print their items as if there was no |
| 424 |
% list. It seems that this makes entering structured data a little easier in |
| 425 |
% LyX. Since not everybody needs these (odd) environments they are only |
| 426 |
% defined if the package is loaded with the option \textsf{defblank}. The |
| 427 |
% following two environments do not have optional arguments because there is |
| 428 |
% no label to format. |
| 429 |
% |
| 430 |
% \DescribeEnv{asparablank} |
| 431 |
% Every item is formatted just as if it was a regular paragraph. If you want |
| 432 |
% to use the optional argument of \cs{item}, you have to add some white space |
| 433 |
% at the end because \cs{labelsep} is set to zero. Use something like\\ |
| 434 |
% \tab|\item[\textbullet\hspace{.5em}]| |
| 435 |
% |
| 436 |
% \DescribeEnv{inparablank} |
| 437 |
% The items are set |
| 438 |
% \begin{inparablank} |
| 439 |
% \item just as regular text. |
| 440 |
% \item The ``white space problem'' mentioned in the last paragraph |
| 441 |
% \item is handled automatically. |
| 442 |
% \end{inparablank} |
| 443 |
% If I didn't tell you, you wouldn't know that this paragraph is set using the |
| 444 |
% following construction: |
| 445 |
%\begin{verbatim} |
| 446 |
% ... are set |
| 447 |
% \begin{inparablank} |
| 448 |
% \item just as ... |
| 449 |
% \item The ... |
| 450 |
% \item is handled ... |
| 451 |
% \end{inparablank} |
| 452 |
% If I didn't ... |
| 453 |
%\end{verbatim} |
| 454 |
% |
| 455 |
%\section{Nesting Environments} |
| 456 |
%\label{sec:Nesting-Environments} |
| 457 |
% |
| 458 |
% All the environments can be nested just as the standard list environments |
| 459 |
% although the results might sometimes not be as expected. For example, it's |
| 460 |
% probably not a good idea to call another list environment within a |
| 461 |
% |inpara...| environment, but why should anyone want to do this? The maximal |
| 462 |
% nesting level is six (four of the same kind), just as for the \LaTeX\ |
| 463 |
% environments. |
| 464 |
% |
| 465 |
% This paragraph is |
| 466 |
% \begin{asparaitem}[$\star$] |
| 467 |
% \item an example for the usage of |asparaitem| and its optional argument, |
| 468 |
% \item and a demonstration that |
| 469 |
% \begin{inparaenum}[(i)] |
| 470 |
% \item you can use |inparaenum| within |asparaitem| and |
| 471 |
% \item you can still reference it. \label{pl3} |
| 472 |
% \end{inparaenum} |
| 473 |
% \end{asparaitem} |
| 474 |
% The reference was in subitem (\ref{pl3}). |
| 475 |
% The code of the last example is |
| 476 |
%\begin{verbatim} |
| 477 |
% \begin{asparaitem}[$\star$] |
| 478 |
% \item an example ... |
| 479 |
% \item and a demonstration that |
| 480 |
% \begin{inparaenum}[(i)] |
| 481 |
% \item you can use ... |
| 482 |
% \item can still ... \label{pl3} |
| 483 |
% \end{inparaenum} |
| 484 |
% \end{asparaitem} |
| 485 |
% The reference was in subitem (\ref{pl3}). |
| 486 |
%\end{verbatim} |
| 487 |
% |
| 488 |
%\section{Fine-Tuning} |
| 489 |
%\label{sec:Finetuning} |
| 490 |
% |
| 491 |
% Ok, I already hear someone saying ``Your compact lists are a nice idea, |
| 492 |
% but I'd like to have it a little less compact.'' Here is a solution. The |
| 493 |
% following skips can be adjusted using \cs{setlength} and affect the |
| 494 |
% spacing of the |compact...| environments. The names are chosen similar to |
| 495 |
% the \LaTeX{} names, so I just copy the explanation from |ltlists.dtx|. |
| 496 |
% \begin{compactdesc} |
| 497 |
% \item[\cs{pltopsep}:] Space between first item and preceding paragraph. |
| 498 |
% \item[\cs{plpartopsep}:] Extra space added to \cs{topsep} when |
| 499 |
% environment starts a new paragraph (is called in vmode). |
| 500 |
% \item[\cs{plitemsep}:] Space between successive items. |
| 501 |
% \item[\cs{plparsep}:] Space between paragraphs within an item -- the |
| 502 |
% \cs{parskip} for this environment. |
| 503 |
% \end{compactdesc} |
| 504 |
% Actually, the two |...topsep| skips are added before \emph{and after} the |
| 505 |
% list. |
| 506 |
% |
| 507 |
% The default value for all of them is 0\,pt. It is probably a good idea to |
| 508 |
% define them depending on the font size if they are non-zero, i.\,e.\ using |
| 509 |
% units such as |ex| or |em|. |
| 510 |
% |
| 511 |
% \section{Bugs and Wishes} |
| 512 |
% |
| 513 |
% No bugs \dots that I know of. |
| 514 |
% |
| 515 |
% \changes{v2.3 (2002/03/10)}{2002/03/10}{Describe incombatibility with |
| 516 |
% \package{babel}} |
| 517 |
% Well, there is actually one issue if you use the \package{babel} package |
| 518 |
% with one of the options \textsf{acadian}, \textsf{canadien}, |
| 519 |
% \textsf{francais}, \textsf{frenchb} or \textsf{french} (which all do |
| 520 |
% essentially the same). Since it redefines the itemize environment |
| 521 |
% at the \cs{start\{document\}}, the definition of |itemize| made by |
| 522 |
% \package{paralist} is lost. There are three possible fixes: |
| 523 |
% \begin{compactenum} |
| 524 |
% \item Accept the |itemize| environment without optional argument.~|:(| |
| 525 |
% \item Use \cs{FrenchItemizeSpacingfalse} after loading \package{babel} which |
| 526 |
% will avoid the redefinition of |itemize| by \package{babel}.~|:/| |
| 527 |
% \item Figure out a way to combine the code in \package{babel} and |
| 528 |
% \package{paralist} and send the solution to me.~|:)| |
| 529 |
% \end{compactenum} |
| 530 |
% |
| 531 |
% Feel free to let me know about any problems, suggestions and wishes you have |
| 532 |
% concerning this package and its documentation. Praise is welcome, |
| 533 |
% too |;-)| The most recent version of this package can always be found on |
| 534 |
% CTAN or at |http://schandl.gmxhome.de/paralist/|. |
| 535 |
% |
| 536 |
% \section{Acknowledgments} |
| 537 |
% |
| 538 |
% I want to thank all the users who helped me with their |
| 539 |
% comments finding bugs and extending the package. A big ``Thank you'' goes to |
| 540 |
% David Carlisle, because there wouldn't be any optional arguments for the |
| 541 |
% enumerated environments without the code from his |
| 542 |
% \package{enumerate} package. Some pieces of code of the |inpara...| |
| 543 |
% environments are inspired by Mogens Lemvig Hansen's \package{shortlst} |
| 544 |
% package. |
| 545 |
% |
| 546 |
% \StopEventually |
| 547 |
% |
| 548 |
% \section{Implementation} |
| 549 |
% |
| 550 |
% At the beginning of this file, the |\ProvidesPackage| macro was executed. |
| 551 |
% So we only need to state that we need \LaTeXe. |
| 552 |
% \begin{macrocode} |
| 553 |
%<*package> |
| 554 |
\NeedsTeXFormat{LaTeX2e} |
| 555 |
% \end{macrocode} |
| 556 |
% |
| 557 |
% \subsection{Package Options} |
| 558 |
% |
| 559 |
% \changes{v1.2 (1999/01/10)}{1999/01/07}{Package options added} |
| 560 |
% \changes{v1.3 (1999/01/19)}{1999/01/18}{Option \textsf{increaseonly} added} |
| 561 |
% \changes{v2.1 (2001/09/20)}{2001/09/16}{Options \textsf{olditem} and |
| 562 |
% \textsf{oldenum} added} |
| 563 |
% \changes{v2.1 (2001/09/20)}{2001/09/16}{Options \textsf{newitem} and |
| 564 |
% \textsf{newenum} are set by default} |
| 565 |
% \changes{v2.1 (2001/09/20)}{2001/09/17}{Options \textsf{alwaysadjust}, |
| 566 |
% \textsf{neveradjust} and \textsf{neverdecrease} added; option |
| 567 |
% \textsf{increaseonly} only kept for compatibility} |
| 568 |
% \changes{v2.1 (2001/09/20)}{2001/09/16}{Options \textsf{flushleft} and |
| 569 |
% \textsf{flushright} added} |
| 570 |
% First we define the package options. The option \textsf{increaseonly} is |
| 571 |
% only kept for compatibility. |
| 572 |
% \begin{macrocode} |
| 573 |
\newif\if@plnewitem\@plnewitemtrue |
| 574 |
\newif\if@plnewenum\@plnewenumtrue |
| 575 |
\newif\if@plalwaysadjust\@plalwaysadjustfalse |
| 576 |
\newif\if@plneveradjust\@plneveradjustfalse |
| 577 |
\newif\if@plneverdecrease\@plneverdecreasefalse |
| 578 |
\newif\if@pldefblank\@pldefblankfalse |
| 579 |
\newif\if@plpointedenum\@plpointedenumfalse |
| 580 |
\newif\if@plpointlessenum\@plpointlessenumfalse |
| 581 |
\newif\if@plflushright\@plflushrighttrue |
| 582 |
\newif\if@plloadcfg\@plloadcfgtrue |
| 583 |
\DeclareOption{newitem}{\@plnewitemtrue} |
| 584 |
\DeclareOption{olditem}{\@plnewitemfalse} |
| 585 |
\DeclareOption{newenum}{\@plnewenumtrue} |
| 586 |
\DeclareOption{oldenum}{\@plnewenumfalse} |
| 587 |
\DeclareOption{alwaysadjust}{\@plalwaysadjusttrue} |
| 588 |
\DeclareOption{neveradjust}{\@plneveradjusttrue} |
| 589 |
\DeclareOption{neverdecrease}{\@plneverdecreasetrue} |
| 590 |
\DeclareOption{increaseonly}{\@plneverdecreasetrue |
| 591 |
\PackageWarningNoLine{Paralist}{Option increaseonly deprecated. |
| 592 |
\MessageBreak Use option neverdecrease instead}} |
| 593 |
\DeclareOption{defblank}{\@pldefblanktrue} |
| 594 |
\DeclareOption{pointedenum}{\@plpointedenumtrue} |
| 595 |
\DeclareOption{pointlessenum}{\@plpointlessenumtrue} |
| 596 |
\DeclareOption{cfg}{\@plloadcfgtrue} |
| 597 |
\DeclareOption{nocfg}{\@plloadcfgfalse} |
| 598 |
\DeclareOption{flushright}{\@plflushrighttrue} |
| 599 |
\DeclareOption{flushleft}{\@plflushrightfalse} |
| 600 |
\ExecuteOptions{newitem,newenum,cfg,flushright} |
| 601 |
\ProcessOptions\relax |
| 602 |
% \end{macrocode} |
| 603 |
% \changes{v2.3 (2002/03/10)}{2002/03/07}{Option \textsf{alwaysadjust} |
| 604 |
% overwrites \textsf{neveradjust}} |
| 605 |
% Make sure that \textsf{alwaysadjust} overwrites \textsf{neveradjust}. |
| 606 |
% \begin{macrocode} |
| 607 |
\if@plalwaysadjust\@plneveradjustfalse\fi |
| 608 |
% \end{macrocode} |
| 609 |
% |
| 610 |
% \subsection{New Skips} |
| 611 |
% |
| 612 |
% \changes{v1.2 (1999/01/10)}{1999/01/07}{Counters \texttt{asparaenum} and |
| 613 |
% \texttt{inparaenum} removed} |
| 614 |
% The new skips are all set to zero. |
| 615 |
% \changes{v1.1 (1998/10/18)}{}{Skips to adjust spacing in \texttt{compact...} |
| 616 |
% environments defined} |
| 617 |
% \begin{macrocode} |
| 618 |
\newlength{\pltopsep} |
| 619 |
\newlength{\plpartopsep} |
| 620 |
\newlength{\plitemsep} |
| 621 |
\newlength{\plparsep} |
| 622 |
\setlength{\pltopsep}{0pt} |
| 623 |
\setlength{\plpartopsep}{0pt} |
| 624 |
\setlength{\plitemsep}{0pt} |
| 625 |
\setlength{\plparsep}{0pt} |
| 626 |
% \end{macrocode} |
| 627 |
% |
| 628 |
% \subsection{Little ``Helper'' Macros} |
| 629 |
% |
| 630 |
% \begin{macro}{\if@empty} |
| 631 |
% \changes{v1.4 (1999/01/27)}{1999/01/19}{New macro} |
| 632 |
% A small macro to detect whether |#1| is empty. |
| 633 |
% \begin{macrocode} |
| 634 |
\def\if@empty#1#2#3{% |
| 635 |
\def\@tempa{#1}% |
| 636 |
\ifx\@tempa\@empty#2\else#3\fi} |
| 637 |
% \end{macrocode} |
| 638 |
% \end{macro} |
| 639 |
% \begin{macro}{\pl@item} |
| 640 |
% \changes{v1.2 (1999/01/10)}{1999/01/07}{New macro \cs{pl@item} used for all |
| 641 |
% \texttt{inpara...} environments} |
| 642 |
% \changes{v1.7 (1999/04/01)}{1999/04/01}{Use \cs{nobreakspace} instead of |
| 643 |
% \texttt{\textasciitilde}} |
| 644 |
% \changes{v1.7 (1999/04/01)}{1999/04/01}{Put argument in group to keep |
| 645 |
% e.\,g.~font changes local} |
| 646 |
% \changes{v2.1 (2001/09/20)}{2001/09/16}{Use \cs{makelabel}} |
| 647 |
% The following macro is used for all \texttt{inpara...} environments. |
| 648 |
% It adds space after the label only when the label has a positive width. |
| 649 |
% \begin{macrocode} |
| 650 |
\def\pl@item[#1]{% |
| 651 |
\if@noitemarg |
| 652 |
\@noitemargfalse |
| 653 |
\if@nmbrlist |
| 654 |
\refstepcounter{\@listctr}% |
| 655 |
\fi |
| 656 |
\fi |
| 657 |
\settowidth{\@tempdima}{#1}% |
| 658 |
\ifdim\@tempdima>\z@\makelabel{{#1}}\nobreakspace\fi |
| 659 |
\ignorespaces |
| 660 |
} |
| 661 |
% \end{macrocode} |
| 662 |
% \end{macro} |
| 663 |
% \begin{macro}{\paradescriptionlabel} |
| 664 |
% \changes{v2.1 (2001/09/20)}{2001/09/16}{New macro} |
| 665 |
% Similar to the \LaTeX\ macro \cs{descriptionlabel} we define a macro |
| 666 |
% for the description environments in and as paragraphs. |
| 667 |
% \begin{macrocode} |
| 668 |
\def\paradescriptionlabel#1{{\normalfont\bfseries #1}} |
| 669 |
% \end{macrocode} |
| 670 |
% \end{macro} |
| 671 |
% \begin{macro}{\enumlabel} |
| 672 |
% \changes{v2.1 (2001/09/20)}{2001/09/16}{New macro} |
| 673 |
% \changes{v2.2 (2001/09/30)}{2001/09/23}{Use \cs{hfil} instead of \cs{hss} |
| 674 |
% for flushleft} |
| 675 |
% \changes{v2.2 (2001/09/30)}{2001/09/30}{No need for \cs{llap} in flushright} |
| 676 |
% Similar to the \LaTeX\ macro \cs{descriptionlabel} we define a macro |
| 677 |
% for the enumerated environments depending on whether the label should be set |
| 678 |
% flush left or flush right. |
| 679 |
% \begin{macrocode} |
| 680 |
\if@plflushright |
| 681 |
\def\enumlabel#1{\hss#1} |
| 682 |
\else |
| 683 |
\def\enumlabel#1{#1\hfil} |
| 684 |
\fi |
| 685 |
% \end{macrocode} |
| 686 |
% \end{macro} |
| 687 |
% \begin{macro}{\itemlabel} |
| 688 |
% \changes{v2.1 (2001/09/20)}{2001/09/16}{New macro} |
| 689 |
% \changes{v2.2 (2001/09/30)}{2001/09/23}{Use \cs{hfil} instead of \cs{hss} |
| 690 |
% for flushleft} |
| 691 |
% \changes{v2.2 (2001/09/30)}{2001/09/30}{No need for \cs{llap} in flushright} |
| 692 |
% Similar to the \LaTeX\ macro \cs{descriptionlabel} we define a macro |
| 693 |
% for the itemized environments depending on whether the label should be set |
| 694 |
% flush left or flush right. |
| 695 |
% \begin{macrocode} |
| 696 |
\if@plflushright |
| 697 |
\def\itemlabel#1{\hss#1} |
| 698 |
\else |
| 699 |
\def\itemlabel#1{#1\hfil} |
| 700 |
\fi |
| 701 |
% \end{macrocode} |
| 702 |
% \end{macro} |
| 703 |
% |
| 704 |
% \subsection{Adjusting the Label Width} |
| 705 |
% |
| 706 |
% The width of the label is only adjusted either if the format of the label |
| 707 |
% was specified manually and the option \textsf{neveradjust} was \emph{not} |
| 708 |
% used or if the option \textsf{alwaysadjust} was used. Then |
| 709 |
% |\leftmargin|$\,n$ is set to the width of the label plus |\labelsep|. |
| 710 |
% The width of the label is only decreased if the option |
| 711 |
% \textsf{neverdecrease} was \emph{not} used. |
| 712 |
% |
| 713 |
% \changes{v2.3 (2002/03/10)}{2002/03/07}{New flags to decide on label width |
| 714 |
% adjustment} |
| 715 |
% \changes{v2.4 (2013/06/09)}{2013/06/09}{New flags to decide on wide |
| 716 |
% label width} |
| 717 |
% First we need some flags to indicate whether the label was redefined by the |
| 718 |
% environment and whether the label should be adjusted. |
| 719 |
% \begin{macrocode} |
| 720 |
\newif\if@plmylabel\@plmylabelfalse |
| 721 |
\newif\if@pldoadjust\@pldoadjustfalse |
| 722 |
% \end{macrocode} |
| 723 |
% |
| 724 |
% \begin{macro}{\@adjust@enum@labelwidth} |
| 725 |
% \changes{v1.3 (1999/01/19)}{1999/01/18}{Depending on option |
| 726 |
% \textsf{increaseonly}, \cs{leftmargin}$\,n$ may only be increased} |
| 727 |
% \changes{v2.1 (2001/09/20)}{2001/09/16}{New macro} |
| 728 |
% \changes{v2.3 (2002/03/10)}{2002/03/07}{Use new flags} |
| 729 |
% \changes{v2.4 (2013/06/09)}{2013/06/09}{Allow arbitrary widest label} |
| 730 |
% For the enumerated environments, the counter is first set by default |
| 731 |
% to 7 so that we get the width of `vii' if Roman numbering is in |
| 732 |
% force. However, this 7 can be replaced by an arbitrary number as an |
| 733 |
% option if this is not large enough. |
| 734 |
% \begin{macrocode} |
| 735 |
\def\@adjust@enum@labelwidth{% |
| 736 |
\if@plneveradjust\else |
| 737 |
\if@plalwaysadjust\@pldoadjusttrue\else |
| 738 |
\if@plmylabel\@pldoadjusttrue\fi |
| 739 |
\fi |
| 740 |
\fi |
| 741 |
\if@pldoadjust |
| 742 |
\setcounter{\@enumctr}{\@enum@widestlabel}% |
| 743 |
\settowidth{\@tempdima}{% |
| 744 |
\csname label\@enumctr\endcsname\hspace{\labelsep}}% |
| 745 |
% \end{macrocode} |
| 746 |
% \changes{v2.3 (2002/03/10)}{2002/03/10}{Use \cs{@listdepth} for $n$ in |
| 747 |
% \cs{leftmargin}$\,n$} |
| 748 |
% The \cs{leftmargin}$\,n$ has to be adjusted (where $n$ is \cs{@listdepth}) |
| 749 |
% but we first have to increase \cs{@listdepth} by one since the list has not |
| 750 |
% yet started. This is reset right afterwards. |
| 751 |
% \begin{macrocode} |
| 752 |
\advance\@listdepth by 1\relax |
| 753 |
\if@plneverdecrease |
| 754 |
\ifdim\@tempdima > |
| 755 |
\csname leftmargin\romannumeral\@listdepth\endcsname |
| 756 |
\csname leftmargin\romannumeral\@listdepth\endcsname |
| 757 |
\@tempdima |
| 758 |
\fi |
| 759 |
\else |
| 760 |
\csname leftmargin\romannumeral\@listdepth\endcsname |
| 761 |
\@tempdima |
| 762 |
\fi |
| 763 |
\advance\@listdepth by -1\relax |
| 764 |
\fi |
| 765 |
\@pldoadjustfalse |
| 766 |
\@plmylabelfalse} |
| 767 |
% \end{macrocode} |
| 768 |
% \end{macro} |
| 769 |
% \begin{macro}{\@adjust@item@labelwidth} |
| 770 |
% \changes{v1.3 (1999/01/19)}{1999/01/18}{\cs{leftmargin}$\,n$ adapted |
| 771 |
% according to the width of the symbol} |
| 772 |
% \changes{v1.3 (1999/01/19)}{1999/01/18}{Depending on option |
| 773 |
% \textsf{increaseonly}, \cs{leftmargin}$\,n$ may only be increased} |
| 774 |
% \changes{v2.1 (2001/09/20)}{2001/09/16}{New macro} |
| 775 |
% \changes{v2.3 (2002/03/10)}{2002/03/07}{Use new flags} |
| 776 |
% For itemized labels, no counter needs to be set. The label is hidden in a |
| 777 |
% macro the name of which is stored in \cs{@itemitem}. |
| 778 |
% \begin{macrocode} |
| 779 |
\def\@adjust@item@labelwidth{% |
| 780 |
\if@plneveradjust\else |
| 781 |
\if@plalwaysadjust\@pldoadjusttrue\else |
| 782 |
\if@plmylabel\@pldoadjusttrue\fi |
| 783 |
\fi |
| 784 |
\fi |
| 785 |
\if@pldoadjust |
| 786 |
\settowidth{\@tempdima}{% |
| 787 |
\csname\@itemitem\endcsname\hspace{\labelsep}}% |
| 788 |
% \end{macrocode} |
| 789 |
% \changes{v2.3 (2002/03/10)}{2002/03/10}{Use \cs{@listdepth} for $n$ in |
| 790 |
% \cs{leftmargin}$\,n$} |
| 791 |
% The \cs{leftmargin}$\,n$ has to be adjusted (where $n$ is \cs{@listdepth}) |
| 792 |
% but we first have to increase \cs{@listdepth} by one since the list has not |
| 793 |
% yet started. This is reset right afterwards. |
| 794 |
% \begin{macrocode} |
| 795 |
\advance\@listdepth by 1\relax |
| 796 |
\if@plneverdecrease |
| 797 |
\ifdim\@tempdima > |
| 798 |
\csname leftmargin\romannumeral\@listdepth\endcsname |
| 799 |
\csname leftmargin\romannumeral\@listdepth\endcsname |
| 800 |
\@tempdima |
| 801 |
\fi |
| 802 |
\else |
| 803 |
\csname leftmargin\romannumeral\@listdepth\endcsname |
| 804 |
\@tempdima |
| 805 |
\fi |
| 806 |
\advance\@listdepth by -1\relax |
| 807 |
\fi |
| 808 |
\@pldoadjustfalse |
| 809 |
\@plmylabelfalse} |
| 810 |
% \end{macrocode} |
| 811 |
% \end{macro} |
| 812 |
% |
| 813 |
% \subsection{Label of Enumerated Environments} |
| 814 |
% |
| 815 |
% \changes{v1.2 (1999/01/10)}{1999/01/07}{Added optional argument to all |
| 816 |
% enumerated environments} |
| 817 |
% It follows all the stuff for the optional argument of the enumerated |
| 818 |
% environments. The code and most of its documentation is basically |
| 819 |
% copied from David Carlisle's \package{enumerate} package. |
| 820 |
% |
| 821 |
% \begin{macro}{\pl@lab} |
| 822 |
% First we define an internal token register which is used to build up |
| 823 |
% the label command from the optional argument. |
| 824 |
% \begin{macrocode} |
| 825 |
\newtoks\pl@lab |
| 826 |
% \end{macrocode} |
| 827 |
% \end{macro} |
| 828 |
% \begin{macro}{\pl@qmark} |
| 829 |
% This just expands to a `?'. \cs{ref} will produce this, if no counter |
| 830 |
% is printed. |
| 831 |
% \begin{macrocode} |
| 832 |
\def\pl@qmark{?} |
| 833 |
% \end{macrocode} |
| 834 |
% \end{macro} |
| 835 |
% The next four macros build up the command that will print the |
| 836 |
% label. They each gobble one token or group from the optional argument |
| 837 |
% and add corresponding tokens to the register |\pl@lab|. They each end |
| 838 |
% with a call to |\pl@loop|, which starts the processing of the next |
| 839 |
% token. |
| 840 |
% \begin{macro}{\pl@label} |
| 841 |
% \changes{v1.8 (1999/04/29)}{1999/04/28}{Count the number of tokens} |
| 842 |
% Add the counter to the label. Argument |#2| will be one of the `special' |
| 843 |
% tokens |A a I i 1|, and is thrown away. |#1| will be a command |
| 844 |
% like \cs{Roman}. In every call \cs{@tempcnta} is increased, so we can |
| 845 |
% check at the end that exactly one counter was defined. |
| 846 |
% \begin{macrocode} |
| 847 |
\def\pl@label#1#2{% |
| 848 |
\edef\pl@the{\noexpand#1{\@enumctr}}% |
| 849 |
\pl@lab\expandafter{\the\pl@lab\csname the\@enumctr\endcsname}% |
| 850 |
\advance\@tempcnta1 |
| 851 |
\pl@loop} |
| 852 |
% \end{macrocode} |
| 853 |
% \end{macro} |
| 854 |
% \begin{macro}{\pl@space} |
| 855 |
% \begin{macro}{\pl@sp@ce} |
| 856 |
% Add a space to the label. The tricky bit is to gobble the space token, |
| 857 |
% as you can not do this with a macro argument. |
| 858 |
% \begin{macrocode} |
| 859 |
\def\pl@space{\afterassignment\pl@sp@ce\let\@tempa= } |
| 860 |
\def\pl@sp@ce{\pl@lab\expandafter{\the\pl@lab\space}\pl@loop} |
| 861 |
% \end{macrocode} |
| 862 |
% \end{macro} |
| 863 |
% \end{macro} |
| 864 |
% \begin{macro}{\pl@group} |
| 865 |
% Add a |{ }| group to the label. |
| 866 |
% \begin{macrocode} |
| 867 |
\def\pl@group#1{\pl@lab\expandafter{\the\pl@lab{#1}}\pl@loop} |
| 868 |
% \end{macrocode} |
| 869 |
% \end{macro} |
| 870 |
% \begin{macro}{\pl@other} |
| 871 |
% Add anything else to the label. |
| 872 |
% \begin{macrocode} |
| 873 |
\def\pl@other#1{\pl@lab\expandafter{\the\pl@lab#1}\pl@loop} |
| 874 |
% \end{macrocode} |
| 875 |
% \end{macro} |
| 876 |
% \begin{macro}{\pl@loop} |
| 877 |
% \begin{macro}{\pl@loop@} |
| 878 |
% The body of the main loop. |
| 879 |
% Eating tokens this way instead of using |\@tfor| lets you see |
| 880 |
% spaces and \emph{all} braces. |\@tfor| would treat |a| and |
| 881 |
% |{a}| as special, but not |{{a}}|. |
| 882 |
% \begin{macrocode} |
| 883 |
\def\pl@loop{\futurelet\pl@temp\pl@loop@} |
| 884 |
\def\pl@loop@{% |
| 885 |
\ifx A\pl@temp \def\@tempa{\pl@label\Alph }\else |
| 886 |
\ifx a\pl@temp \def\@tempa{\pl@label\alph }\else |
| 887 |
\ifx i\pl@temp \def\@tempa{\pl@label\roman }\else |
| 888 |
\ifx I\pl@temp \def\@tempa{\pl@label\Roman }\else |
| 889 |
\ifx 1\pl@temp \def\@tempa{\pl@label\arabic}\else |
| 890 |
\ifx \@sptoken\pl@temp \let\@tempa\pl@space \else |
| 891 |
\ifx \bgroup\pl@temp \let\@tempa\pl@group \else |
| 892 |
\ifx \@@@\pl@temp \let\@tempa\@gobble \else |
| 893 |
\let\@tempa\pl@other |
| 894 |
% \end{macrocode} |
| 895 |
% Hook for possible extensions. |
| 896 |
% \begin{macrocode} |
| 897 |
\pl@hook |
| 898 |
\fi\fi\fi\fi\fi\fi\fi\fi |
| 899 |
% \end{macrocode} |
| 900 |
% \end{macro} |
| 901 |
% Process the current token, then look at the next. |
| 902 |
% \begin{macrocode} |
| 903 |
\@tempa} |
| 904 |
% \end{macrocode} |
| 905 |
% \end{macro} |
| 906 |
% \begin{macro}{\pl@hook} |
| 907 |
% \changes{v1.6 (1999/03/27)}{1999/03/26}{Added extension hook} |
| 908 |
% Hook for possible extensions. |
| 909 |
% Some packages may want to extend the number of special characters |
| 910 |
% that are associated with counter representations. You can use |
| 911 |
% e.\,g.~Greek or Russian characters. Here is an example of a footnote |
| 912 |
% symbol counter, triggered by |*|. |
| 913 |
% |
| 914 |
% To enable a new counter type based on a letter, you just need |
| 915 |
% to add a new |\ifx| clause similar to the code above. To make |
| 916 |
% |*| trigger footnote symbol counting do the following. |
| 917 |
% |
| 918 |
% Initialize the hook, in case the package is loaded before |
| 919 |
% \package{paralist}.\\ |
| 920 |
% \tab|\providecommand\pl@hook{}| |
| 921 |
% |
| 922 |
% Add to the hook a new |\ifx| clause that associates |*| with the |
| 923 |
% |\fnsymbol| counter command. |
| 924 |
%\begin{verbatim} |
| 925 |
% \g@addto@macro\pl@hook{% |
| 926 |
% \ifx *\pl@temp |
| 927 |
% \def\@tempa{\pl@label\fnsymbol}% |
| 928 |
% \fi} |
| 929 |
%\end{verbatim} |
| 930 |
% This code sequence should work whether it is loaded before or after |
| 931 |
% the \package{paralist} package. Any number of new counter types may be added |
| 932 |
% in this way. |
| 933 |
% |
| 934 |
% At this point we just need to initialize the hook, taking care not |
| 935 |
% to overwrite any definitions another package may already have added. |
| 936 |
% \begin{macrocode} |
| 937 |
\providecommand\pl@hook{} |
| 938 |
% \end{macrocode} |
| 939 |
% \end{macro} |
| 940 |
% \begin{macro}{\@enumlabel@} |
| 941 |
% \changes{v1.8 (1999/04/29)}{1999/04/28}{Use token counter and take care |
| 942 |
% of extra bracket} |
| 943 |
% \changes{v2.1 (2001/09/20)}{2001/09/17}{Adjustment of label width moved to |
| 944 |
% a separate macro} |
| 945 |
% \changes{v2.3 (2002/03/10)}{2002/03/07}{Set new flags} |
| 946 |
% The following macro handles the optional argument of an enumerated |
| 947 |
% environment. Its first argument is the macro that should be called |
| 948 |
% after \cs{@enumlabel@} has done the job, the second one is the |
| 949 |
% optional argument from the calling environment. |
| 950 |
% \begin{macrocode} |
| 951 |
\def\@enumlabel@#1[#2]{% |
| 952 |
% \end{macrocode} |
| 953 |
% The flag is set that the environment redefines its label. |
| 954 |
% \begin{macrocode} |
| 955 |
\@plmylabeltrue |
| 956 |
% \end{macrocode} |
| 957 |
% We initialize the number of counter-defining tokens to 0. |
| 958 |
% Then \cs{pl@lab} and \cs{pl@the} are initialized. Later, \cs{pl@the} |
| 959 |
% will be used to define \cs{theenum}\,$n$. |
| 960 |
% \begin{macrocode} |
| 961 |
\@tempcnta0 |
| 962 |
\pl@lab{}% |
| 963 |
\let\pl@the\pl@qmark |
| 964 |
% \end{macrocode} |
| 965 |
% Now we analyze the second argument using a loop. |
| 966 |
% As we will explain in the definition of |asparaenum|, we had to add an |
| 967 |
% extra bracket |[| to the second argument, which we have to gobble |
| 968 |
% before we start processing it. The macro |
| 969 |
% \cs{@@@} is never expanded (or even defined), it is just used to detect |
| 970 |
% the end of the token list. |
| 971 |
% \begin{macrocode} |
| 972 |
\expandafter\pl@loop\@gobble#2\@@@ |
| 973 |
% \end{macrocode} |
| 974 |
% If there was no special token or several special tokens we issue a |
| 975 |
% warning. |
| 976 |
% \begin{macrocode} |
| 977 |
\ifnum\@tempcnta=1\else |
| 978 |
\PackageWarning{paralist}{Incorrect label; no or multiple |
| 979 |
counters.\MessageBreak The label is: \@gobble#2}% |
| 980 |
\fi |
| 981 |
% \end{macrocode} |
| 982 |
% \changes{v2.5 (2015/12/30)}{2015/12/30}{Add \%\ in last line to avoid excess space} |
| 983 |
% Define |\labelenum|$\,n$ and |\theenum|$\,n$. And here we define a |
| 984 |
% macro |\@enumwidestlabel@| so that if the document has |[|$n$|]| after |
| 985 |
% the beginning of the enumerate environment, the label width will be |
| 986 |
% determined by typesetting $n$ instead of the default 7. |
| 987 |
% \begin{macrocode} |
| 988 |
\expandafter\edef\csname label\@enumctr\endcsname{\the\pl@lab}% |
| 989 |
\expandafter\let\csname the\@enumctr\endcsname\pl@the |
| 990 |
\@ifnextchar[{\@enumwidestlabel@{#1}}{\@enumwidestlabel@{#1}[7]}% |
| 991 |
} |
| 992 |
\def\@enumwidestlabel@#1[#2]{% |
| 993 |
\def\@enum@widestlabel{#2}% |
| 994 |
% \end{macrocode} |
| 995 |
% Finally call the macro that finishes the \cs{begin} part of the |
| 996 |
% calling environment. |
| 997 |
% \begin{macrocode} |
| 998 |
#1} |
| 999 |
% \end{macrocode} |
| 1000 |
% \end{macro} |
| 1001 |
% |
| 1002 |
% \subsection{Label of the Itemized Environment} |
| 1003 |
% |
| 1004 |
% \begin{macro}{\@itemlabel@} |
| 1005 |
% \changes{v2.1 (2001/09/20)}{2001/09/17}{Adjustment of label width moved to |
| 1006 |
% a separate macro} |
| 1007 |
% \changes{v2.3 (2002/03/10)}{2002/03/07}{Set new flags} |
| 1008 |
% The handling of the optional argument of itemized environments is a lot |
| 1009 |
% easier. |
| 1010 |
% \begin{macrocode} |
| 1011 |
\def\@itemlabel@#1[#2]{% |
| 1012 |
\@plmylabeltrue |
| 1013 |
\def\pl@itemitem{#2}% |
| 1014 |
\def\@itemitem{pl@itemitem}% |
| 1015 |
#1} |
| 1016 |
% \end{macrocode} |
| 1017 |
% \end{macro} |
| 1018 |
% |
| 1019 |
% \subsection{Enumerated Environments} |
| 1020 |
% |
| 1021 |
% \begin{environment}{asparaenum} |
| 1022 |
% \changes{v1.2 (1999/01/10)}{1999/01/07}{Rewritten} |
| 1023 |
% \changes{v1.8 (1999/04/29)}{1999/04/28}{Add extra bracket to optional |
| 1024 |
% argument} |
| 1025 |
% The first environment formats the enumerated items as paragraphs. |
| 1026 |
% Most of the skips are set to zero, the items are indented as if |
| 1027 |
% they were paragraphs and |\makelabel| is redefined so that it |
| 1028 |
% just prints the counter. |
| 1029 |
% \begin{macrocode} |
| 1030 |
\def\asparaenum{% |
| 1031 |
\ifnum\@enumdepth>\thr@@ |
| 1032 |
\@toodeep |
| 1033 |
\else |
| 1034 |
\advance\@enumdepth\@ne |
| 1035 |
\edef\@enumctr{enum\romannumeral\the\@enumdepth}% |
| 1036 |
\fi |
| 1037 |
% \end{macrocode} |
| 1038 |
% In the following line the second bracket |[| seems to be superfluous. |
| 1039 |
% Here is why we need it. If \TeX\ finds an argument in curly braces |
| 1040 |
% then it strips of the braces before handing the argument to the |
| 1041 |
% macro \cs{@enumlabel@}. So the optional argument |[{\bfseries a}]| |
| 1042 |
% would be accepted, although the counter is in a group. By adding |
| 1043 |
% the bracket to the argument we will never have braces around the |
| 1044 |
% whole argument. In the macro \cs{@enumlabel@} the bracket is |
| 1045 |
% gobbled before the processing of the argument starts. |
| 1046 |
% \begin{macrocode} |
| 1047 |
\@ifnextchar[{\@enumlabel@{\@asparaenum@}[}{\@asparaenum@}} |
| 1048 |
\def\@asparaenum@{% |
| 1049 |
\expandafter\list\csname label\@enumctr\endcsname{% |
| 1050 |
\usecounter{\@enumctr}% |
| 1051 |
\labelwidth\z@ |
| 1052 |
\labelsep.5em |
| 1053 |
\leftmargin\z@ |
| 1054 |
\parsep\parskip |
| 1055 |
\itemsep\z@ |
| 1056 |
\topsep\z@ |
| 1057 |
\partopsep\parskip |
| 1058 |
\itemindent\parindent |
| 1059 |
\advance\itemindent\labelsep |
| 1060 |
\def\makelabel##1{##1}}} |
| 1061 |
\let\endasparaenum\endlist |
| 1062 |
% \end{macrocode} |
| 1063 |
% \end{environment} |
| 1064 |
% \begin{environment}{inparaenum} |
| 1065 |
% \changes{v1.0a (1998/10/13)}{}{Corrected definition of \cs{theinparaenum}} |
| 1066 |
% \changes{v1.1 (1998/10/18)}{}{Make space after number non-breaking} |
| 1067 |
% \changes{v1.2 (1999/01/10)}{1999/01/07}{Rewritten} |
| 1068 |
% \changes{v1.8 (1999/04/29)}{1999/04/28}{Add extra bracket to optional |
| 1069 |
% argument} |
| 1070 |
% \changes{v2.1 (2001/09/20)}{2001/09/16}{Define \cs{makelabel}} |
| 1071 |
% Now the enumerated environment within a paragraph. Since it is |
| 1072 |
% not really a list we have to redefine |\@item|. |
| 1073 |
% \begin{macrocode} |
| 1074 |
\def\inparaenum{% |
| 1075 |
\ifnum\@enumdepth>\thr@@ |
| 1076 |
\@toodeep |
| 1077 |
\else |
| 1078 |
\advance\@enumdepth\@ne |
| 1079 |
\edef\@enumctr{enum\romannumeral\the\@enumdepth}% |
| 1080 |
\fi |
| 1081 |
\@ifnextchar[{\@enumlabel@{\@inparaenum@}[}{\@inparaenum@}} |
| 1082 |
\def\@inparaenum@{% |
| 1083 |
\usecounter{\@enumctr}% |
| 1084 |
\def\@itemlabel{\csname label\@enumctr\endcsname}% |
| 1085 |
\let\@item\pl@item |
| 1086 |
\def\makelabel##1{##1}% |
| 1087 |
\ignorespaces} |
| 1088 |
\let\endinparaenum\ignorespacesafterend |
| 1089 |
% \end{macrocode} |
| 1090 |
% \end{environment} |
| 1091 |
% \begin{environment}{compactenum} |
| 1092 |
% \changes{v1.1 (1998/10/18)}{}{Environment added} |
| 1093 |
% \changes{v1.2 (1999/01/10)}{1999/01/07}{Rewritten} |
| 1094 |
% \changes{v1.8 (1999/04/29)}{1999/04/28}{Add extra bracket to optional |
| 1095 |
% argument} |
| 1096 |
% \changes{v2.7 (2017/01/22)}{2017/01/22}{\cs{@enum@widestlabel@} must |
| 1097 |
% be initialized in case \cs{@enumlabel@} is not called} |
| 1098 |
% For the |compactenum| environment all vertical skips have to |
| 1099 |
% be set to the \cs{pl...} values. |
| 1100 |
% \begin{macrocode} |
| 1101 |
\def\compactenum{% |
| 1102 |
\ifnum\@enumdepth>\thr@@ |
| 1103 |
\@toodeep |
| 1104 |
\else |
| 1105 |
\advance\@enumdepth\@ne |
| 1106 |
\edef\@enumctr{enum\romannumeral\the\@enumdepth}% |
| 1107 |
\fi |
| 1108 |
\def\@enum@widestlabel{7}% |
| 1109 |
\@ifnextchar[{\@enumlabel@{\@compactenum@}[}{\@compactenum@}} |
| 1110 |
% \end{macrocode} |
| 1111 |
% \changes{v2.1 (2001/09/20)}{2001/09/17}{Adjustment of label width done in |
| 1112 |
% \cs{@compactenum@}} |
| 1113 |
% \changes{v2.1 (2001/09/20)}{2001/09/17}{Set label width according to left |
| 1114 |
% margin} |
| 1115 |
% \changes{v2.1 (2001/09/20)}{2001/09/17}{Use \cs{enumlabel}} |
| 1116 |
% \changes{v2.3a (2002/03/10)}{2002/03/10}{Use \cs{@listdepth} for $n$ in |
| 1117 |
% \cs{leftmargin}$\,n$} |
| 1118 |
% The width of the label is adjusted before starting the list if necessary. |
| 1119 |
% \begin{macrocode} |
| 1120 |
\def\@compactenum@{% |
| 1121 |
\@adjust@enum@labelwidth |
| 1122 |
\expandafter\list\csname label\@enumctr\endcsname{% |
| 1123 |
\usecounter{\@enumctr}% |
| 1124 |
\parsep\plparsep |
| 1125 |
\itemsep\plitemsep |
| 1126 |
\topsep\pltopsep |
| 1127 |
\partopsep\plpartopsep |
| 1128 |
\labelwidth |
| 1129 |
\csname leftmargin\romannumeral\@listdepth\endcsname |
| 1130 |
\advance\labelwidth-\labelsep |
| 1131 |
\let\makelabel\enumlabel}} |
| 1132 |
\let\endcompactenum\endlist |
| 1133 |
% \end{macrocode} |
| 1134 |
% \end{environment} |
| 1135 |
% \begin{environment}{enumerate} |
| 1136 |
% \changes{v1.2 (1999/01/10)}{1999/01/07}{Added} |
| 1137 |
% \changes{v1.8 (1999/04/29)}{1999/04/28}{Add extra bracket to optional |
| 1138 |
% argument} |
| 1139 |
% \changes{v2.7 (2017/01/22)}{2017/01/22}{\cs{@enum@widestlabel@} must |
| 1140 |
% be initialized in case \cs{@enumlabel@} is not called} |
| 1141 |
% If the user has requested it, we redefine the |enumerate| environment. |
| 1142 |
% \begin{macrocode} |
| 1143 |
\if@plnewenum |
| 1144 |
\def\enumerate{% |
| 1145 |
\ifnum \@enumdepth >\thr@@ |
| 1146 |
\@toodeep |
| 1147 |
\else |
| 1148 |
\advance\@enumdepth \@ne |
| 1149 |
\edef\@enumctr{enum\romannumeral\the\@enumdepth}% |
| 1150 |
\fi |
| 1151 |
\def\@enum@widestlabel{7}% |
| 1152 |
\@ifnextchar[{\@enumlabel@{\@enumerate@}[}{\@enumerate@}} |
| 1153 |
% \end{macrocode} |
| 1154 |
% \changes{v2.1 (2001/09/20)}{2001/09/17}{Adjustment of label width done in |
| 1155 |
% \cs{@enumerate@}} |
| 1156 |
% \changes{v2.1 (2001/09/20)}{2001/09/17}{Set label width according to left |
| 1157 |
% margin} |
| 1158 |
% \changes{v2.1 (2001/09/20)}{2001/09/17}{Use \cs{enumlabel}} |
| 1159 |
% \changes{v2.3a (2002/03/10)}{2002/03/10}{Use \cs{@listdepth} for $n$ in |
| 1160 |
% \cs{leftmargin}$\,n$} |
| 1161 |
% The width of the label is adjusted before starting the list if necessary. |
| 1162 |
% \begin{macrocode} |
| 1163 |
\def\@enumerate@{% |
| 1164 |
\@adjust@enum@labelwidth |
| 1165 |
\expandafter\list\csname label\@enumctr\endcsname{% |
| 1166 |
\usecounter{\@enumctr}% |
| 1167 |
\labelwidth |
| 1168 |
\csname leftmargin\romannumeral\@listdepth\endcsname |
| 1169 |
\advance\labelwidth-\labelsep |
| 1170 |
\let\makelabel\enumlabel}} |
| 1171 |
\fi |
| 1172 |
% \end{macrocode} |
| 1173 |
% \end{environment} |
| 1174 |
% |
| 1175 |
% \subsection{Itemized Environments} |
| 1176 |
% |
| 1177 |
% \begin{environment}{asparaitem} |
| 1178 |
% \changes{v1.2 (1999/01/10)}{1999/01/07}{Rewritten} |
| 1179 |
% This is pretty much the same as |asparaenum|. We just don't need |
| 1180 |
% a counter. |
| 1181 |
% \begin{macrocode} |
| 1182 |
\def\asparaitem{% |
| 1183 |
\ifnum\@itemdepth>\thr@@ |
| 1184 |
\@toodeep |
| 1185 |
\else |
| 1186 |
\advance\@itemdepth\@ne |
| 1187 |
\edef\@itemitem{labelitem\romannumeral\the\@itemdepth}% |
| 1188 |
\fi |
| 1189 |
\@ifnextchar[{\@itemlabel@{\@asparaitem@}}{\@asparaitem@}} |
| 1190 |
\def\@asparaitem@{% |
| 1191 |
\expandafter\list\csname\@itemitem\endcsname{% |
| 1192 |
\labelwidth\z@ |
| 1193 |
\labelsep.5em |
| 1194 |
\leftmargin\z@ |
| 1195 |
\parsep\parskip |
| 1196 |
\itemsep\z@ |
| 1197 |
\topsep\z@ |
| 1198 |
\partopsep\parskip |
| 1199 |
\itemindent\parindent |
| 1200 |
\advance\itemindent\labelsep |
| 1201 |
\def\makelabel##1{##1}}} |
| 1202 |
\let\endasparaitem\endlist |
| 1203 |
% \end{macrocode} |
| 1204 |
% \end{environment} |
| 1205 |
% \begin{environment}{inparaitem} |
| 1206 |
% \changes{v1.1 (1998/10/18)}{}{Make space after symbol non-breaking} |
| 1207 |
% \changes{v1.2 (1999/01/10)}{1999/01/07}{Rewritten} |
| 1208 |
% \changes{v2.1 (2001/09/20)}{2001/09/16}{Define \cs{makelabel}} |
| 1209 |
% \changes{v2.6 (2016/08/07)}{2016/08/07}{Insert \cs{@nmbrlistfalse} to avoid increasing the enum counter} |
| 1210 |
% Again the same as |inparaenum| without the counter stuff but with an |
| 1211 |
% optional argument. |
| 1212 |
% \begin{macrocode} |
| 1213 |
\def\inparaitem{% |
| 1214 |
\@nmbrlistfalse |
| 1215 |
\ifnum\@itemdepth>\thr@@ |
| 1216 |
\@toodeep |
| 1217 |
\else |
| 1218 |
\advance\@itemdepth\@ne |
| 1219 |
\edef\@itemitem{labelitem\romannumeral\the\@itemdepth}% |
| 1220 |
\fi |
| 1221 |
\@ifnextchar[{\@itemlabel@{\@inparaitem@}}{\@inparaitem@}} |
| 1222 |
\def\@inparaitem@{% |
| 1223 |
\def\@itemlabel{\csname\@itemitem\endcsname}% |
| 1224 |
\let\@item\pl@item |
| 1225 |
\def\makelabel##1{##1}% |
| 1226 |
\ignorespaces} |
| 1227 |
\let\endinparaitem\ignorespacesafterend |
| 1228 |
% \end{macrocode} |
| 1229 |
% \end{environment} |
| 1230 |
% \begin{environment}{compactitem} |
| 1231 |
% \changes{v1.1 (1998/10/18)}{}{Environment added} |
| 1232 |
% \changes{v1.2 (1999/01/10)}{1999/01/07}{Rewritten} |
| 1233 |
% The |compactitem| environment is basically the same as the \LaTeX{} |
| 1234 |
% original. All the vertical skips are set to the \cs{pl...} values. |
| 1235 |
% \begin{macrocode} |
| 1236 |
\def\compactitem{% |
| 1237 |
\ifnum\@itemdepth>\thr@@ |
| 1238 |
\@toodeep |
| 1239 |
\else |
| 1240 |
\advance\@itemdepth\@ne |
| 1241 |
\edef\@itemitem{labelitem\romannumeral\the\@itemdepth}% |
| 1242 |
\fi |
| 1243 |
\@ifnextchar[{\@itemlabel@{\@compactitem@}}{\@compactitem@}} |
| 1244 |
% \end{macrocode} |
| 1245 |
% \changes{v2.1 (2001/09/20)}{2001/09/17}{Adjustment of label width done in |
| 1246 |
% \cs{@compactitem@}} |
| 1247 |
% \changes{v2.1 (2001/09/20)}{2001/09/17}{Set label width according to left |
| 1248 |
% margin} |
| 1249 |
% \changes{v2.1 (2001/09/20)}{2001/09/17}{Use \cs{itemlabel}} |
| 1250 |
% \changes{v2.3a (2002/03/10)}{2002/03/10}{Use \cs{@listdepth} for $n$ in |
| 1251 |
% \cs{leftmargin}$\,n$} |
| 1252 |
% The width of the label is adjusted before starting the list if necessary. |
| 1253 |
% \begin{macrocode} |
| 1254 |
\def\@compactitem@{% |
| 1255 |
\@adjust@item@labelwidth |
| 1256 |
\expandafter\list\csname\@itemitem\endcsname{% |
| 1257 |
\parsep\plparsep |
| 1258 |
\itemsep\plitemsep |
| 1259 |
\topsep\pltopsep |
| 1260 |
\partopsep\plpartopsep |
| 1261 |
\labelwidth |
| 1262 |
\csname leftmargin\romannumeral\@listdepth\endcsname |
| 1263 |
\advance\labelwidth-\labelsep |
| 1264 |
\let\makelabel\itemlabel}} |
| 1265 |
\let\endcompactitem\endlist |
| 1266 |
% \end{macrocode} |
| 1267 |
% \end{environment} |
| 1268 |
% \begin{environment}{itemize} |
| 1269 |
% \changes{v1.2 (1999/01/10)}{1999/01/07}{Added} |
| 1270 |
% If the user has requested it, we redefine the |itemize| environment. |
| 1271 |
% \begin{macrocode} |
| 1272 |
\if@plnewitem |
| 1273 |
\def\itemize{% |
| 1274 |
\ifnum \@itemdepth >\thr@@ |
| 1275 |
\@toodeep |
| 1276 |
\else |
| 1277 |
\advance\@itemdepth\@ne |
| 1278 |
\edef\@itemitem{labelitem\romannumeral\the\@itemdepth}% |
| 1279 |
\fi |
| 1280 |
\@ifnextchar[{\@itemlabel@{\@itemize@}}{\@itemize@}} |
| 1281 |
% \end{macrocode} |
| 1282 |
% \changes{v2.1 (2001/09/20)}{2001/09/17}{Adjustment of label width done in |
| 1283 |
% \cs{@itemize@}} |
| 1284 |
% \changes{v2.1 (2001/09/20)}{2001/09/17}{Set label width according to left |
| 1285 |
% margin} |
| 1286 |
% \changes{v2.1 (2001/09/20)}{2001/09/17}{Use \cs{itemlabel}} |
| 1287 |
% \changes{v2.3a (2002/03/10)}{2002/03/10}{Use \cs{@listdepth} for $n$ in |
| 1288 |
% \cs{leftmargin}$\,n$} |
| 1289 |
% The width of the label is adjusted before starting the list if necessary. |
| 1290 |
% \begin{macrocode} |
| 1291 |
\def\@itemize@{% |
| 1292 |
\@adjust@item@labelwidth |
| 1293 |
\expandafter\list\csname\@itemitem\endcsname{% |
| 1294 |
\labelwidth |
| 1295 |
\csname leftmargin\romannumeral\@listdepth\endcsname |
| 1296 |
\advance\labelwidth-\labelsep |
| 1297 |
\let\makelabel\itemlabel}} |
| 1298 |
\fi |
| 1299 |
% \end{macrocode} |
| 1300 |
% \end{environment} |
| 1301 |
% |
| 1302 |
% \subsection{Descriptive Environments} |
| 1303 |
% |
| 1304 |
% \begin{environment}{asparadesc} |
| 1305 |
% \changes{v2.1 (2001/09/20)}{2001/09/16}{New environment} |
| 1306 |
% A bit easier than |asparaenum| since the label handling is easier. |
| 1307 |
% \begin{macrocode} |
| 1308 |
\def\asparadesc{% |
| 1309 |
\list{}{% |
| 1310 |
\labelwidth\z@ |
| 1311 |
\labelsep.5em |
| 1312 |
\leftmargin\z@ |
| 1313 |
\parsep\parskip |
| 1314 |
\itemsep\z@ |
| 1315 |
\topsep\z@ |
| 1316 |
\partopsep\parskip |
| 1317 |
\itemindent\parindent |
| 1318 |
\advance\itemindent\labelsep |
| 1319 |
\let\makelabel\paradescriptionlabel}} |
| 1320 |
\let\endasparadesc\endlist |
| 1321 |
% \end{macrocode} |
| 1322 |
% \end{environment} |
| 1323 |
% \begin{environment}{inparadesc} |
| 1324 |
% \changes{v2.1 (2001/09/20)}{2001/09/16}{New environment} |
| 1325 |
% \changes{v2.6 (2016/08/07)}{2016/08/07}{Insert \cs{@nmbrlistfalse} to avoid increasing the enum counter} |
| 1326 |
% Again a bit easier than |inparaenum| since the label handling is easier. |
| 1327 |
% \begin{macrocode} |
| 1328 |
\def\inparadesc{% |
| 1329 |
\@nmbrlistfalse |
| 1330 |
\let\@itemlabel\@empty |
| 1331 |
\let\@item\pl@item |
| 1332 |
\let\makelabel\paradescriptionlabel |
| 1333 |
\ignorespaces} |
| 1334 |
\let\endinparadesc\ignorespacesafterend |
| 1335 |
% \end{macrocode} |
| 1336 |
% \end{environment} |
| 1337 |
% \begin{environment}{compactdesc} |
| 1338 |
% \changes{v1.1 (1998/10/18)}{}{Environment added} |
| 1339 |
% \changes{v1.2 (1999/01/10)}{1999/01/07}{Rewritten} |
| 1340 |
% The |compactdesc| environment is copied from |article.cls| with the skips |
| 1341 |
% set to the \cs{pl...} skips. |
| 1342 |
% \begin{macrocode} |
| 1343 |
\def\compactdesc{% |
| 1344 |
\list{}{% |
| 1345 |
\parsep\plparsep |
| 1346 |
\itemsep\plitemsep |
| 1347 |
\topsep\pltopsep |
| 1348 |
\partopsep\plpartopsep |
| 1349 |
\labelwidth\z@ |
| 1350 |
\itemindent-\leftmargin |
| 1351 |
\let\makelabel\descriptionlabel}} |
| 1352 |
\let\endcompactdesc\endlist |
| 1353 |
% \end{macrocode} |
| 1354 |
% \end{environment} |
| 1355 |
% |
| 1356 |
% \subsection{Blank Environments} |
| 1357 |
% |
| 1358 |
% \begin{environment}{asparablank} |
| 1359 |
% \changes{v1.2 (1999/01/10)}{1999/01/07}{Added} |
| 1360 |
% This list formats its entries as if there was no list. Thus no test for |
| 1361 |
% the list depth is performed. To avoid unnecessary white space, \cs{labelsep} |
| 1362 |
% is set to zero. If the optional argument of \cs{item} is used, some |
| 1363 |
% separating space has to inserted ``by hand''. |
| 1364 |
% \begin{macrocode} |
| 1365 |
\if@pldefblank |
| 1366 |
\def\asparablank{% |
| 1367 |
\list{}{% |
| 1368 |
\labelwidth\z@ |
| 1369 |
\labelsep\z@ |
| 1370 |
\leftmargin\z@ |
| 1371 |
\parsep\parskip |
| 1372 |
\itemsep\z@ |
| 1373 |
\topsep\z@ |
| 1374 |
\partopsep\parskip |
| 1375 |
\itemindent\parindent |
| 1376 |
\advance\itemindent\labelsep |
| 1377 |
\def\makelabel##1{##1}}} |
| 1378 |
\let\endasparablank\endlist |
| 1379 |
% \end{macrocode} |
| 1380 |
% \end{environment} |
| 1381 |
% \begin{environment}{inparablank} |
| 1382 |
% \changes{v1.2 (1999/01/10)}{1999/01/07}{Added} |
| 1383 |
% The |inparablank| environment handles the ``white space problem'' |
| 1384 |
% automatically. |
| 1385 |
% \begin{macrocode} |
| 1386 |
\def\inparablank{% |
| 1387 |
\let\@itemlabel\@empty |
| 1388 |
\let\@item\pl@item |
| 1389 |
\ignorespaces} |
| 1390 |
\let\endinparablank\ignorespacesafterend |
| 1391 |
\fi |
| 1392 |
% \end{macrocode} |
| 1393 |
% \end{environment} |
| 1394 |
% |
| 1395 |
% \subsection{Setting Defaults} |
| 1396 |
% |
| 1397 |
% Here are the macros to define the default labels and left margins |
| 1398 |
% for itemized and enumerated environments. |
| 1399 |
% \begin{macro}{\setdefaultitem} |
| 1400 |
% \changes{v2.1 (2001/09/20)}{2001/09/19}{New macro} |
| 1401 |
% The macro for the item labels just redefines \cs{labelitem}$\,n$. |
| 1402 |
% \begin{macrocode} |
| 1403 |
\def\setdefaultitem#1#2#3#4{% |
| 1404 |
\if@empty{#1}{}{\def\labelitemi{#1}}% |
| 1405 |
\if@empty{#2}{}{\def\labelitemii{#2}}% |
| 1406 |
\if@empty{#3}{}{\def\labelitemiii{#3}}% |
| 1407 |
\if@empty{#4}{}{\def\labelitemiv{#4}}} |
| 1408 |
% \end{macrocode} |
| 1409 |
% \end{macro} |
| 1410 |
% \begin{macro}{\defaultitem} |
| 1411 |
% \changes{v1.4 (1999/01/27)}{1999/01/19}{New macro} |
| 1412 |
% \changes{v2.1 (2001/09/20)}{2001/09/17}{Macro deprecated and only kept for |
| 1413 |
% compatibility} |
| 1414 |
% This macro is deprecated and only kept for backward compatibility. |
| 1415 |
% \begin{macrocode} |
| 1416 |
\def\defaultitem{% |
| 1417 |
\PackageWarning{Paralist}{Macro \protect\defaultitem\space |
| 1418 |
deprecated. \MessageBreak Use macro \protect\setdefaultitem |
| 1419 |
\space instead!! \MessageBreak Used} |
| 1420 |
\setdefaultitem} |
| 1421 |
% \end{macrocode} |
| 1422 |
% \end{macro} |
| 1423 |
% \begin{macro}{\setdefaultenum} |
| 1424 |
% \changes{v2.1 (2001/09/20)}{2001/09/19}{New macro} |
| 1425 |
% \changes{v2.3b (2002/03/18)}{2002/03/18}{Fix handling of flags} |
| 1426 |
% The macro to define the enumerated labels uses the same mechanism |
| 1427 |
% as the optional argument of the enumerated environments. First, we set |
| 1428 |
% \cs{@enumctr} to |enum|$\,n$, then \cs{@enumlabel@} is used to format the |
| 1429 |
% counter. As explained above we have to add the extra bracket |[| to avoid |
| 1430 |
% losing braces |{}| around the whole argument. Note that the state of |
| 1431 |
% \cs{if@alwaysadjust} has to be saved and restored. |
| 1432 |
% \begin{macrocode} |
| 1433 |
\newif\if@pltemp |
| 1434 |
\def\setdefaultenum#1#2#3#4{% |
| 1435 |
\if@plneveradjust\@pltemptrue\else\@pltempfalse\fi |
| 1436 |
\@plneveradjusttrue |
| 1437 |
\if@empty{#1}{}{% |
| 1438 |
\def\@enumctr{enumi}% |
| 1439 |
\@enumlabel@{\relax}[[#1]}% |
| 1440 |
\if@empty{#2}{}{% |
| 1441 |
\def\@enumctr{enumii}% |
| 1442 |
\@enumlabel@{\relax}[[#2]}% |
| 1443 |
\if@empty{#3}{}{% |
| 1444 |
\def\@enumctr{enumiii}% |
| 1445 |
\@enumlabel@{\relax}[[#3]}% |
| 1446 |
\if@empty{#4}{}{% |
| 1447 |
\def\@enumctr{enumiv}% |
| 1448 |
\@enumlabel@{\relax}[[#4]}% |
| 1449 |
\if@pltemp\@plneveradjusttrue\else\@plneveradjustfalse\fi |
| 1450 |
\@plmylabelfalse |
| 1451 |
\relax} |
| 1452 |
% \end{macrocode} |
| 1453 |
% \end{macro} |
| 1454 |
% \begin{macro}{\defaultenum} |
| 1455 |
% \changes{v1.4 (1999/01/27)}{1999/01/19}{New macro} |
| 1456 |
% \changes{v1.8 (1999/04/29)}{1999/04/28}{Add extra bracket to argument of |
| 1457 |
% \cs{@enumlabel@}} |
| 1458 |
% \changes{v2.1 (2001/09/20)}{2001/09/17}{Macro deprecated and only kept for |
| 1459 |
% compatibility} |
| 1460 |
% This macro is deprecated and only kept for backward compatibility. |
| 1461 |
% \begin{macrocode} |
| 1462 |
\def\defaultenum{% |
| 1463 |
\PackageWarning{Paralist}{Macro \protect\defaultenum\space |
| 1464 |
deprecated. \MessageBreak Use macro \protect\setdefaultenum |
| 1465 |
\space instead!! \MessageBreak Used} |
| 1466 |
\setdefaultitem} |
| 1467 |
% \end{macrocode} |
| 1468 |
% \end{macro} |
| 1469 |
% \begin{macro}{\setdefaultleftmargin} |
| 1470 |
% \changes{v2.1 (2001/09/20)}{2001/09/17}{New macro} |
| 1471 |
% Finally a macro to define all the left margins for the lists. |
| 1472 |
% \begin{macrocode} |
| 1473 |
\def\setdefaultleftmargin#1#2#3#4#5#6{% |
| 1474 |
\if@empty{#1}{}{\leftmargini#1}% |
| 1475 |
\if@empty{#2}{}{\leftmarginii#2}% |
| 1476 |
\if@empty{#3}{}{\leftmarginiii#3}% |
| 1477 |
\if@empty{#4}{}{\leftmarginiv#4}% |
| 1478 |
\if@empty{#5}{}{\leftmarginv#5}% |
| 1479 |
\if@empty{#6}{}{\leftmarginvi#6}% |
| 1480 |
\relax} |
| 1481 |
% \end{macrocode} |
| 1482 |
% \end{macro} |
| 1483 |
% \begin{macro}{\defaultleftmargin} |
| 1484 |
% \changes{v1.4 (1999/01/27)}{1999/01/19}{New macro} |
| 1485 |
% \changes{v2.1 (2001/09/20)}{2001/09/17}{Macro deprecated and only kept for |
| 1486 |
% compatibility} |
| 1487 |
% This macro is deprecated and only kept for backward compatibility. |
| 1488 |
% \begin{macrocode} |
| 1489 |
\def\defaultleftmargin#1#2#3#4{% |
| 1490 |
\setdefaultleftmargin{#1}{#2}{#3}{#4}{}{}% |
| 1491 |
\PackageWarning{Paralist}{Macro \protect\defaultleftmargin |
| 1492 |
\space deprecated. \MessageBreak Use macro |
| 1493 |
\protect\setdefaultleftmargin\space instead!! |
| 1494 |
\MessageBreak But note that it has six arguments! |
| 1495 |
\MessageBreak Used}} |
| 1496 |
% \end{macrocode} |
| 1497 |
% \end{macro} |
| 1498 |
% |
| 1499 |
% \subsection{Points or no Points?} |
| 1500 |
% |
| 1501 |
% \begin{macro}{\pl@pointxxxenum} |
| 1502 |
% \changes{v2.0a (2001/03/03)}{2001/03/03}{New macro} |
| 1503 |
% We define macros for the options \textsf{pointlessenum} and |
| 1504 |
% \textsf{pointedenum}. First the common part consisting of the format of the |
| 1505 |
% counters itself and the references. The references to an item of level N is |
| 1506 |
% generated by using |\p@enumN\theenumN|, so we have to make all |\p@enumN|'s |
| 1507 |
% do nothing. |
| 1508 |
% \begin{macrocode} |
| 1509 |
\def\pl@pointxxxenum{% |
| 1510 |
\def\theenumi{\arabic{enumi}}% |
| 1511 |
\def\theenumii{\theenumi.\arabic{enumii}}% |
| 1512 |
\def\theenumiii{\theenumii.\arabic{enumiii}}% |
| 1513 |
\def\theenumiv{\theenumiii.\arabic{enumiv}}% |
| 1514 |
\def\p@enumi{}% |
| 1515 |
\def\p@enumii{}% |
| 1516 |
\def\p@enumiii{}% |
| 1517 |
\def\p@enumiv{}} |
| 1518 |
% \end{macrocode} |
| 1519 |
% \end{macro} |
| 1520 |
% \begin{macro}{\pl@pointedenum} |
| 1521 |
% \changes{v2.0a (2001/03/03)}{2001/03/03}{New macro} |
| 1522 |
% \begin{macro}{\pl@pointlessenum} |
| 1523 |
% \changes{v2.0a (2001/03/03)}{2001/03/03}{New macro} |
| 1524 |
% The format of the labels either adds a point or it doesn't. |
| 1525 |
% \begin{macrocode} |
| 1526 |
\def\pl@pointedenum{% |
| 1527 |
\def\labelenumi{\theenumi.}% |
| 1528 |
\def\labelenumii{\theenumii.}% |
| 1529 |
\def\labelenumiii{\theenumiii.}% |
| 1530 |
\def\labelenumiv{\theenumiv.}} |
| 1531 |
\def\pl@pointlessenum{% |
| 1532 |
\def\labelenumi{\theenumi}% |
| 1533 |
\def\labelenumii{\theenumii}% |
| 1534 |
\def\labelenumiii{\theenumiii}% |
| 1535 |
\def\labelenumiv{\theenumiv}} |
| 1536 |
% \end{macrocode} |
| 1537 |
% \end{macro} \end{macro} |
| 1538 |
% \begin{macro}{\pointedenum} |
| 1539 |
% \changes{v2.0a (2001/03/03)}{2001/03/03}{New macro} |
| 1540 |
% \begin{macro}{\pointlessenum} |
| 1541 |
% \changes{v2.0a (2001/03/03)}{2001/03/03}{New macro} |
| 1542 |
% Now the user level macros to turn the new feature on. |
| 1543 |
% \begin{macrocode} |
| 1544 |
\def\pointedenum{\pl@pointxxxenum\pl@pointedenum} |
| 1545 |
\def\pointlessenum{\pl@pointxxxenum\pl@pointlessenum} |
| 1546 |
% \end{macrocode} |
| 1547 |
% \end{macro} \end{macro} |
| 1548 |
% The options just use those user level macros globally. |
| 1549 |
% \begin{macrocode} |
| 1550 |
\if@plpointedenum\pointedenum\fi |
| 1551 |
\if@plpointlessenum\pointlessenum\fi |
| 1552 |
% \end{macrocode} |
| 1553 |
% |
| 1554 |
% \subsection{Configuration File} |
| 1555 |
% |
| 1556 |
% \changes{v1.6 (1999/03/27)}{1999/03/26}{Read configuration file in case it |
| 1557 |
% exists} |
| 1558 |
% Read the file |paralist.cfg| if it exists and the |nocfg| was not given. |
| 1559 |
% \begin{macrocode} |
| 1560 |
\if@plloadcfg |
| 1561 |
\InputIfFileExists{paralist.cfg}{% |
| 1562 |
\PackageInfo{Paralist}{% |
| 1563 |
Using the configuration file paralist.cfg}}{} |
| 1564 |
\fi |
| 1565 |
%</package> |
| 1566 |
% \end{macrocode} |
| 1567 |
% |
| 1568 |
% \Finale |