Debian Codegraph @

texmf-dist/tex/generic/oberdiek/setouterhbox.sty

raw
1 %%
2 %% This is file `setouterhbox.sty',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% setouterhbox.dtx (with options: `package')
8 %%
9 %% This is a generated file.
10 %%
11 %% Project: setouterhbox
12 %% Version: 2016/05/16 v1.8
13 %%
14 %% Copyright (C)
15 %% 2005-2007 Heiko Oberdiek
16 %% 2016-2019 Oberdiek Package Support Group
17 %%
18 %% This work may be distributed and/or modified under the
19 %% conditions of the LaTeX Project Public License, either
20 %% version 1.3c of this license or (at your option) any later
21 %% version. This version of this license is in
22 %% https://www.latex-project.org/lppl/lppl-1-3c.txt
23 %% and the latest version of this license is in
24 %% https://www.latex-project.org/lppl.txt
25 %% and version 1.3 or later is part of all distributions of
26 %% LaTeX version 2005/12/01 or later.
27 %%
28 %% This work has the LPPL maintenance status "maintained".
29 %%
30 %% The Current Maintainers of this work are
31 %% Heiko Oberdiek and the Oberdiek Package Support Group
32 %% https://github.com/ho-tex/oberdiek/issues
33 %%
34 %%
35 %% The Base Interpreter refers to any `TeX-Format',
36 %% because some files are installed in TDS:tex/generic//.
37 %%
38 %% This work consists of the main source file setouterhbox.dtx
39 %% and the derived files
40 %% setouterhbox.sty, setouterhbox.pdf, setouterhbox.ins, setouterhbox.drv,
41 %% setouterhbox-example.tex, setouterhbox-test1.tex,
42 %% setouterhbox-test2.tex.
43 %%
44 \begingroup\catcode61\catcode48\catcode32=10\relax%
45 \catcode13=5 % ^^M
46 \endlinechar=13 %
47 \catcode35=6 % #
48 \catcode39=12 % '
49 \catcode44=12 % ,
50 \catcode45=12 % -
51 \catcode46=12 % .
52 \catcode58=12 % :
53 \catcode64=11 % @
54 \catcode123=1 % {
55 \catcode125=2 % }
56 \expandafter\let\expandafter\x\csname [email protected]\endcsname
57 \ifx\x\relax % plain-TeX, first loading
58 \else
59 \def\empty{}%
60 \ifx\x\empty % LaTeX, first loading,
61 % variable is initialized, but \ProvidesPackage not yet seen
62 \else
63 \expandafter\ifx\csname PackageInfo\endcsname\relax
64 \def\x#1#2{%
65 \immediate\write-1{Package #1 Info: #2.}%
66 }%
67 \else
68 \def\x#1#2{\PackageInfo{#1}{#2, stopped}}%
69 \fi
70 \x{setouterhbox}{The package is already loaded}%
71 \aftergroup\endinput
72 \fi
73 \fi
74 \endgroup%
75 \begingroup\catcode61\catcode48\catcode32=10\relax%
76 \catcode13=5 % ^^M
77 \endlinechar=13 %
78 \catcode35=6 % #
79 \catcode39=12 % '
80 \catcode40=12 % (
81 \catcode41=12 % )
82 \catcode44=12 % ,
83 \catcode45=12 % -
84 \catcode46=12 % .
85 \catcode47=12 % /
86 \catcode58=12 % :
87 \catcode64=11 % @
88 \catcode91=12 % [
89 \catcode93=12 % ]
90 \catcode123=1 % {
91 \catcode125=2 % }
92 \expandafter\ifx\csname ProvidesPackage\endcsname\relax
93 \def\x#1#2#3[#4]{\endgroup
94 \immediate\write-1{Package: #3 #4}%
95 \xdef#1{#4}%
96 }%
97 \else
98 \def\x#1#2[#3]{\endgroup
99 #2[{#3}]%
100 \ifx#1\@undefined
101 \xdef#1{#3}%
102 \fi
103 \ifx#1\relax
104 \xdef#1{#3}%
105 \fi
106 }%
107 \fi
108 \expandafter\x\csname [email protected]\endcsname
109 \ProvidesPackage{setouterhbox}%
110 [2016/05/16 v1.8 Set hbox in outer horizontal mode (HO)]%
111 \begingroup\catcode61\catcode48\catcode32=10\relax%
112 \catcode13=5 % ^^M
113 \endlinechar=13 %
114 \catcode123=1 % {
115 \catcode125=2 % }
116 \catcode64=11 % @
117 \def\x{\endgroup
118 \expandafter\edef\csname setouterhboxAtEnd\endcsname{%
119 \endlinechar=\the\endlinechar\relax
120 \catcode13=\the\catcode13\relax
121 \catcode32=\the\catcode32\relax
122 \catcode35=\the\catcode35\relax
123 \catcode61=\the\catcode61\relax
124 \catcode64=\the\catcode64\relax
125 \catcode123=\the\catcode123\relax
126 \catcode125=\the\catcode125\relax
127 }%
128 }%
129 \x\catcode61\catcode48\catcode32=10\relax%
130 \catcode13=5 % ^^M
131 \endlinechar=13 %
132 \catcode35=6 % #
133 \catcode64=11 % @
134 \catcode123=1 % {
135 \catcode125=2 % }
136 \def\TMP@EnsureCode#1#2{%
137 \edef\setouterhboxAtEnd{%
138 \setouterhboxAtEnd
139 \catcode#1=\the\catcode#1\relax
140 }%
141 \catcode#1=#2\relax
142 }
143 \TMP@EnsureCode{40}{12}% (
144 \TMP@EnsureCode{41}{12}% )
145 \TMP@EnsureCode{44}{12}% ,
146 \TMP@EnsureCode{45}{12}% -
147 \TMP@EnsureCode{46}{12}% .
148 \TMP@EnsureCode{47}{12}% /
149 \TMP@EnsureCode{58}{12}% :
150 \TMP@EnsureCode{60}{12}% <
151 \TMP@EnsureCode{62}{12}% >
152 \TMP@EnsureCode{91}{12}% [
153 \TMP@EnsureCode{93}{12}% ]
154 \TMP@EnsureCode{96}{12}% `
155 \edef\setouterhboxAtEnd{\setouterhboxAtEnd\noexpand\endinput}
156 \newbox\setouterhboxBox
157 \begingroup\expandafter\expandafter\expandafter\endgroup
158 \expandafter\ifx\csname RequirePackage\endcsname\relax
159 \input infwarerr.sty\relax
160 \else
161 \RequirePackage{infwarerr}[2016/05/16]%
162 \fi
163 \edef\setouterhboxFailure#1#2{%
164 \expandafter\noexpand\csname @PackageError\endcsname
165 {setouterhbox}{#1}{#2}%
166 }
167 \begingroup\expandafter\expandafter\expandafter\endgroup
168 \expandafter\ifx\csname lastnodetype\endcsname\relax
169 \catcode`T=9 % ignore
170 \catcode`E=14 % comment
171 \else
172 \catcode`T=14 % comment
173 \catcode`E=9 % ignore
174 \fi
175 \def\setouterhboxRemove{%
176 E \ifnum\lastnodetype<11 %
177 E \else
178 E \ifnum\lastnodetype>13 %
179 E \else
180 \unskip\unkern\unpenalty
181 E \expandafter\expandafter\expandafter\setouterhboxRemove
182 E \fi
183 E \fi
184 }%
185 \def\setouterhbox#1{%
186 \begingroup
187 \def\setouterhboxNum{#1}%
188 \setbox0\vbox\bgroup
189 T \kern.123pt\relax % marker
190 T \kern0pt\relax % removed by \setouterhboxRemove
191 \begingroup
192 \everypar{}%
193 \noindent
194 }
195 \def\endsetouterhbox{%
196 \endgroup
197 \pretolerance-1 %
198 \tolerance10000 %
199 \hsize\maxdimen
200 \parfillskip 0pt plus 1filll\relax
201 \leftskip0pt\relax
202 \rightskip0pt plus 1fil\relax
203 \everypar{}%
204 \kern0pt%
205 \endgraf
206 \setouterhboxRemove
207 E \ifnum\lastnodetype=1 %
208 E \global\setbox\setouterhboxBox\lastbox
209 E \loop
210 E \setouterhboxRemove
211 E \ifnum\lastnodetype=1 %
212 E \setbox0=\lastbox
213 E \global\setbox\setouterhboxBox=\hbox{%
214 E \unhbox0 %
215 E \unskip
216 E \unhbox\setouterhboxBox
217 E }%
218 E \repeat
219 E \else
220 E \setouterhboxFailure{%
221 E Something is wrong%
222 E }{%
223 E Could not find expected line.%
224 E \MessageBreak
225 E (\string\lastnodetype: \number\lastnodetype, expected: 1)%
226 E }%
227 E \fi
228 E \setouterhboxRemove
229 T \global\setbox\setouterhboxBox\lastbox
230 T \loop
231 T \setouterhboxRemove
232 T \setbox0=\lastbox
233 T \ifcase\ifvoid0 1\else0\fi
234 T \global\setbox\setouterhboxBox=\hbox{%
235 T \unhbox0 %
236 T \unskip
237 T \unhbox\setouterhboxBox
238 T }%
239 T \repeat
240 T \ifdim.123pt=\lastkern
241 T \else
242 T \setouterhboxFailure{%
243 T Something is wrong%
244 T }{%
245 T Unexpected stuff was detected before the line.%
246 T }%
247 T \fi
248 T \egroup
249 T \ifcase \ifnum\wd0=0 \else 1\fi
250 T \ifdim\ht0=.123pt \else 1\fi
251 T \ifnum\dp0=0 \else 1\fi
252 T 0 %
253 E \ifnum\lastnodetype=-1 %
254 \else
255 \setouterhboxFailure{%
256 Something is wrong%
257 }{%
258 After fetching the line there is more unexpected stuff.%
259 E \MessageBreak
260 E (\string\lastnodetype: \number\lastnodetype, expected: -1)%
261 }%
262 \fi
263 E \egroup
264 \expandafter\endgroup
265 \expandafter\setouterhboxFinish\expandafter{%
266 \number\setouterhboxNum
267 }%
268 }
269 \def\setouterhboxCurr{setouterhbox}
270 \def\setouterhboxLast#1{%
271 \setbox#1\hbox{%
272 \unhbox\setouterhboxBox
273 \unskip % remove \rightskip glue
274 \unskip % remove \parfillskip glue
275 \unpenalty % remove paragraph ending \penalty 10000
276 \unkern % remove explicit kern inserted above
277 }%
278 }
279 \def\setouterhboxFinish#1{%
280 \begingroup\expandafter\expandafter\expandafter\endgroup
281 \expandafter\ifx\csname @currenvir\endcsname\setouterhboxCurr
282 \aftergroup\setouterhboxLast
283 \aftergroup{%
284 \setouterhboxAfter #1\NIL
285 \aftergroup}%
286 \else
287 \setouterhboxLast{#1}%
288 \fi
289 }
290 \def\setouterhboxAfter#1#2\NIL{%
291 \aftergroup#1%
292 \ifx\\#2\\%
293 \else
294 \setouterhboxReturnAfterFi{%
295 \setouterhboxAfter#2\NIL
296 }%
297 \fi
298 }
299 \long\def\setouterhboxReturnAfterFi#1\fi{\fi#1}
300 \catcode69=11\relax % E
301 \catcode84=11\relax % T
302 \begingroup
303 \def\x{LaTeX2e}%
304 \expandafter\endgroup
305 \ifx\x\fmtname
306 \else
307 \expandafter\setouterhboxAtEnd
308 \fi%
309 \DeclareOption{hyperref}{%
310 \long\def\Hy@setouterhbox#1#2{%
311 \setouterhbox{#1}#2\endsetouterhbox
312 }%
313 }
314 \ProcessOptions\relax
315 \setouterhboxAtEnd%
316 %% \section{Installation}
317 \endinput
318 %%
319 %% End of file `setouterhbox.sty'.