Debian Codegraph @

texmf-dist/source/latex/abstract/abstract.dtx

raw
1 % \iffalse meta-comment
2 % abstract.dtx
3 % Author: Peter Wilson, Herries Press
4 % Maintainer: Will Robertson (will dot robertson at latex-project dot org)
5 % Copyright 2000--2009 Peter R. Wilson
6 %
7 % This work may be distributed and/or modified under the
8 % conditions of the LaTeX Project Public License, either
9 % version 1.3c of this license or (at your option) any
10 % later version: <http://www.latex-project.org/lppl.txt>
11 %
12 % This work has the LPPL maintenance status "maintained".
13 % The Current Maintainer of this work is Will Robertson.
14 %
15 % This work consists of the files listed in the README file.
16 %
17 %
18 %<*driver>
19 \documentclass{ltxdoc}
20 \EnableCrossrefs
21 \CodelineIndex
22 %%\OnlyDescription
23 \setcounter{StandardModuleDepth}{1}
24 \begin{document}
25 \DocInput{abstract.dtx}
26 \end{document}
27 %</driver>
28 %
29 % \fi
30 %
31 % \CheckSum{281}
32 %
33 % \DoNotIndex{\',\.,\@M,\@@input,\@addtoreset,\@arabic,\@badmath}
34 % \DoNotIndex{\@centercr,\@cite}
35 % \DoNotIndex{\@dotsep,\@empty,\@float,\@gobble,\@gobbletwo,\@ignoretrue}
36 % \DoNotIndex{\@input,\@ixpt,\@m}
37 % \DoNotIndex{\@minus,\@mkboth,\@ne,\@nil,\@nomath,\@plus,\@set@topoint}
38 % \DoNotIndex{\@tempboxa,\@tempcnta,\@tempdima,\@tempdimb}
39 % \DoNotIndex{\@tempswafalse,\@tempswatrue,\@viipt,\@viiipt,\@vipt}
40 % \DoNotIndex{\@vpt,\@warning,\@xiipt,\@xipt,\@xivpt,\@xpt,\@xviipt}
41 % \DoNotIndex{\@xxpt,\@xxvpt,\\,\ ,\addpenalty,\addtolength,\addvspace}
42 % \DoNotIndex{\advance,\Alph,\alph}
43 % \DoNotIndex{\arabic,\ast,\begin,\begingroup,\bfseries,\bgroup,\box}
44 % \DoNotIndex{\bullet}
45 % \DoNotIndex{\cdot,\cite,\CodelineIndex,\cr,\day,\DeclareOption}
46 % \DoNotIndex{\def,\DisableCrossrefs,\divide,\DocInput,\documentclass}
47 % \DoNotIndex{\DoNotIndex,\egroup,\ifdim,\else,\fi,\em,\endtrivlist}
48 % \DoNotIndex{\EnableCrossrefs,\end,\end@dblfloat,\end@float,\endgroup}
49 % \DoNotIndex{\endlist,\everycr,\everypar,\ExecuteOptions,\expandafter}
50 % \DoNotIndex{\fbox}
51 % \DoNotIndex{\filedate,\filename,\fileversion,\fontsize,\framebox,\gdef}
52 % \DoNotIndex{\global,\halign,\hangindent,\hbox,\hfil,\hfill,\hrule}
53 % \DoNotIndex{\hsize,\hskip,\hspace,\hss,\if@tempswa,\ifcase,\or,\fi,\fi}
54 % \DoNotIndex{\ifhmode,\ifvmode,\ifnum,\iftrue,\ifx,\fi,\fi,\fi,\fi,\fi}
55 % \DoNotIndex{\input}
56 % \DoNotIndex{\jobname,\kern,\leavevmode,\let,\leftmark}
57 % \DoNotIndex{\list,\llap,\long,\m@ne,\m@th,\mark,\markboth,\markright}
58 % \DoNotIndex{\month,\newcommand,\newcounter,\newenvironment}
59 % \DoNotIndex{\NeedsTeXFormat,\newdimen}
60 % \DoNotIndex{\newlength,\newpage,\nobreak,\noindent,\null,\number}
61 % \DoNotIndex{\numberline,\OldMakeindex,\OnlyDescription,\p@}
62 % \DoNotIndex{\pagestyle,\par,\paragraph,\paragraphmark,\parfillskip}
63 % \DoNotIndex{\penalty,\PrintChanges,\PrintIndex,\ProcessOptions}
64 % \DoNotIndex{\protect,\ProvidesClass,\raggedbottom,\raggedright}
65 % \DoNotIndex{\refstepcounter,\relax,\renewcommand,\reset@font}
66 % \DoNotIndex{\rightmargin,\rightmark,\rightskip,\rlap,\rmfamily,\roman}
67 % \DoNotIndex{\roman,\secdef,\selectfont,\setbox,\setcounter,\setlength}
68 % \DoNotIndex{\settowidth,\sfcode,\skip,\sloppy,\slshape,\space}
69 % \DoNotIndex{\symbol,\the,\trivlist,\typeout,\tw@,\undefined,\uppercase}
70 % \DoNotIndex{\usecounter,\usefont,\usepackage,\vfil,\vfill,\viiipt}
71 % \DoNotIndex{\viipt,\vipt,\vskip,\vspace}
72 % \DoNotIndex{\wd,\xiipt,\year,\z@}
73 %
74 % \changes{v1.0}{2000/06/11}{First public release}
75 % \changes{v1.1}{2001/02/11}{Added runin option}
76 % \changes{v1.1a}{2004/04/16}{Changed license and contact details}
77 % \changes{v1.2}{2009/05/22}{Changed contact details, and minor improvements}
78 % \changes{v1.2}{2009/05/23}{Added style option}
79 % \changes{v1.2a}{2009/06/08}{New maintainer}
80 %
81 % \def\dtxfile{abstract.dtx}
82 % ^^A \def\fileversion{v0.3}
83 % ^^A \def\filedate{2000/05/20}
84 % ^^A \def\fileversion{v1.0}
85 % ^^A \def\filedate{2000/06/11}
86 % \def\fileversion{v1.1} \def\filedate{2001/02/11}
87 % \def\fileversion{v1.1a} \def\filedate{2004/04/16}
88 % \def\fileversion{v1.2} \def\filedate{2009/05/23}
89 % \def\fileversion{v1.2a} \def\filedate{2009/06/08}
90 %
91 % \newcommand*{\Lpack}[1]{\textsf {#1}} ^^A typeset a package
92 % \newcommand*{\Lopt}[1]{\textsf {#1}} ^^A typeset an option
93 % \newcommand*{\file}[1]{\texttt {#1}} ^^A typeset a file
94 % \newcommand*{\Lcount}[1]{\textsl {\small#1}} ^^A typeset a counter
95 % \newcommand*{\pstyle}[1]{\textsl {#1}} ^^A typeset a pagestyle
96 % \newcommand*{\Lenv}[1]{\texttt {#1}} ^^A typeset an environment
97 %
98 % \title{The \Lpack{abstract} package\thanks{This
99 % file (\texttt{\dtxfile}) has version number \fileversion, last revised
100 % \filedate.}}
101 %
102 % \author{
103 % Author: Peter Wilson, Herries Press \\
104 % Maintainer: Will Robertson \\
105 % \texttt{will dot robertson at latex-project dot org}
106 % }
107 % \date{\filedate}
108 % \maketitle
109 % \begin{abstract}
110 % The \Lpack{abstract} package provides control over the typesetting
111 % of the |abstract| environment, and especially provides for a one-column
112 % abstract in a two-column paper.
113 % \end{abstract}
114 % \tableofcontents
115 %
116 %
117 %
118 % \section{Introduction}
119 %
120 % Questions about how to have a one-column abstract in a two-column paper
121 % seem to pop up fairly regularly on the
122 % \texttt{comp.text.tex} newsgroup. While an answer based on responses
123 % on \texttt{ctt} is provided in the FAQ,
124 % the \Lpack{abstract} package provides a more author-friendly means
125 % of accomplishing this. Further, additional controls are provided
126 % for the typesetting of the |abstract| environment in general.
127 %
128 %
129 % This manual is typeset according to the conventions of the
130 % \LaTeX{} \textsc{docstrip} utility which enables the automatic
131 % extraction of the \LaTeX{} macro source files~\cite{GOOSSENS94}.
132 %
133 % Section~\ref{sec:usc} describes the usage of the \Lpack{abstract}
134 % package and
135 % commented source code is in Section~\ref{sec:code}.
136 %
137 % \section{The \Lpack{abstract} package} \label{sec:usc}
138 %
139 % The typeset format of the |abstract| in a \Lpack{report} or
140 % \Lpack{article} class\footnote{The \texttt{abstract} environment is not
141 % available for the \Lpack{book} class.} document depends on the class
142 % options. The formats are:
143 % \begin{itemize}
144 % \item \Lopt{titlepage} class option: The abstract heading (i.e., value of
145 % |\abstractname|) is typeset centered in a bold font; the text is set in
146 % the normal font and to the normal width.
147 % \item \Lopt{twocolumn} class option: The abstract heading is typeset like
148 % an unnumbered section; the text is set in the normal font and to the
149 % normal width (of a single column).
150 % \item Default (neither of the above class options): The abstract heading
151 % is typeset centered in a small bold font; the text is set in a small
152 % font and indented like the |quotation| environment.
153 % \end{itemize}
154 % Note that the \Lopt{titlepage} option takes precedence over the
155 % \Lopt{twocolumn} option.
156 %
157 % The \Lpack{abstract} package provides handles to modify the typesetting
158 % of the |abstract|.
159 %
160 % \subsection{Options}
161 %
162 % The \Lpack{abstract} package takes the following options.
163 % \begin{itemize}
164 % \item \Lopt{original}. In a \Lopt{twocolumn} document the package default
165 % is to use the default abstract style (i.e., centered heading
166 % and small text). This option sets the
167 % typeset format of the abstract to match that of a standard
168 % two column document (i.e., section heading and normal sized text).
169 % \item \Lopt{addtotoc}. The abstract title (the value of |\abstractname|)
170 % is added to the Table of Contents.
171 % \item \Lopt{number}. The abstract title will be typeset as a
172 % numbered |\chapter|
173 % or as a |\section|, depending on whether the document class supports
174 % chapters or not.
175 % \item \Lopt{style}. You specify the style for the title.\footnote{This
176 % option was suggested by Will Robertson.} The \Lopt{addtotoc} option
177 % does not apply if you use the \Lopt{style} option.
178 % \item \Lopt{runin}. The abstract title is typeset as a run-in\footnote{This
179 % option was suggested by R.~Chandrasekhar (\texttt{[email protected]}).} heading.
180 % Note that the \Lopt{number} and \Lopt{style} options are ignored if the
181 % \Lopt{runin} option is used, and the \Lopt{number} and \Lopt{addtotoc}
182 % options are ignored if the \Lopt{style} option is given.
183 % \end{itemize}
184 %
185 % When the \Lopt{number} option is used with a class that provides chapters,
186 % the usual |\chapter| command is used for typesetting the title. If you
187 % do not want the word `Chapter' (or its equivalent) to appear,
188 % you can use the \Lpack{anonchap}
189 % package to suppress this.
190 %
191 % \subsection{Commands and environments}
192 %
193 % The usual advice about creating a one-column |abstract| in a two-column
194 % document is to write code like this:
195 % \par\begin{small}\begin{verbatim}
196 % \documentclass[twocolumn...]{...}
197 % ...
198 % \twocolumn[
199 % \begin{@twocolumnfalse}
200 % \maketitle % need full-width title
201 % \begin{abstract}
202 % abstract text...
203 % \end{abstract}
204 % \end{@twocolumnfalse}
205 % ]
206 % ... hand make footnotes for any \thanks commands
207 % ...
208 % \end{verbatim}
209 % \end{small}\par
210 %
211 % \DescribeEnv{onecolabstract}
212 % \DescribeMacro{\saythanks}
213 % With the \Lpack{abstract} package, instead you do:
214 % \par\begin{small}\begin{verbatim}
215 % \documentclass[twocolumn...]{...}
216 % \usepackage{abstract}
217 % ...
218 % \twocolumn[
219 % \maketitle % need full-width title
220 % \begin{onecolabstract}
221 % abstract text...
222 % \end{onecolabstract}
223 % ]
224 % \saythanks % typesets any \thanks commands
225 % ...
226 % \end{verbatim}
227 % \end{small}\par
228 % If you want, you can use the |onecolabstract| environment in place
229 % of the |abstract| environment --- it doesn't have to be within the optional
230 % argument of the |\twocolumn| command. In fact, |onecolabstract| internally
231 % uses |abstract| for the typesetting.
232 %
233 % \DescribeMacro{\abstractnamefont}
234 % \DescribeMacro{\abstracttextfont}
235 % These two commands can be redefined to change the fonts used for
236 % typesetting the heading (defined via |\abstractname|) of the |abstract|
237 % environment and the font for typesetting the text of the abstract,
238 % respectively. The default definitions for these are designed to mimic
239 % the traditional |abstract| typesetting. Different values are used
240 % depending on whether the document uses the \Lopt{titlepage} and/or
241 % \Lopt{twocolumn} options. For example, in a non-titlepage
242 % one-column paper, their definitions are:
243 % \par\begin{small}\begin{verbatim}
244 % \newcommand{\abstractnamefont}{\normalfont\small\bfseries}
245 % \newcommand{\abstracttextfont}{\normalfont\small}
246 % \end{verbatim}
247 % \end{small}\par
248 %
249 % \DescribeMacro{\abstitlestyle}
250 % When the \Lopt{style} option is used the title is set as \\
251 % \verb?\abstitlestyle{\abstractname}? where the default definition
252 % is simply \\
253 % \verb?\newcommand{\abstitlestyle}[1]{#1}? \\
254 % It is up to you to redefine \cs{abstitlestyle} to give any effects
255 % you want (e.g., if you want the title added to the ToC you have to include
256 % the necessary code as part of your redefinition).
257 %
258 %
259 % \DescribeMacro{\absleftindent}
260 % \DescribeMacro{\absrightindent}
261 % \DescribeMacro{\absparindent}
262 % \DescribeMacro{\absparsep}
263 % The amended version of |abstract| uses a list environment for typesetting
264 % the text. These four lengths can be changed (via |\setlength|) to adjust
265 % the left and right margins, the paragraph indentation, and the vertical skip
266 % between paragraphs in this environment.
267 % The default values depend on the document class options in
268 % effect.
269 %
270 % \DescribeMacro{\abslabeldelim}
271 % If the \Lopt{runin} option is used, the heading is typeset as a run-in heading.
272 % That is, it is the first piece of text on the first line of the abstract text.
273 % The \meta{text} as dspecified by |\abslabeldelim{|\meta{text}|}| is typeset
274 % immediately after the heading. By default it is defined to do nothing, but
275 % if you wanted, for example, the |\abstractname| to be followed by a colon and
276 % some extra space you could specify |\abslabeldelim{:\quad}|.
277 %
278 % \DescribeMacro{\absnamepos}
279 % If the \Lopt{runin} option is not used then the heading is typeset
280 % in its own environment. |\absnamepos| specifies the name of the environment
281 % in which the abstract
282 % name is typeset. It can be redefined to be one of |flushleft|, |center|,
283 % or |flushright| to give a left, centered or right aligned heading; or to any
284 % other appropriate environment which is supported by the document class or
285 % used packages.
286 %
287 % \DescribeMacro{\abstitleskip}
288 % With the \Lopt{runin} option a space of length |\abstitleskip| is typeset
289 % before the heading. For example, if |\absparindent| is non-zero, then: \\
290 % |\setlength{\abstitleskip}{-\absparindent}| \\
291 % will typeset the heading flush left.
292 %
293 % Without the \Lopt{runin} option |\abstitleskip| is aditional vertical
294 % space (either positive
295 % or negative) that is inserted between the abstract name and the text of
296 % the abstract.
297 %
298 % \DescribeMacro{\appendiargdef}
299 % The (internal) command |\appendiargdef{|\meta{macro}|}{|\meta{stuff}|}|
300 % will append
301 % \meta{stuff} at the end of the current definition of \meta{macro}, where
302 % \meta{macro} is the name of a macro (including the backslash) which takes
303 % a single argument. For example the following are two equivalent definitions
304 % of |\mymacro|:
305 % \par\begin{small}\begin{verbatim}
306 % \newcommand{\mymacro}[1]{#1 is an artist}
307 % \appendiargdef{\mymacro}{ in spite of being colour blind}
308 % % or
309 % \newcommand{\mymacro}[1]{#1 is an artist in spite of being colour blind}
310 % \end{verbatim}
311 % \end{small}\par
312 %
313 % \StopEventually{
314 % \bibliographystyle{alpha}
315 % \begin{thebibliography}{GMS94}
316 % \bibitem[GMS94]{GOOSSENS94}
317 % Michel Goossens, Frank Mittelbach, and Alexander Samarin.
318 % \newblock {\em The LaTeX Companion}.
319 % \newblock Addison-Wesley Publishing Company, 1994.
320 % ^^A \bibitem[Wil96]{PRW96i}
321 % ^^A Peter~R. Wilson.
322 % ^^A \newblock {\em {LaTeX for standards: The LaTeX package files user manual}}.
323 % ^^A \newblock NIST Report NISTIR, June 1996.
324 % \end{thebibliography}
325 % }
326 %
327 %
328 %
329 % \section{The package code} \label{sec:code}
330 %
331 % To try and avoid name clashes, all the internal commands include
332 % the string |@bs|.
333 %
334 % \subsection{Preliminaries}
335 %
336 % Announce the name and version of the package, which requires
337 % \LaTeXe.
338 % \begin{macrocode}
339 %<*usc>
340 \NeedsTeXFormat{LaTeX2e}
341 \ProvidesPackage{abstract}[2009/06/08 v1.2a configurable abstracts]
342 % \end{macrocode}
343 %
344 %
345 % The following |\if...| commands are for implementing various options.
346 % \changes{v1.1}{2001/02/11}{Added \cs{if@bsrunin}}
347 % \changes{v1.2}{2009/05/23}{Added \cs{if@bsstyle}}
348 % \begin{macro}{\if@bsonecol}
349 % \begin{macro}{\ifadd@bstotoc}
350 % \begin{macro}{\ifnumber@bs}
351 % \begin{macro}{\if@bsrunin}
352 % \begin{macro}{\if@bsstyle}
353 % \begin{macrocode}
354 \newif\if@bsonecol
355 \@bsonecoltrue
356 \newif\ifadd@bstotoc
357 \add@bstotocfalse
358 \newif\ifnumber@bs
359 \number@bsfalse
360 \newif\if@bsrunin
361 \@bsruninfalse
362 \newif\if@bsstyle
363 \@bsstylefalse
364 % \end{macrocode}
365 % \end{macro}
366 % \end{macro}
367 % \end{macro}
368 % \end{macro}
369 % \end{macro}
370 %
371 % Now declare and process the options.
372 % \changes{v1.2}{2009/05/23}{Added the style option and supporting code}
373 % \begin{macrocode}
374 \DeclareOption{original}{\@bsonecolfalse}
375 \DeclareOption{addtotoc}{\add@bstotoctrue}
376 \DeclareOption{number}{\number@bstrue}
377 \DeclareOption{runin}{\@bsrunintrue}
378 \DeclareOption{style}{\@bsstyletrue}
379 \ProcessOptions\relax
380 % \end{macrocode}
381 % Disable the \Lopt{number} and \Lopt{addtotoc} option if \Lopt{style} is
382 % specified.
383 % Make sure that the \Lopt{number} option is disabled
384 % if \Lopt{runin} is used (otherwise the \Lopt{addtotoc} option
385 % may not work as expected) and also disable the \Lopt{style} option.
386 % \begin{macrocode}
387 \if@bsstyle\number@bsfalse\add@bstotocfalse\fi
388 \if@bsrunin\number@bsfalse\@bsstylefalse\fi
389 % \end{macrocode}
390 %
391 % \subsection{Abstracts}
392 %
393 % The original definition of the |abstract| environment given in
394 % \file{ltclasses.dtx} is:
395 % \par\begin{small}\begin{verbatim}
396 % \if@titlepage
397 % \renewenvironment{abstract}{%
398 % \titlepage
399 % \null\vfil
400 % \@beginparpenalty\@lowpenalty
401 % \begin{center}%
402 % \bfseries \abstractname
403 % \@endparpenalty\@M
404 % \end{center}}%
405 % {\par\vfil\null\endtitlepage}
406 % \else
407 % \renewenvironment{abstract}{%
408 % \if@twocolumn
409 % \section*{\abstractname}%
410 % \else
411 % \small
412 % \begin{center}%
413 % {\bfseries \abstractname\vspace{-.5em}\vspace{\z@}}%
414 % \end{center}%
415 % \quotation
416 % \fi}
417 % {\if@twocolumn\else\endquotation\fi}
418 % \fi
419 % \end{verbatim}
420 % \end{small}\par
421 % The next set of macros comprise the \Lpack{abstract} package
422 % reimplementation of the |abstract| environment.
423 %
424 % \begin{macro}{\abstractnamefont}
425 % \begin{macro}{\abstracttextfont}
426 % These two macros are for specifying the fonts for typesetting the
427 % abstract's title and text. They are initialised for the default case
428 % (i.e., no class options).
429 % \begin{macrocode}
430 \newcommand{\abstractnamefont}{\normalfont\small\bfseries}
431 \newcommand{\abstracttextfont}{\normalfont\small}
432 % \end{macrocode}
433 % \end{macro}
434 % \end{macro}
435 %
436 % \begin{macro}{\absnamepos}
437 % \begin{macro}{\abstitleskip}
438 % |\absnamepos| specifies the environment in which the abstract's title
439 % name will be typeset, and the length |\abstitleskip| is an adjustement
440 % to the vertical space between the title and the abstract's text. These
441 % are initialised for the default case.
442 % \begin{macrocode}
443 \newcommand{\absnamepos}{center}
444 \newlength{\abstitleskip} \setlength{\abstitleskip}{-0.5em}
445 % \end{macrocode}
446 % \end{macro}
447 % \end{macro}
448 %
449 % \begin{macro}{\absleftindent}
450 % \begin{macro}{\absrightindent}
451 % \begin{macro}{\absparindent}
452 % \begin{macro}{\absparsep}
453 % The abstract's text is typeset as a single item list, called
454 % |@bstr@ctlist|. These lengths set the left and right margin indents, the
455 % paragraph indentation, and the inter-paragraph vertical space. Their
456 % initial values are all class option-dependent.
457 % \begin{macrocode}
458 \newlength{\absleftindent}
459 \newlength{\absrightindent}
460 \newlength{\absparindent}
461 \newlength{\absparsep}
462 % \end{macrocode}
463 % \end{macro}
464 % \end{macro}
465 % \end{macro}
466 % \end{macro}
467 %
468 % \begin{macro}{\abslabeldelim}
469 % \begin{macro}{\@bslabeldelim}
470 % The contents of |\abslabeldelim| are typeset after a run-in heading.
471 % \changes{v1.1}{2001/02/11}{Added \cs{abslabeldelim} and \cs{@bslabeldelim}}
472 % \begin{macrocode}
473 \newcommand{\abslabeldelim}[1]{\def\@bslabeldelim{#1}}
474 \abslabeldelim{}
475 % \end{macrocode}
476 % \end{macro}
477 % \end{macro}
478 %
479 % \begin{macro}{\@bsrunintitle}
480 % This macro typeset the run-in heading.
481 % \changes{v1.1}{2001/02/11}{Added \cs{@bsrunintitle}}
482 % \begin{macrocode}
483 \newcommand{\@bsrunintitle}{%
484 \hspace*{\abstitleskip}{\abstractnamefont\abstractname\@bslabeldelim}}
485 % \end{macrocode}
486 % \end{macro}
487 %
488 % Now set all the class option-dependent values.
489 % \begin{macrocode}
490 \if@titlepage
491 % \end{macrocode}
492 % Values for the \Lopt{titlepage} class option. Note that this option takes
493 % precedence over any other option.
494 % \begin{macrocode}
495 \setlength{\absleftindent}{\z@}
496 \renewcommand{\abstractnamefont}{\normalfont\bfseries}
497 \renewcommand{\abstracttextfont}{\normalfont}
498 \setlength{\abstitleskip}{0em}
499 \else
500 \if@twocolumn
501 % \end{macrocode}
502 % Values for the \Lopt{twocolumn} class option.
503 % \begin{macrocode}
504 \if@bsonecol
505 \setlength{\absleftindent}{\leftmargin}
506 \else
507 \setlength{\absleftindent}{\z@}
508 \renewcommand{\abstractnamefont}{\normalfont\Large\bfseries}
509 \renewcommand{\abstracttextfont}{\normalfont}
510 \renewcommand{\absnamepos}{flushleft}
511 \setlength{\abstitleskip}{0em}
512 \fi
513 \else
514 % \end{macrocode}
515 % Values for the default, if not already initialised.
516 % \begin{macrocode}
517 \setlength{\absleftindent}{\leftmargin}
518 \fi
519 \fi
520 % \end{macrocode}
521 % Finally, values that apply for all cases.
522 % \begin{macrocode}
523 \setlength{\absrightindent}{\absleftindent}
524 \AtBeginDocument{\setlength{\absparindent}{\parindent}
525 \setlength{\absparsep}{\parskip}}
526 % \end{macrocode}
527 %
528 % \begin{environment}{@bstr@ctlist}
529 % The abstract's text is typeset within the |@bstr@ctlist| list environment.
530 % \begin{macrocode}
531 \newenvironment{@bstr@ctlist}{%
532 \list{}{%
533 %%\topsep \z@
534 \partopsep \z@
535 \listparindent \absparindent
536 \itemindent \listparindent
537 \leftmargin \absleftindent
538 \rightmargin \absrightindent
539 \parsep \absparsep}%
540 \item\relax}
541 {\endlist}
542 % \end{macrocode}
543 % \end{environment}
544 %
545 % \begin{macro}{\put@bsintoc}
546 % This macro adds the abstract's title to the ToC. It does nothing if
547 % the abstract is being numbered.
548 % \begin{macrocode}
549 \newcommand{\put@bsintoc}{%
550 \ifadd@bstotoc
551 \ifnumber@bs\else
552 \@ifundefined{chapter}{\addcontentsline{toc}{section}{\abstractname}}{%
553 \addcontentsline{toc}{chapter}{\abstractname}}
554 \fi
555 \fi}
556 % \end{macrocode}
557 % \end{macro}
558 %
559 % \begin{macro}{\num@bs}
560 % This macro generates a numbered abstract heading.
561 % \begin{macrocode}
562 \newcommand{\num@bs}{%
563 \@ifundefined{chapter}{\section{\abstractname}}{%
564 \chapter{\abstractname}}
565 }
566 % \end{macrocode}
567 % \end{macro}
568 %
569 % \begin{macro}{\abstitlestyle}
570 % When the \Lopt{style} option is called this macro is called to typeset
571 % the abstract
572 % heading; it should be redefined by the user to suit.
573 % \begin{macrocode}
574 \newcommand*{\abstitlestyle}[1]{#1}
575 % \end{macrocode}
576 % \end{macro}
577 %
578 % \begin{environment}{abstract}
579 % At last we are in position to redefine the |abstract| environment. This
580 % follows very much along the lines of the original definition, but with
581 % macros inserted at strategic points.
582 % \begin{macrocode}
583 \if@titlepage
584 % \end{macrocode}
585 % For the \Lopt{titlepage} option.
586 % \begin{macrocode}
587 \renewenvironment{abstract}{%
588 \titlepage
589 \null\vfil
590 \@beginparpenalty\@lowpenalty
591 \if@bsrunin
592 \else
593 % \end{macrocode}
594 % If the \Lopt{runin} option is not used:
595 % number the title, if called for, otherwise typeset the title in the
596 % specified (via |\absnamepos|) environment and adjust the following vertical
597 % spacing.
598 % \changes{v1.2}{2009/05/22}{Made \cs{abstitleskip} behave to match the manual}
599 % \begin{macrocode}
600 \if@bsstyle
601 \abstitlestyle{\abstractname}
602 \else
603 \ifnumber@bs
604 \num@bs
605 \else
606 \begin{\absnamepos}%
607 \abstractnamefont \abstractname
608 \@endparpenalty\@M
609 \end\absnamepos%
610 %% \vspace{\abstitleskip}%
611 \fi
612 \fi
613 \vspace{\abstitleskip}%
614 \fi
615 % \end{macrocode}
616 % Try adding the title to the ToC, then start the environment for typesetting
617 % the text. If the \Lopt{runin} option is used, typeset the heading at the start
618 % of the environment.
619 % \begin{macrocode}
620 \put@bsintoc%
621 \begin{@bstr@ctlist}\if@bsrunin\@bsrunintitle\fi\abstracttextfont}%
622 % \end{macrocode}
623 % Finish the |abstract| environment.
624 % \begin{macrocode}
625 {\par\end{@bstr@ctlist}\vfil\null\endtitlepage}
626 \else
627 % \end{macrocode}
628 % The \Lopt{twocolumn} option and the default case. These use the same code
629 % as any style differences are embedded in the new macros.
630 % \begin{macrocode}
631 \renewenvironment{abstract}{%
632 \if@bsrunin
633 \else
634 \if@bsstyle
635 \abstitlestyle{\abstractname}
636 \else
637 \ifnumber@bs
638 \num@bs
639 \else
640 \begin{\absnamepos}\abstractnamefont\abstractname\end\absnamepos%
641 %% \vspace{\abstitleskip}%
642 \fi
643 \fi
644 \vspace{\abstitleskip}%
645 \fi
646 \put@bsintoc%
647 \begin{@bstr@ctlist}\if@bsrunin\@bsrunintitle\fi\abstracttextfont}%
648 {\par\end{@bstr@ctlist}}
649 \fi
650 % \end{macrocode}
651 % \end{environment}
652 %
653 % \begin{environment}{onecolabstract}
654 % An environment for typesetting a single column abstract,
655 % particularly as the optional
656 % argument to the |\twocolumn| command.
657 % \begin{macrocode}
658 \newenvironment{onecolabstract}{%
659 \begin{@twocolumnfalse}\begin{abstract}}{%
660 \end{abstract}\end{@twocolumnfalse}}
661 % \end{macrocode}
662 % \end{environment}
663 %
664 % \begin{macro}{\appendiargdef}
665 % |\appendiargdef{\macro}{Additional stuff}| will add |Additional stuff| at
666 % the end of the definition of |\macro|, where |\macro| is a macro that has
667 % one argument.\footnote{Code suggestions for this were made by Michael Downes
668 % (\texttt{[email protected]}) and Heiko Oberdiek
669 % (\texttt{[email protected]}) on \texttt{ctt}.}
670 % \begin{macrocode}
671 \providecommand{\appendiargdef}[2]{\begingroup
672 \toks@\expandafter{#1{##1}#2}%
673 \edef\@bsx{\endgroup \def\noexpand#1####1{\the\toks@}}%
674 \@bsx}
675 % \end{macrocode}
676 % \end{macro}
677 %
678 % \begin{macro}{\thanks}
679 % \begin{macro}{\@bs@thanks}
680 % We have to keep the contents of the |\thanks| commands as normally these
681 % are emptied by the |\maketitle| command. I do this by extending the definition
682 % of the |\thanks| (from \file{ltsect.dtx}) command,
683 % so that |\@bs@thanks| has a copy of the contents
684 % of |\@thanks|.
685 % \begin{macrocode}
686 \appendiargdef{\thanks}{%
687 \protected@xdef\@bs@thanks{\@bs@thanks
688 \protect\footnotetext[\the\c@footnote]{#1}}%
689 }
690 \let\@bs@thanks\@empty
691 % \end{macrocode}
692 % \end{macro}
693 % \end{macro}
694 %
695 % \begin{macro}{\saythanks}
696 % This macro typesets any |\thanks| commands \emph{after} using
697 % |onecolabstract|.
698 % \begin{macrocode}
699 \newcommand{\saythanks}{\begingroup
700 \renewcommand{\thefootnote}{\fnsymbol{footnote}}\@bs@thanks
701 \endgroup\global\let\@bs@thanks\@empty}
702 % \end{macrocode}
703 % \end{macro}
704 %
705 %
706 % The end of this package.
707 % \begin{macrocode}
708 %</usc>
709 % \end{macrocode}
710 %
711 %
712 %
713 %
714 % \Finale
715 % \PrintIndex
716 %
717 \endinput
718 %% \CharacterTable
719 %% {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
720 %% 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
721 %% Digits \0\1\2\3\4\5\6\7\8\9
722 %% Exclamation \! Double quote \" Hash (number) \#
723 %% Dollar \$ Percent \% Ampersand \&
724 %% Acute accent \' Left paren \( Right paren \)
725 %% Asterisk \* Plus \+ Comma \,
726 %% Minus \- Point \. Solidus \/
727 %% Colon \: Semicolon \; Less than \<
728 %% Equals \= Greater than \> Question mark \?
729 %% Commercial at \@ Left bracket \[ Backslash \\
730 %% Right bracket \] Circumflex \^ Underscore \_
731 %% Grave accent \` Left brace \{ Vertical bar \|
732 %% Right brace \} Tilde \~}
733
734