| 1 |
% \def\fileversion{2.1}\def\filedate{2002/08/15}\def\docdate{2013/11/26} |
| 2 |
%\iffalse These lines are necessary for the doc and docstrip utilities |
| 3 |
%<*metainfo> |
| 4 |
|
| 5 |
% With this package you can write lists with equal indentation. |
| 6 |
% This package requires the eqparbox package. |
| 7 |
% |
| 8 |
% Author: |
| 9 |
% |
| 10 |
% M. V\"ath [email protected] |
| 11 |
% |
| 12 |
% The package may be distributed and/or modified under the conditions of |
| 13 |
% the LaTeX Project Public License (version 1.3c or later). |
| 14 |
|
| 15 |
%\fi |
| 16 |
% |
| 17 |
% \def\basename{eqlist} |
| 18 |
% |
| 19 |
%% \CharacterTable |
| 20 |
%% {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 |
| 21 |
%% 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 |
| 22 |
%% Digits \0\1\2\3\4\5\6\7\8\9 |
| 23 |
%% Exclamation \! Double quote \" Hash (number) \# |
| 24 |
%% Dollar \$ Percent \% Ampersand \& |
| 25 |
%% Acute accent \' Left paren \( Right paren \) |
| 26 |
%% Asterisk \* Plus \+ Comma \, |
| 27 |
%% Minus \- Point \. Solidus \/ |
| 28 |
%% Colon \: Semicolon \; Less than \< |
| 29 |
%% Equals \= Greater than \> Question mark \? |
| 30 |
%% Commercial at \@ Left bracket \[ Backslash \\ |
| 31 |
%% Right bracket \] Circumflex \^ Underscore \_ |
| 32 |
%% Grave accent \` Left brace \{ Vertical bar \| |
| 33 |
%% Right brace \} Tilde \~} |
| 34 |
% |
| 35 |
% \CheckSum{180} |
| 36 |
% |
| 37 |
% \newcommand{\cmdcite}[1]{\texttt{\textbackslash#1}} |
| 38 |
% \newcommand{\envcite}[1]{\texttt{\{#1\}}} |
| 39 |
% \newcommand{\optcite}[1]{\texttt{#1}} |
| 40 |
% \newcommand{\filecite}[1]{\texttt{#1}} |
| 41 |
% \newcommand{\bracemeta}[1]{\texttt{\{}\meta{#1}\texttt{\}}} |
| 42 |
% |
| 43 |
% \iffalse |
| 44 |
% \RecordChanges |
| 45 |
% \fi |
| 46 |
% \def\ChangesTab{}\let\orichanges\changes |
| 47 |
% \def\changes#1#2#3{\orichanges{#1}{#2}{#3} |
| 48 |
% \expandafter\def\expandafter\ChangesTab\expandafter{\ChangesTab |
| 49 |
% \item[v#1 {\mdseries(\emph{#2})}] {#3.}}} |
| 50 |
% |
| 51 |
% \changes{2.1}{2013/11/26}{Update email, add license. Date/version remains the |
| 52 |
% same since only commments and documentation are modified} |
| 53 |
% \changes{2.1}{2002/08/18}{Added \cmdcite{longitem} and the related |
| 54 |
% \cmdcite{eqlistauto} mechanism. The latter was suggested by |
| 55 |
% Rolf Niepraschk \texttt{[email protected]}. Changed default |
| 56 |
% of \cmdcite{eqlistlabel} and gave some comments on spaces at the end of |
| 57 |
% labels in the documentation. Documented special usage of |
| 58 |
% \cmdcite{makelabel}} |
| 59 |
% \changes{1.2}{2001/08/17}{Added the \envcite{Eqlist} and \envcite{Eqlist*} |
| 60 |
% environments} |
| 61 |
% \changes{1.1}{2001/08/16}{First release} |
| 62 |
% |
| 63 |
% \iffalse |
| 64 |
%</metainfo> |
| 65 |
% |
| 66 |
% Everything between the following lines %<*driver> and %</driver> goes |
| 67 |
% into the file eqlist.tex. Also, this is the only code executed, if |
| 68 |
% this file here is run through latex. |
| 69 |
% |
| 70 |
%<*driver> |
| 71 |
\documentclass{ltxdoc} |
| 72 |
\OnlyDescription%% Comment this out, or |
| 73 |
%%\AlsoImplementation%% uncomment this line, if you want to see the source. |
| 74 |
|
| 75 |
%% If you want an index, uncomment one of the following lines. |
| 76 |
%% After running latex a first time, you have to use |
| 77 |
%% makeindex -s gind.ist eqlist |
| 78 |
%% Then run latex again. |
| 79 |
%%\CodelineIndex% comment this out if you want an index referring to codelines |
| 80 |
%%\PageIndex% comment this out if you want an index referring to pages |
| 81 |
%%\OldMakeindex% uncomment this line, if your MakeIndex is pre-v2.9 |
| 82 |
|
| 83 |
\setlength\hfuzz{15pt} |
| 84 |
\hbadness=7000 |
| 85 |
\begin{document} |
| 86 |
\DocInput{eqlist.dtx} |
| 87 |
\end{document} |
| 88 |
%</driver> |
| 89 |
%<*metainfo> |
| 90 |
% \fi |
| 91 |
% |
| 92 |
% \MakeShortVerb{"} |
| 93 |
% \def\itemcmd#1{\item[\mdseries\texttt{\textbackslash#1}]} |
| 94 |
% |
| 95 |
% \title{The \texttt{eqlist} package\thanks |
| 96 |
% {This package has version number \fileversion{}, last revised \filedate. |
| 97 |
% The package may be distributed and/or modified under the conditions of the |
| 98 |
% LaTeX Project Public License, either version 1.3c of this license or (at |
| 99 |
% your option) any later version. The latest version of this license is in |
| 100 |
% \texttt{http://www.latex-project.org/lppl.txt}, and version 1.3c or later |
| 101 |
% is part of all distributions of LaTeX version 2005/12/01 or later.}} |
| 102 |
% \author{Martin V\"ath\\{\texttt{[email protected]}}} |
| 103 |
% \date{\docdate} |
| 104 |
% \maketitle |
| 105 |
|
| 106 |
% \begin{abstract} |
| 107 |
% With this package you can write lists with equal indentation. |
| 108 |
% This package requires the \filecite{eqparbox} package. |
| 109 |
% \end{abstract} |
| 110 |
% |
| 111 |
% You may copy this package freely, as long as you distribute only unmodified |
| 112 |
% and complete versions. |
| 113 |
% |
| 114 |
% \iffalse\tableofcontents\par\pagebreak\par\fi |
| 115 |
% |
| 116 |
% \section{Changes} |
| 117 |
% |
| 118 |
% \begin{description} |
| 119 |
% \ChangesTab |
| 120 |
% \end{description} |
| 121 |
% |
| 122 |
% \section{Description} |
| 123 |
% |
| 124 |
% This package provides a list environment which sets a description-like list |
| 125 |
% but with the difference that the indentation corresponds to the longest item |
| 126 |
% of the list. The usage is simply |
| 127 |
% \begin{quote} |
| 128 |
% \DescribeEnv{eqlist}"\begin{eqlist}["\meta{optional modifications}"]"\\ |
| 129 |
% "\item[First item] Text"\\ |
| 130 |
% "\item[Second item] Text"\\ |
| 131 |
% "\longitem[A special very long item] Text"\\ |
| 132 |
% \dots\\ |
| 133 |
% "\end{eqlist}" |
| 134 |
% \end{quote} |
| 135 |
% and there is also the environment \DescribeEnv{eqlist*}\envcite{eqlist*} |
| 136 |
% which is similar but has slightly different defaults |
| 137 |
% (which make the list appear more compact). |
| 138 |
% There is also the alternative call |
| 139 |
% \begin{quote} |
| 140 |
% \DescribeEnv{Eqlist}"\begin{Eqlist}["\meta{optional modifications}"]"\relax |
| 141 |
%\bracemeta{tag}\\ |
| 142 |
% "\item[First item] Text"\\ |
| 143 |
% "\item[Second item] Text"\\ |
| 144 |
% "\longitem[A special very long item] Text"\\ |
| 145 |
% \dots\\ |
| 146 |
% "\end{eqlist}" |
| 147 |
% \end{quote} |
| 148 |
% and a corresponding \DescribeEnv{Eqlist*}\envcite{Eqlist*} environment.\par |
| 149 |
% |
| 150 |
% All texts within the list are indented by the length of the largest label |
| 151 |
% (i.e.\ "\item" entry) plus "\labelsep". For the "Eqlist" or "Eqlist*" |
| 152 |
% environment, all lists with the same \meta{tag} are treated equally in the |
| 153 |
% sense that the indentation of these lists is determined by the largest |
| 154 |
% "\item" of all these lists. In this case, you may also use the \meta{tag} |
| 155 |
% for the \filecite{eqparbox} package to read or modify the length of the |
| 156 |
% largest "\item" (which is internally treated as a "\eqparbox").\par |
| 157 |
% |
| 158 |
% \DescribeMacro{\longitem}"\longitem" is like "\item", but the corresponding |
| 159 |
% label is excluded from the calculation of the longest "\item". |
| 160 |
% The intention of "\longitem" is to allow exceptionally long labels to |
| 161 |
% occur without forcing a corresponding extreme indentation |
| 162 |
% of the whole list. If you want \LaTeX\ to decide automatically |
| 163 |
% whether "\longitem" or "\item" should be used, you can use the |
| 164 |
% "\eqlistauto" mechanism which is described later. |
| 165 |
% |
| 166 |
% The \meta{optional modifications} are any commands which are used to |
| 167 |
% initialize the list: You can modify here essentially the same variables as |
| 168 |
% for any \LaTeXe\ list. If this argument is not given, the default |
| 169 |
% initializations \DescribeMacro{\eqlistinit}"\eqlistinit" respectively |
| 170 |
% \DescribeMacro{\eqliststarinit}"\eqliststarinit" (for \envcite{eqlist*} |
| 171 |
% and \envcite{Eqlist*}) are used: |
| 172 |
% You can just modify these definitions to change the defaults. |
| 173 |
% If you have given the argument \meta{optional modifications} and additionally |
| 174 |
% want to use the defaults, you have to include the command "\eqlistinit" |
| 175 |
% respectively "\eqliststarinit" into the argument |
| 176 |
% \meta{optional modifications} (see the examples below).\par |
| 177 |
% |
| 178 |
% The macros "\eqlistinit" and "\eqliststarinit" both call |
| 179 |
% \DescribeMacro{\eqlistinitpar}"\eqlistinitpar" which sets the values for |
| 180 |
% "\parindent" and "\parskip" to the values outside the list |
| 181 |
% (this is not standard in \LaTeXe, but I prefer this style; if you do not like |
| 182 |
% this, use "\let\eqlistinit\relax"). |
| 183 |
% |
| 184 |
% Currently, this is all which is done by "\eqlistinit"; for |
| 185 |
% "\eqliststarinit" additionally the values of |
| 186 |
% \DescribeMacro{\topsep}"\topsep" and \DescribeMacro{\itemsep}"\itemsep" are |
| 187 |
% set to $0$. Note that currently \DescribeMacro{\partopsep}"\partopsep" is |
| 188 |
% not changed from the \LaTeXe\ default. Note that the latter is by default |
| 189 |
% positive which means that if you are in vertical mode before the list |
| 190 |
% (e.g.\ if you have a "\par" in front of the list), you get slightly more |
| 191 |
% space above the list.\par |
| 192 |
% |
| 193 |
% Before \meta{optional modifications} (or "\eqlistinit" respectively |
| 194 |
% "\eqliststarinit") are expanded, the length of the largest label is already |
| 195 |
% stored in |
| 196 |
% \DescribeMacro{\labelwidth}"\labelwidth" and |
| 197 |
% \DescribeMacro{\leftmargin}"\leftmargin". After your modifications, |
| 198 |
% \DescribeMacro{\labelsep}"\labelsep" is added to the actual value of |
| 199 |
% "\leftmargin". |
| 200 |
% |
| 201 |
% As usual, the layout of "\item"s is done by the command |
| 202 |
% \DescribeMacro{\makelabel}"\makelabel". If you want, you can change the |
| 203 |
% default initialization of this command in the \meta{optional modifications} |
| 204 |
% argument. However, it is \emph{not} admissible to redefine this macro |
| 205 |
% within the list. |
| 206 |
% If you really want to change the layout of "\item"s in the middle of a list, |
| 207 |
% you can initialize "\makelabel" to expand to another command whose |
| 208 |
% definition you can change within the list instead of "\makelabel" |
| 209 |
% (an example will be given later). |
| 210 |
% The default value of \DescribeMacro{\makelabel}"\makelabel" is the |
| 211 |
% content of \DescribeMacro{\eqlistlabel}"\eqlistlabel" which in turn is |
| 212 |
% by default defined with |
| 213 |
% \begin{verbatim} |
| 214 |
% \def\eqlistlabel#1{#1}\end{verbatim} |
| 215 |
% |
| 216 |
% In version 1.1 and 1.2 of this package, the default was different: |
| 217 |
% A space was added at the end. This has been changed, because by a bug |
| 218 |
% (or feature?) in "\eqparbox" spaces at the end of an "\item" are |
| 219 |
% ignored anyway. |
| 220 |
% If you want to force a space at the end which will not be ignored, |
| 221 |
% you have to hide it in a box: |
| 222 |
% \begin{verbatim} |
| 223 |
% \def\eqlistlabel#1{\mbox{#1 }}\end{verbatim} |
| 224 |
% will force a space at the end of every "\item".\bigskip |
| 225 |
% |
| 226 |
% There is a special mechanism provided which will automatically decide for |
| 227 |
% an "\item" depending on the length of its label whether it is treated as |
| 228 |
% normal or whether it should be treated like a "\longitem": If you want to |
| 229 |
% use this mechanism, you only have to insert the command |
| 230 |
% \begin{quote} |
| 231 |
% \DescribeMacro{\eqlistauto}"\eqlistauto{"\meta{maximal length}"}" |
| 232 |
% \end{quote} |
| 233 |
% either inside the \meta{optional modifications} argument or within the list. |
| 234 |
% Here, \meta{maximal length} must be in a format which can be used within |
| 235 |
% \TeX's internal "\ifdim" command. It describes the maximal length of the |
| 236 |
% label such that the corresponding "\item" will be treated as usual---for |
| 237 |
% longer labels the corresponding "\item" will be treated as a "\longitem". |
| 238 |
% If you want to switch off the "\eqlistauto"-mechanism again, you can use |
| 239 |
% the command |
| 240 |
% \begin{quote} |
| 241 |
% \DescribeMacro{\eqlistnoauto}"\eqlistnoauto" |
| 242 |
% \end{quote} |
| 243 |
% The commands "\eqlistauto" and "\eqlistnoauto" need not occur in matching |
| 244 |
% pairs, and they can also be used several times within the same list: |
| 245 |
% Only the latest of the corresponding commands takes effect for a |
| 246 |
% corresponding "\item". |
| 247 |
% |
| 248 |
% Unfortunately, the "\eqlistauto" mechanism has a disadvantage: As long as |
| 249 |
% it is in effect, the corresponding "\makelabel"s for the "\item"s are |
| 250 |
% always executed twice (once to calculate the length and once for the actual |
| 251 |
% typesetting). This can cause problems if e.g.\ counters in "\item"s are |
| 252 |
% increased. |
| 253 |
% |
| 254 |
% The "\eqlistauto" mechanism only effects the "\item" command, not |
| 255 |
% "\longitem": Even if the "\eqlistauto" mechanism is active, you can use |
| 256 |
% "\longitem" which will have its original meaning (independent of the |
| 257 |
% length of the label). This means in particular that the "\makelabel" is |
| 258 |
% executed only once by "\longitem", no matter whether the "\eqlistauto" |
| 259 |
% mechanism is active or not. |
| 260 |
% |
| 261 |
% \section{Examples} |
| 262 |
% \begin{verbatim} |
| 263 |
% \begin{eqlist}[\eqliststarinit\def\makelabel#1{\bfseries#1:}\labelsep1em] |
| 264 |
% \item[Short label] Descriptive text |
| 265 |
% \item[A longer label] Descriptive text |
| 266 |
% \longitem[An exceptionally long label] Descriptive text |
| 267 |
% \item[Short again] Descriptive text |
| 268 |
% \end{eqlist}\end{verbatim} |
| 269 |
% will produce an output like\medskip\newline |
| 270 |
% \begin{tabular}{@{}l@{}l} |
| 271 |
% \bfseries Short label:\hspace{1em}\null&Descriptive text\\ |
| 272 |
% \bfseries A longer label:\hspace{1em}\null&Descriptive text\\ |
| 273 |
% \multicolumn{2}{@{}l}{{\bfseries An exceptionally |
| 274 |
% long label:\hspace{1em}}\null Descriptive text}\\ |
| 275 |
% \bfseries Short again:\hspace{1em}\null&Descriptive text |
| 276 |
% \end{tabular}\bigskip\par |
| 277 |
% |
| 278 |
% The same output can be obtained using the "\eqlistauto" mechanism |
| 279 |
% \begin{verbatim} |
| 280 |
% \begin{eqlist}[\eqliststarinit |
| 281 |
% \def\makelabel#1{\bfseries#1:}\labelsep1em\eqlistauto{3cm}] |
| 282 |
% \item[Short label] Descriptive text |
| 283 |
% \item[A longer label] Descriptive text |
| 284 |
% \item[An exceptionally long label] Descriptive text |
| 285 |
% \item[Short again] Descriptive text |
| 286 |
% \end{eqlist}\end{verbatim} |
| 287 |
% or by using the "\eqlistauto" mechanism only locally: |
| 288 |
% \begin{verbatim} |
| 289 |
% \begin{eqlist}[\eqliststarinit\def\makelabel#1{\bfseries#1:}\labelsep1em] |
| 290 |
% \item[Short label] Descriptive text |
| 291 |
% \item[A longer label] Descriptive text |
| 292 |
% \eqlistauto{0pt} |
| 293 |
% \item[An exceptionally long label] Descriptive text |
| 294 |
% \eqlistnoauto |
| 295 |
% \item[Short again] Descriptive text |
| 296 |
% \end{eqlist}\end{verbatim} |
| 297 |
% |
| 298 |
% The next example demonstrates how one can change the layout of labels |
| 299 |
% within the list. Recall that it is forbidden to redefine "\makelabel". |
| 300 |
% \begin{verbatim} |
| 301 |
% \begin{eqlist}[\eqliststarinit |
| 302 |
% \def\mylabel#1{\bfseries#1:}\def\makelabel{\mylabel}\labelsep1em] |
| 303 |
% \item[First label] Descriptive text |
| 304 |
% \item[Second label] Descriptive text |
| 305 |
% \def\mylabel#1{\slshape#1:} |
| 306 |
% \item[First new-style label] Descriptive text |
| 307 |
% \longitem[Second new-style label which is long] Descriptive text |
| 308 |
% \end{eqlist}\end{verbatim} |
| 309 |
% The above example will produce an output as follows.\bigskip\newline |
| 310 |
% \begin{tabular}{@{}l@{}l} |
| 311 |
% \bfseries First label:\hspace{1em}\null&Descriptive text\\ |
| 312 |
% \bfseries Second label:\hspace{1em}\null&Descriptive text\\ |
| 313 |
% \slshape First new-style label:\hspace{1em}\null&Descriptive text\\ |
| 314 |
% \multicolumn{2}{@{}l}{{\slshape Second new-style label |
| 315 |
% which is long:\hspace{1em}}\null Descriptive text} |
| 316 |
% \end{tabular} |
| 317 |
% |
| 318 |
% \iffalse |
| 319 |
%</metainfo> |
| 320 |
% \fi |
| 321 |
% \iffalse--------------------------------------------------------------\fi |
| 322 |
% \StopEventually{\PrintChanges} |
| 323 |
% \section{Implementation} |
| 324 |
% |
| 325 |
% \newcommand{\nocomment}{} |
| 326 |
% \setcounter{CodelineNo}{0} |
| 327 |
% \iffalse-------------------------------------------------------------- |
| 328 |
% |
| 329 |
% |
| 330 |
%<*eqlist> |
| 331 |
% \fi |
| 332 |
% \begin{macrocode} |
| 333 |
|
| 334 |
\typeout{eqlist.sty by M. Vaeth: Revision 2.1} |
| 335 |
\NeedsTeXFormat{LaTeX2e} |
| 336 |
\ProvidesPackage{eqlist}[2002/08/15 v2.1] |
| 337 |
|
| 338 |
\RequirePackage{eqparbox} |
| 339 |
|
| 340 |
% \end{macrocode} |
| 341 |
% \begin{macro}{eqlist}\nocomment |
| 342 |
% \begin{macrocode} |
| 343 |
\newenvironment{eqlist}[1][\eqlistinit]{\eql@start{#1}}{\eql@end} |
| 344 |
% \end{macrocode} |
| 345 |
% \end{macro} |
| 346 |
% \begin{macro}{eqlist*}\nocomment |
| 347 |
% \begin{macrocode} |
| 348 |
\newenvironment{eqlist*}[1][\eqliststarinit]{\eql@start{#1}}{\eql@end} |
| 349 |
% \end{macrocode} |
| 350 |
% \end{macro} |
| 351 |
% \begin{macro}{Eqlist}\nocomment |
| 352 |
% \begin{macrocode} |
| 353 |
\newenvironment{Eqlist}[2][\eqlistinit]{\eql@startp{#1}{#2}}{\eql@end} |
| 354 |
% \end{macrocode} |
| 355 |
% \end{macro} |
| 356 |
% \begin{macro}{Eqlist*}\nocomment |
| 357 |
% \begin{macrocode} |
| 358 |
\newenvironment{Eqlist*}[2][\eqliststarinit]{\eql@startp{#1}{#2}}{\eql@end} |
| 359 |
|
| 360 |
% \end{macrocode} |
| 361 |
% \end{macro} |
| 362 |
% \begin{macro}{\eqlistinitpar}\nocomment |
| 363 |
% \begin{macrocode} |
| 364 |
\ifx\eqlistinitpar\undefined |
| 365 |
\def\eqlistinitpar{\relax\listparindent\parindent\relax\parsep\parskip\relax} |
| 366 |
\fi |
| 367 |
% \end{macrocode} |
| 368 |
% \end{macro} |
| 369 |
% \begin{macro}{\eqlistinit}\nocomment |
| 370 |
% \begin{macrocode} |
| 371 |
\ifx\eqlistinit\undefined |
| 372 |
\def\eqlistinit{\eqlistinitpar} |
| 373 |
\fi |
| 374 |
% \end{macrocode} |
| 375 |
% \end{macro} |
| 376 |
% \begin{macro}{\eqliststarinit}\nocomment |
| 377 |
% \begin{macrocode} |
| 378 |
\ifx\eqliststarinit\undefined |
| 379 |
\def\eqliststarinit{\topsep0pt\relax\itemsep0pt\relax%\partopsep0pt\relax |
| 380 |
\eqlistinitpar} |
| 381 |
\fi |
| 382 |
% \end{macrocode} |
| 383 |
% \end{macro} |
| 384 |
% \begin{macro}{\eqlistlabel}\nocomment |
| 385 |
% \begin{macrocode} |
| 386 |
\ifx\eqlistlabel\undefined |
| 387 |
\def\eqlistlabel#1{#1} |
| 388 |
\fi |
| 389 |
|
| 390 |
% \end{macrocode} |
| 391 |
% \end{macro} |
| 392 |
% \begin{macro}{\eql@cnt} |
| 393 |
% The counter "\eql@cnt" is used to generate ``unique'' names for the labels. |
| 394 |
% \begin{macrocode} |
| 395 |
\newcount\eql@cnt\relax\eql@cnt=0 |
| 396 |
|
| 397 |
% \end{macrocode} |
| 398 |
% \end{macro} |
| 399 |
% \begin{macro}{\eql@start} |
| 400 |
% The macro "\eql@start" advances the counter "\eql@cnt" (globally!) and then |
| 401 |
% starts a list, where for the initialization "\eql@mainprep" is called with |
| 402 |
% the corresponding ``unique'' name and the argument. |
| 403 |
% \begin{macrocode} |
| 404 |
\long\def\eql@start#1{\global\advance\eql@cnt by1\begin{list}{}{\expandafter |
| 405 |
\eql@mainprepn\expandafter{\romannumeral\eql@cnt}{#1}}} |
| 406 |
% \end{macrocode} |
| 407 |
% \end{macro} |
| 408 |
% \begin{macro}{\eql@startp} |
| 409 |
% The macro "\eql@startp" is similar to "\eql@start" with the difference that |
| 410 |
% the first argument is used as the ``unique'' name instead of a counter. |
| 411 |
% Thus, "\eql@startp" starts a list, where for the initialization |
| 412 |
% "\eql@mainprep" is used with the corresponding arguments. |
| 413 |
% \begin{macrocode} |
| 414 |
\long\def\eql@startp#1#2{\begin{list}{}{\eql@mainprep{#2}{#1}}} |
| 415 |
% \end{macrocode} |
| 416 |
% \end{macro} |
| 417 |
% \begin{macro}{\eql@end} |
| 418 |
% \begin{macrocode} |
| 419 |
\def\eql@end{\end{list}} |
| 420 |
|
| 421 |
% \end{macrocode} |
| 422 |
% \end{macro} |
| 423 |
% \begin{macro}{\eql@mainprep} |
| 424 |
% In "\eql@mainprep", we allow the environment-specific commands and |
| 425 |
% initialize |
| 426 |
% \begin{macro}{\eql@makelabel}"\eql@makelabel"\end{macro} |
| 427 |
% which will become later our actual "\makelabel". |
| 428 |
% We also save this definition into |
| 429 |
% \begin{macro}{\eql@normal}"\eql@normal"\end{macro} |
| 430 |
% and (as always if "\eql@makelabel" is changed non-temporary) we also save it |
| 431 |
% into |
| 432 |
% \begin{macro}{\eql@current}"\eql@current".\end{macro} |
| 433 |
% Finally, "\makelabel" is initialized to "\eqlistlabel", and the |
| 434 |
% length of the label (and the left margin) is initialized with |
| 435 |
% the length of the corresponding eqparbox with the ``unique'' name "#1". |
| 436 |
% Then the (default or user) initialization "#2" is executed. |
| 437 |
% After this, "\makelabel" is replaced by "\eql@makelabel". The |
| 438 |
% ``user'' definition of "\makelabel" is before saved into |
| 439 |
% \begin{macro}{\eql@long}"\eql@long".\end{macro} |
| 440 |
% \begin{macrocode} |
| 441 |
\long\def\eql@mainprep#1#2{\let\longitem\eql@longitem |
| 442 |
\let\eqlistauto\eql@auto |
| 443 |
\let\eqlistnoauto\eql@noauto |
| 444 |
\def\eql@makelabel##1{\eqparbox[b]{#1}{\eql@long{##1}}\hfil}% |
| 445 |
\let\eql@normal\eql@makelabel |
| 446 |
\let\eql@current\eql@makelabel |
| 447 |
\setlength{\labelwidth}{\eqboxwidth{#1}}% |
| 448 |
\setlength{\leftmargin}{\labelwidth}% |
| 449 |
\let\makelabel\eqlistlabel |
| 450 |
#2\addtolength{\leftmargin}{\labelsep}% |
| 451 |
\let\eql@long\makelabel\def\makelabel{\eql@makelabel}} |
| 452 |
% \end{macrocode} |
| 453 |
% \end{macro} |
| 454 |
% \begin{macro}{\eql@mainprepn} |
| 455 |
% Despite of its definition, "\eql@mainprepn" actually expects two arguments: |
| 456 |
% "\eql@mainprepn" does the same as "\eql@mainprep" with the difference that |
| 457 |
% the first argument should be a unique roman number instead of a ``unique'' |
| 458 |
% name: The actual name is then obtained by prepending the text "eqlistbox" |
| 459 |
% to the number. Note that the number must actually be roman, since otherwise |
| 460 |
% (some release(s) of) the \filecite{eqparbox} package becomes confused. |
| 461 |
% \begin{macrocode} |
| 462 |
\def\eql@mainprepn#1{\eql@mainprep{eqlistbox#1}} |
| 463 |
|
| 464 |
% \end{macrocode} |
| 465 |
% \end{macro} |
| 466 |
% \begin{macro}{\longitem} |
| 467 |
% "\longitem" is essentially a call of "\item" with the difference that we |
| 468 |
% redefine "\eql@makelabel" temporarily. To avoid usage outside of the intended |
| 469 |
% environment, the actual code is put into |
| 470 |
% \begin{macro}{\eql@longitem}"\eql@longitem".\end{macro} |
| 471 |
% \begin{macrocode} |
| 472 |
\newcommand{\longitem}{\eql@illlegal\longitem\item} |
| 473 |
\def\eql@longitem[#1]{\let\eql@makelabel\eql@long |
| 474 |
\item[#1]\let\eql@makelabel\eql@current} |
| 475 |
|
| 476 |
% \end{macrocode} |
| 477 |
% \end{macro} |
| 478 |
% \begin{macro}{\eqlistauto} |
| 479 |
% To avoid usage outside of the intended environment, |
| 480 |
% the actual code is put into |
| 481 |
% \begin{macro}{\eql@auto}"\eql@auto".\end{macro} |
| 482 |
% \begin{macrocode} |
| 483 |
\newcommand{\eqlistauto}[1]{\eql@illegal\eqlistauto} |
| 484 |
\def\eql@auto#1{\def\eql@makelabel##1{\setbox0\hbox{\eql@long{##1}}% |
| 485 |
\ifdim#1>\wd0\relax |
| 486 |
\expandafter\eql@normal |
| 487 |
\else |
| 488 |
\expandafter\eql@long |
| 489 |
\fi{##1}}% |
| 490 |
\let\eql@current\eql@makelabel} |
| 491 |
% \end{macrocode} |
| 492 |
% \end{macro} |
| 493 |
% \begin{macro}{\eqlistnoauto} |
| 494 |
% To avoid usage outside of the intended environment, |
| 495 |
% the actual code is put into |
| 496 |
% \begin{macro}{\eql@noauto}"\eql@noauto".\end{macro} |
| 497 |
% \begin{macrocode} |
| 498 |
\newcommand{\eqlistnoauto}{\eql@illegal\eqlistnoauto} |
| 499 |
\def\eql@noauto{\let\eql@makelabel\eql@normal\let\eql@current\eql@makelabel} |
| 500 |
% \end{macrocode} |
| 501 |
% \end{macro} |
| 502 |
% \begin{macro}{\eql@illegal} |
| 503 |
% Write error message in case a command is used outside of the intended |
| 504 |
% environment. |
| 505 |
% \begin{macrocode} |
| 506 |
\def\eql@illegal#1{\errmessage{\string#1 |
| 507 |
can only be used in eqlist or Eqlist environment}} |
| 508 |
|
| 509 |
% \end{macrocode} |
| 510 |
% \end{macro} |
| 511 |
% \iffalse |
| 512 |
%</eqlist> |
| 513 |
% \fi |
| 514 |
% |
| 515 |
% \Finale\PrintIndex |
| 516 |
% |
| 517 |
% \iffalse |
| 518 |
%<*metainfo> |
| 519 |
% \fi |
| 520 |
\iffalse ------------------------------------------------------------- |
| 521 |
% |
| 522 |
% Just in case that for some reason the file `eqlist.ins' got lost: |
| 523 |
% The content of this file is between the lines %<*insfile> and %</insfile>: |
| 524 |
% |
| 525 |
%\iffalse |
| 526 |
%</metainfo> |
| 527 |
%<*insfile> |
| 528 |
\def\batchfile{eqlist.ins} |
| 529 |
\input docstrip.tex |
| 530 |
\keepsilent |
| 531 |
\nopreamble |
| 532 |
\generateFile{eqlist.sty}{f}{\from{eqlist.dtx}{eqlist}} |
| 533 |
\generateFile{eqlist.tex}{f}{\from{eqlist.dtx}{driver}} |
| 534 |
%%\generateFile{eqlist.ins.dup}{f}{\from{eqlist.dtx}{insfile}} |
| 535 |
|
| 536 |
\Msg{***************************************************************} |
| 537 |
\Msg{*} |
| 538 |
\Msg{* To finish the installation, you have to move the} |
| 539 |
\Msg{* file 'eqlist.sty' in a directory searched by TeX.} |
| 540 |
\Msg{*} |
| 541 |
\Msg{*} |
| 542 |
\Msg{* Run the file 'eqlist.tex' through LaTeX to produce the} |
| 543 |
\Msg{* documentation} |
| 544 |
\Msg{*} |
| 545 |
\Msg{*} |
| 546 |
\Msg{***************************************************************} |
| 547 |
\endbatchfile |
| 548 |
%</insfile> |
| 549 |
%<*metainfo> |
| 550 |
% \fi |
| 551 |
\fi |
| 552 |
% \iffalse |
| 553 |
%</metainfo> |
| 554 |
% \fi |
| 555 |
\endinput |
| 556 |
|
| 557 |
%%% Local Variables: |
| 558 |
%%% mode: latex |
| 559 |
%%% TeX-master: "eqlist.tex" |
| 560 |
%%% End: |