Debian Codegraph @

texmf-dist/tex/latex/oberdiek/resizegather.sty

raw
1 %%
2 %% This is file `resizegather.sty',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% resizegather.dtx (with options: `package')
8 %%
9 %% This is a generated file.
10 %%
11 %% Project: resizegather
12 %% Version: 2016/05/16 v1.3
13 %%
14 %% Copyright (C)
15 %% 2009, 2010 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 %% This work consists of the main source file resizegather.dtx
36 %% and the derived files
37 %% resizegather.sty, resizegather.pdf, resizegather.ins, resizegather.drv,
38 %% resizegather-test1.tex.
39 %%
40 \begingroup\catcode61\catcode48\catcode32=10\relax%
41 \catcode13=5 % ^^M
42 \endlinechar=13 %
43 \catcode35=6 % #
44 \catcode39=12 % '
45 \catcode44=12 % ,
46 \catcode45=12 % -
47 \catcode46=12 % .
48 \catcode58=12 % :
49 \catcode64=11 % @
50 \catcode123=1 % {
51 \catcode125=2 % }
52 \expandafter\let\expandafter\x\csname [email protected]\endcsname
53 \ifx\x\relax % plain-TeX, first loading
54 \else
55 \def\empty{}%
56 \ifx\x\empty % LaTeX, first loading,
57 % variable is initialized, but \ProvidesPackage not yet seen
58 \else
59 \expandafter\ifx\csname PackageInfo\endcsname\relax
60 \def\x#1#2{%
61 \immediate\write-1{Package #1 Info: #2.}%
62 }%
63 \else
64 \def\x#1#2{\PackageInfo{#1}{#2, stopped}}%
65 \fi
66 \x{resizegather}{The package is already loaded}%
67 \aftergroup\endinput
68 \fi
69 \fi
70 \endgroup%
71 \begingroup\catcode61\catcode48\catcode32=10\relax%
72 \catcode13=5 % ^^M
73 \endlinechar=13 %
74 \catcode35=6 % #
75 \catcode39=12 % '
76 \catcode40=12 % (
77 \catcode41=12 % )
78 \catcode44=12 % ,
79 \catcode45=12 % -
80 \catcode46=12 % .
81 \catcode47=12 % /
82 \catcode58=12 % :
83 \catcode64=11 % @
84 \catcode91=12 % [
85 \catcode93=12 % ]
86 \catcode123=1 % {
87 \catcode125=2 % }
88 \expandafter\ifx\csname ProvidesPackage\endcsname\relax
89 \def\x#1#2#3[#4]{\endgroup
90 \immediate\write-1{Package: #3 #4}%
91 \xdef#1{#4}%
92 }%
93 \else
94 \def\x#1#2[#3]{\endgroup
95 #2[{#3}]%
96 \ifx#1\@undefined
97 \xdef#1{#3}%
98 \fi
99 \ifx#1\relax
100 \xdef#1{#3}%
101 \fi
102 }%
103 \fi
104 \expandafter\x\csname [email protected]\endcsname
105 \ProvidesPackage{resizegather}%
106 [2016/05/16 v1.3 Resize overly large equations (HO)]%
107 \begingroup\catcode61\catcode48\catcode32=10\relax%
108 \catcode13=5 % ^^M
109 \endlinechar=13 %
110 \catcode123=1 % {
111 \catcode125=2 % }
112 \catcode64=11 % @
113 \def\x{\endgroup
114 \expandafter\edef\csname ResizeGather@AtEnd\endcsname{%
115 \endlinechar=\the\endlinechar\relax
116 \catcode13=\the\catcode13\relax
117 \catcode32=\the\catcode32\relax
118 \catcode35=\the\catcode35\relax
119 \catcode61=\the\catcode61\relax
120 \catcode64=\the\catcode64\relax
121 \catcode123=\the\catcode123\relax
122 \catcode125=\the\catcode125\relax
123 }%
124 }%
125 \x\catcode61\catcode48\catcode32=10\relax%
126 \catcode13=5 % ^^M
127 \endlinechar=13 %
128 \catcode35=6 % #
129 \catcode64=11 % @
130 \catcode123=1 % {
131 \catcode125=2 % }
132 \def\TMP@EnsureCode#1#2{%
133 \edef\ResizeGather@AtEnd{%
134 \ResizeGather@AtEnd
135 \catcode#1=\the\catcode#1\relax
136 }%
137 \catcode#1=#2\relax
138 }
139 \TMP@EnsureCode{10}{12}% ^^J
140 \TMP@EnsureCode{33}{12}% !
141 \TMP@EnsureCode{36}{3}% $
142 \TMP@EnsureCode{38}{4}% &
143 \TMP@EnsureCode{39}{12}% '
144 \TMP@EnsureCode{40}{12}% (
145 \TMP@EnsureCode{41}{12}% )
146 \TMP@EnsureCode{42}{12}% *
147 \TMP@EnsureCode{43}{12}% +
148 \TMP@EnsureCode{44}{12}% ,
149 \TMP@EnsureCode{45}{12}% -
150 \TMP@EnsureCode{46}{12}% .
151 \TMP@EnsureCode{47}{12}% /
152 \TMP@EnsureCode{58}{12}% :
153 \TMP@EnsureCode{59}{12}% ;
154 \TMP@EnsureCode{60}{12}% <
155 \TMP@EnsureCode{62}{12}% >
156 \TMP@EnsureCode{63}{12}% ?
157 \TMP@EnsureCode{91}{12}% [
158 \TMP@EnsureCode{93}{12}% ]
159 \TMP@EnsureCode{94}{7}% ^ (superscript)
160 \TMP@EnsureCode{96}{12}% `
161 \edef\ResizeGather@AtEnd{\ResizeGather@AtEnd\noexpand\endinput}
162 \RequirePackage{kvoptions}[2009/12/04]
163 \SetupKeyvalOptions{%
164 family=resizegather,%
165 prefix=ResizeGather@,%
166 }
167 \@for\ResizeGather@option:=%
168 centertags,%
169 tbtags,%
170 sumlimits,%
171 nosumlimits,%
172 intlimits,%
173 nointlimits,%
174 nonamelimits,%
175 leqno,%
176 reqno,%
177 fleqn%
178 \do{%
179 \edef\ResizeGather@temp{%
180 \noexpand\DeclareVoidOption{\ResizeGather@option}{%
181 \noexpand\PassOptionsToPackage{amsmath}{\ResizeGather@option}%
182 }%
183 \noexpand\AtEndOfPackage{%
184 \noexpand\DisableKeyvalOption[%
185 action=error,%
186 package=resizegather,%
187 ]{resizegather}{\ResizeGather@option}%
188 }%
189 }%
190 \ResizeGather@temp
191 }
192 \@for\ResizeGather@option:=%
193 draft,%
194 final,%
195 hiderotate,%
196 hidescale,%
197 hiresbb,%
198 demo,%
199 dvips,xdvi,dvipdf,dvipdfm,dvipdfmx,pdftex,dvipsone,%
200 dviwindo,emtex,dviwin,pctexps,pctexwin,pctexhp,pctex32,%
201 truetex,tcidvi,vtex,oztex,textures,xetex%
202 \do{%
203 \edef\ResizeGather@temp{%
204 \noexpand\DeclareVoidOption{\ResizeGather@option}{%
205 \noexpand\PassOptionsToPackage{graphics}{\ResizeGather@option}%
206 }%
207 \noexpand\AtEndOfPackage{%
208 \noexpand\DisableKeyvalOption[%
209 action=error,%
210 package=resizegather,%
211 ]{resizegather}{\ResizeGather@option}%
212 }%
213 }%
214 \ResizeGather@temp
215 }
216 \DeclareBoolOption[true]{enable}
217 \DeclareComplementaryOption{disable}{enable}
218 \DeclareStringOption[.05]{warningthreshold}
219 \newif\ifResizeGather@NeedInit
220 \DeclareBoolOption[true]{equations}
221 \DeclareBoolOption[true]{equation}
222 \DeclareBoolOption[true]{displaymath}
223 \AddToKeyvalOption*{equations}{%
224 \ResizeGather@NeedInittrue
225 \ifResizeGather@equations
226 \ResizeGather@equationtrue
227 \ResizeGather@displaymathtrue
228 \else
229 \ResizeGather@equationfalse
230 \ResizeGather@displaymathfalse
231 \fi
232 }
233 \AddToKeyvalOption*{equation}{%
234 \ResizeGather@NeedInittrue
235 }
236 \AddToKeyvalOption*{displaymath}{%
237 \ResizeGather@NeedInittrue
238 }
239 \newcommand*{\resizegathersetup}[1]{%
240 \ResizeGather@NeedInitfalse
241 \setkeys{resizegather}{#1}%
242 \ifResizeGather@NeedInit
243 \ResizeGather@init
244 \fi
245 }
246 \let\ResizeGather@init\relax
247 \InputIfFileExists{resizegather.cfg}{}{}%
248 \ProcessKeyvalOptions*\relax
249 \RequirePackage{amsmath}
250 \RequirePackage{graphics}
251 \def\ResizeGather@redefine#1#2#3#4#5{%
252 \csname ifResizeGather@#1\endcsname
253 \@ifundefined{ResizeGather@org@#2}{%
254 \expandafter\let\csname ResizeGather@org@#2\expandafter\endcsname
255 \csname #2\endcsname
256 }{}%
257 \@ifundefined{ResizeGather@org@#3}{%
258 \expandafter\let\csname ResizeGather@org@#3\expandafter\endcsname
259 \csname #3\endcsname
260 }{}%
261 \expandafter\edef\csname #2\endcsname{%
262 \expandafter\noexpand\csname#4\endcsname
263 }%
264 \expandafter\edef\csname #3\endcsname{%
265 \expandafter\noexpand\csname#5\endcsname
266 }%
267 \else
268 \@ifundefined{ResizeGather@org@#2}{}{%
269 \expandafter\let\csname #2\expandafter\endcsname
270 \csname ResizeGather@org@#2\endcsname
271 \expandafter\let\csname #3\expandafter\endcsname
272 \csname ResizeGather@org@#3\endcsname
273 }%
274 \fi
275 }
276 \def\ResizeGather@init{%
277 \ResizeGather@redefine{equation}{equation}{endequation}%
278 {gather}{endgather}%
279 \ResizeGather@redefine{displaymath}{displaymath}{enddisplaymath}%
280 {gather*}{endgather*}%
281 }
282 \ResizeGather@init
283 \def\ResizeGather@ResizeGather{%
284 \ifResizeGather@enable
285 \dimen@\displaywidth
286 \if@fleqn
287 \advance\dimen@-\@mathmargin
288 \fi
289 \ifdim\wdz@>\dimen@
290 \begingroup
291 \advance\dimen@ -\wdz@
292 \dimen@ -\dimen@
293 \ifdim\ResizeGather@warningthreshold\wdz@>\dimen@
294 \expandafter\PackageInfo
295 \else
296 \expandafter\PackageWarning
297 \fi
298 {resizegather}{%
299 Equation line \the\row@\space is too large %
300 by \the\dimen@\MessageBreak
301 in environment `\@currenvir'%
302 }%
303 \endgroup
304 \setboxz@h to\dimen@{%
305 \resizebox{\dimen@}{!}{\boxz@}%
306 \hss
307 }%
308 \fi
309 \fi
310 }
311 \expandafter\def\expandafter\calc@shift@gather\expandafter{%
312 \expandafter\ResizeGather@ResizeGather
313 \calc@shift@gather
314 }
315 \let\ResizeGather@org@gmeasure@\gmeasure@
316 \def\gmeasure@#1{%
317 \ResizeGather@org@gmeasure@{#1}%
318 \ifResizeGather@enable
319 \ifdim\totwidth@>\displaywidth
320 \totwidth@=\displaywidth
321 \fi
322 \fi
323 }
324 \ResizeGather@AtEnd%
325 %% \section{Installation}
326 \endinput
327 %%
328 %% End of file `resizegather.sty'.