| 1 |
% \iffalse meta-comment |
| 2 |
% |
| 3 |
% Copyright (C) 1993-2025 |
| 4 |
% The LaTeX Project and any individual authors listed elsewhere |
| 5 |
% in this file. |
| 6 |
% |
| 7 |
% This file is part of the LaTeX base system. |
| 8 |
% ------------------------------------------- |
| 9 |
% |
| 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 |
% https://www.latex-project.org/lppl.txt |
| 15 |
% and version 1.3c or later is part of all distributions of LaTeX |
| 16 |
% version 2008 or later. |
| 17 |
% |
| 18 |
% This file has the LPPL maintenance status "maintained". |
| 19 |
% |
| 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 |
| 22 |
% information. |
| 23 |
% |
| 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. |
| 27 |
% |
| 28 |
% \fi |
| 29 |
% |
| 30 |
% \iffalse |
| 31 |
%%% From File: ltpar.dtx |
| 32 |
% |
| 33 |
%<*driver> |
| 34 |
% \fi |
| 35 |
\ProvidesFile{ltpar.dtx} |
| 36 |
[2021/04/13 v1.1c LaTeX Kernel (paragraphs)] |
| 37 |
% \iffalse |
| 38 |
\documentclass{ltxdoc} |
| 39 |
\GetFileInfo{ltpar.dtx} |
| 40 |
\title{\filename} |
| 41 |
\date{\filedate} |
| 42 |
\author{% |
| 43 |
Johannes Braams\and |
| 44 |
David Carlisle\and |
| 45 |
Alan Jeffrey\and |
| 46 |
Leslie Lamport\and |
| 47 |
Frank Mittelbach\and |
| 48 |
Tobias Oetiker \thanks{Tobi did the documentation update}\and |
| 49 |
Chris Rowley\and |
| 50 |
Rainer Sch\"opf} |
| 51 |
\begin{document} |
| 52 |
\MaintainedByLaTeXTeam{latex} |
| 53 |
\maketitle |
| 54 |
\DocInput{\filename} |
| 55 |
\end{document} |
| 56 |
%</driver> |
| 57 |
% \fi |
| 58 |
% |
| 59 |
% |
| 60 |
% |
| 61 |
% \changes{v1.1a}{1994/05/16}{(ASAJ) Split from ltinit.dtx.} |
| 62 |
% \changes{v1.1b}{1995/04/29}{(TO) Comments clean-up.} |
| 63 |
% |
| 64 |
% \section{Paragraphs} |
| 65 |
% |
| 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. |
| 69 |
% |
| 70 |
% This file here describes the interfaces that have been in the kernel |
| 71 |
% forever, used to implement the scenarios described below. They |
| 72 |
% remain valid but are now augmented in the next file |
| 73 |
% (\texttt{ltpara.dtx}) to add hooks to paragraphs. At some point we |
| 74 |
% will consolidate the two files further. |
| 75 |
% |
| 76 |
% |
| 77 |
% There are two situations in which |\par| may be changed: |
| 78 |
% |
| 79 |
% \begin{itemize} |
| 80 |
% \item Long-term changes, in which the new value is to remain in effect |
| 81 |
% until the current environment is left. The environments that |
| 82 |
% change |\par| in this way are the following: |
| 83 |
% \begin{itemize} |
| 84 |
% \item All list environments (itemize, quote, etc.) |
| 85 |
% \item Environments that turn |\par| into a noop: |
| 86 |
% tabbing, array and tabular. |
| 87 |
% \end{itemize} |
| 88 |
% \item Temporary changes, in which |\par| is restored to its previous |
| 89 |
% value the next time it is executed. The following are all such uses. |
| 90 |
% \begin{itemize} |
| 91 |
% \item |\end| when preceded by |\@endparenv|, which is called by |
| 92 |
% |\endtrivlist| |
| 93 |
% \item The mechanism for avoiding page breaks and getting the |
| 94 |
% spacing right after section heads. |
| 95 |
% \end{itemize} |
| 96 |
% \end{itemize} |
| 97 |
% |
| 98 |
% |
| 99 |
% \MaybeStop{} |
| 100 |
% |
| 101 |
% \subsection{Implementation} |
| 102 |
% |
| 103 |
% |
| 104 |
% \DescribeMacro{\@setpar} |
| 105 |
% To permit the proper interaction of these two situations, long-term |
| 106 |
% changes are made by the |\@setpar{|\meta{VAL}|}| command. |
| 107 |
% It's function is: |
| 108 |
% \begin{quote} |
| 109 |
% To set |\par|. It |\def|'s |\par| and |\@par| to \meta{VAL}. |
| 110 |
% \end{quote} |
| 111 |
% |
| 112 |
% \DescribeMacro{\@restorepar} |
| 113 |
% Short-term changes are made by the usual |\def\par| commands. |
| 114 |
% The original values are restored after a short-term change |
| 115 |
% by the |\@restorepar| commands. |
| 116 |
% |
| 117 |
% \DescribeMacro{\@@par} |
| 118 |
% |\@@par| always is defined to be the original \TeX{} |\par|. |
| 119 |
% |
| 120 |
% \DescribeMacro{\everypar} |
| 121 |
% |\everypar| is changed only for the short term. Whenever |\everypar| |
| 122 |
% is set non-null, it should restore itself to null when executed. |
| 123 |
% |
| 124 |
% The following commands change |\everypar| in this way: |
| 125 |
% \begin{itemize} |
| 126 |
% \item |\item| |
| 127 |
% \item |\end| when preceded by |\@endparenv|, which is called by |
| 128 |
% |endtrivlist| |
| 129 |
% \item |\minipage| |
| 130 |
% \end{itemize} |
| 131 |
% |
| 132 |
% When dealing with |\par| and |\everypar| remember the following two |
| 133 |
% warnings: |
| 134 |
% \begin{enumerate} |
| 135 |
% \item Commands that make short-term changes to |\par| and |\everypar| |
| 136 |
% must take account of the possibility that the new commands and the |
| 137 |
% ones that do the restoration may be executed inside a group. In |
| 138 |
% particular, |\everypar| is executed inside a group whenever a new |
| 139 |
% paragraph begins with a left brace. The |\everypar| command |
| 140 |
% that restores its definition should be local to the current |
| 141 |
% group (in case the command |
| 142 |
% is inside a minipage used inside someplace where |\everypar| has |
| 143 |
% been redefined). Thus, if |\everypar| is redefined to do an |
| 144 |
% |\everypar{}| it could take several executions of |\everypar| |
| 145 |
% before the restoration ``holds''. This usually causes no problem. |
| 146 |
% However, to prevent the extra executions from doing harm, |
| 147 |
% use a global switch to keep anything harmful in the new |
| 148 |
% |\everypar| from being done twice. |
| 149 |
% \item Commands that change |\everypar| should remember that |
| 150 |
% |\everypar| might be supposed to set the following switches false: |
| 151 |
% \begin{itemize} |
| 152 |
% \item |@nobreak| |
| 153 |
% \item |@minipage| |
| 154 |
% \end{itemize} |
| 155 |
% they should do the setting if necessary. |
| 156 |
% \end{enumerate} |
| 157 |
% \begin{macrocode} |
| 158 |
%<*2ekernel> |
| 159 |
\message{par,} |
| 160 |
% \end{macrocode} |
| 161 |
% |
| 162 |
% |
| 163 |
% \begin{macro}{\@setpar} |
| 164 |
% \begin{macro}{\@par} |
| 165 |
% Initiate a long-term change to |\par|. |
| 166 |
% \begin{macrocode} |
| 167 |
\def\@setpar#1{\def\par{#1}\def\@par{#1}} |
| 168 |
% \end{macrocode} |
| 169 |
% |
| 170 |
% The default definition of |\@par| will ensure that if |
| 171 |
% |\@restorepar| defines |\par| to execute |\@par| it will redefine |
| 172 |
% itself to the primitive |\@@par| after one iteration. |
| 173 |
% \begin{macrocode} |
| 174 |
\def\@par{\let\par\@@par\par} |
| 175 |
% \end{macrocode} |
| 176 |
% \end{macro} |
| 177 |
% \end{macro} |
| 178 |
% |
| 179 |
% \begin{macro}{\@restorepar} |
| 180 |
% Restore from a short-term change to |\par|. |
| 181 |
% \begin{macrocode} |
| 182 |
\def\@restorepar{\def\par{\@par}} |
| 183 |
%</2ekernel> |
| 184 |
% \end{macrocode} |
| 185 |
% \end{macro} |
| 186 |
% |
| 187 |
% \Finale |
| 188 |
\endinput |
| 189 |
|