1 % \iffalse meta-comment
4 % The LaTeX3 Project and any individual authors listed elsewhere
7 % This file is part of the LaTeX base system.
8 % -------------------------------------------
10 % It may be distributed and/or modified under the
11 % conditions of the LaTeX Project Public License, either version 1.3c
12 % of this license or (at your option) any later version.
13 % The latest version of this license is in
14 % http://www.latex-project.org/lppl.txt
15 % and version 1.3c or later is part of all distributions of LaTeX
16 % version 2005/12/01 or later.
18 % This file has the LPPL maintenance status "maintained".
20 % The list of all files belonging to the LaTeX base distribution is
21 % given in the file `manifest.txt'. See also `legal.txt' for additional
24 % The list of derived (unpacked) files belonging to the distribution
25 % and covered by LPPL is defined by the unpacking scripts (with
26 % extension .ins) which are part of the distribution.
31 %%% From File: ltpar.dtx
35 \ProvidesFile{ltpar.dtx}
36 [1995/04/29 v1.1c LaTeX Kernel (paragraphs)]
38 \documentclass{ltxdoc}
39 \GetFileInfo{ltpar.dtx}
48 Tobias Oetiker \thanks{Tobi did the documentation update}\and
52 \MaintainedByLaTeXTeam{latex}
61 % \changes{v1.1a}{1994/05/16}{(ASAJ) Split from ltinit.dtx.}
62 % \changes{v1.1b}{1995/04/29}{(TO) Comments clean-up.}
64 % \section{Paragraphs}
66 % This section of the kernel declares the commands used to set
67 % |\par| and |\everypar| when ever their function needs to be
68 % changed for a long time.
72 % \subsection{Implementation}
75 % There are two situations in which |\par| may be changed:
78 % \item Long-term changes, in which the new value is to remain in effect
79 % until the current environment is left. The environments that
80 % change |\par| in this way are the following:
82 % \item All list environments (itemize, quote, etc.)
83 % \item Environments that turn |\par| into a noop:
84 % tabbing, array and tabular.
86 % \item Temporary changes, in which |\par| is restored to its previous
87 % value the next time it is executed. The following are all such uses.
89 % \item |\end| when preceded by |\@endparenv|, which is called by
91 % \item The mechanism for avoiding page breaks and getting the
92 % spacing right after section heads.
96 % \DescribeMacro{\@setpar}
97 % To permit the proper interaction of these two situations, long-term
98 % changes are made by the |\@setpar{|\meta{VAL}|}| command.
101 % To set |\par|. It |\def|'s |\par| and |\@par| to \meta{VAL}.
104 % \DescribeMacro{\@restorepar}
105 % Short-term changes are made by the usual |\def\par| commands.
106 % The original values are restored after a short-term change
107 % by the |\@restorepar| commands.
109 % \DescribeMacro{\@@par}
110 % |\@@par| always is defined to be the original \TeX{} |\par|.
112 % \DescribeMacro{\everypar}
113 % |\everypar| is changed only for the short term. Whenever |\everypar|
114 % is set non-null, it should restore itself to null when executed.
116 % The following commands change |\everypar| in this way:
119 % \item |\end| when preceded by |\@endparenv|, which is called by
124 % When dealing with |\par| and |\everypar| remember the following two
127 % \item Commands that make short-term changes to |\par| and |\everypar|
128 % must take account of the possibility that the new commands and the
129 % ones that do the restoration may be executed inside a group. In
130 % particular, |\everypar| is executed inside a group whenever a new
131 % paragraph begins with a left brace. The |\everypar| command
132 % that restores its definition should be local to the current
133 % group (in case the command
134 % is inside a minipage used inside someplace where |\everypar| has
135 % been redefined). Thus, if |\everypar| is redefined to do an
136 % |\everypar{}| it could take several executions of |\everypar|
137 % before the restoration ``holds''. This usually causes no problem.
138 % However, to prevent the extra executions from doing harm,
139 % use a global switch to keep anything harmful in the new
140 % |\everypar| from being done twice.
141 % \item Commands that change |\everypar| should remember that
142 % |\everypar| might be supposed to set the following switches false:
147 % they should do the setting if necessary.
155 % \begin{macro}{\@setpar}
156 % \begin{macro}{\@par}
157 % Initiate a long-term change to |\par|.
159 \def\@setpar#1{\def\par{#1}\def\@par{#1}}
162 % The default definition of |\@par| will ensure that if
163 % |\@restorepar| defines |\par| to execute |\@par| it will redefine
164 % itself to the primitive |\@@par| after one iteration.
166 \def\@par{\let\par\@@par\par}
172 % \begin{macro}{\@restorepar}
173 % Restore from a short-term change to |\par|.
175 \def\@restorepar{\def\par{\@par}}