| 1 |
% \iffalse meta-comment |
| 2 |
% |
| 3 |
% File: resizegather.dtx |
| 4 |
% Version: 2016/05/16 v1.3 |
| 5 |
% Info: Resize overly large equations |
| 6 |
% |
| 7 |
% Copyright (C) |
| 8 |
% 2009, 2010 Heiko Oberdiek |
| 9 |
% 2016-2019 Oberdiek Package Support Group |
| 10 |
% https://github.com/ho-tex/oberdiek/issues |
| 11 |
% |
| 12 |
% This work may be distributed and/or modified under the |
| 13 |
% conditions of the LaTeX Project Public License, either |
| 14 |
% version 1.3c of this license or (at your option) any later |
| 15 |
% version. This version of this license is in |
| 16 |
% https://www.latex-project.org/lppl/lppl-1-3c.txt |
| 17 |
% and the latest version of this license is in |
| 18 |
% https://www.latex-project.org/lppl.txt |
| 19 |
% and version 1.3 or later is part of all distributions of |
| 20 |
% LaTeX version 2005/12/01 or later. |
| 21 |
% |
| 22 |
% This work has the LPPL maintenance status "maintained". |
| 23 |
% |
| 24 |
% The Current Maintainers of this work are |
| 25 |
% Heiko Oberdiek and the Oberdiek Package Support Group |
| 26 |
% https://github.com/ho-tex/oberdiek/issues |
| 27 |
% |
| 28 |
% This work consists of the main source file resizegather.dtx |
| 29 |
% and the derived files |
| 30 |
% resizegather.sty, resizegather.pdf, resizegather.ins, resizegather.drv, |
| 31 |
% resizegather-test1.tex. |
| 32 |
% |
| 33 |
% Distribution: |
| 34 |
% CTAN:macros/latex/contrib/oberdiek/resizegather.dtx |
| 35 |
% CTAN:macros/latex/contrib/oberdiek/resizegather.pdf |
| 36 |
% |
| 37 |
% Unpacking: |
| 38 |
% (a) If resizegather.ins is present: |
| 39 |
% tex resizegather.ins |
| 40 |
% (b) Without resizegather.ins: |
| 41 |
% tex resizegather.dtx |
| 42 |
% (c) If you insist on using LaTeX |
| 43 |
% latex \let\install=y\input{resizegather.dtx} |
| 44 |
% (quote the arguments according to the demands of your shell) |
| 45 |
% |
| 46 |
% Documentation: |
| 47 |
% (a) If resizegather.drv is present: |
| 48 |
% latex resizegather.drv |
| 49 |
% (b) Without resizegather.drv: |
| 50 |
% latex resizegather.dtx; ... |
| 51 |
% The class ltxdoc loads the configuration file ltxdoc.cfg |
| 52 |
% if available. Here you can specify further options, e.g. |
| 53 |
% use A4 as paper format: |
| 54 |
% \PassOptionsToClass{a4paper}{article} |
| 55 |
% |
| 56 |
% Program calls to get the documentation (example): |
| 57 |
% pdflatex resizegather.dtx |
| 58 |
% makeindex -s gind.ist resizegather.idx |
| 59 |
% pdflatex resizegather.dtx |
| 60 |
% makeindex -s gind.ist resizegather.idx |
| 61 |
% pdflatex resizegather.dtx |
| 62 |
% |
| 63 |
% Installation: |
| 64 |
% TDS:tex/latex/oberdiek/resizegather.sty |
| 65 |
% TDS:doc/latex/oberdiek/resizegather.pdf |
| 66 |
% TDS:source/latex/oberdiek/resizegather.dtx |
| 67 |
% |
| 68 |
%<*ignore> |
| 69 |
\begingroup |
| 70 |
\catcode123=1 % |
| 71 |
\catcode125=2 % |
| 72 |
\def\x{LaTeX2e}% |
| 73 |
\expandafter\endgroup |
| 74 |
\ifcase 0\ifx\install y1\fi\expandafter |
| 75 |
\ifx\csname processbatchFile\endcsname\relax\else1\fi |
| 76 |
\ifx\fmtname\x\else 1\fi\relax |
| 77 |
\else\csname fi\endcsname |
| 78 |
%</ignore> |
| 79 |
%<*install> |
| 80 |
\input docstrip.tex |
| 81 |
\Msg{************************************************************************} |
| 82 |
\Msg{* Installation} |
| 83 |
\Msg{* Package: resizegather 2016/05/16 v1.3 Resize overly large equations (HO)} |
| 84 |
\Msg{************************************************************************} |
| 85 |
|
| 86 |
\keepsilent |
| 87 |
\askforoverwritefalse |
| 88 |
|
| 89 |
\let\MetaPrefix\relax |
| 90 |
\preamble |
| 91 |
|
| 92 |
This is a generated file. |
| 93 |
|
| 94 |
Project: resizegather |
| 95 |
Version: 2016/05/16 v1.3 |
| 96 |
|
| 97 |
Copyright (C) |
| 98 |
2009, 2010 Heiko Oberdiek |
| 99 |
2016-2019 Oberdiek Package Support Group |
| 100 |
|
| 101 |
This work may be distributed and/or modified under the |
| 102 |
conditions of the LaTeX Project Public License, either |
| 103 |
version 1.3c of this license or (at your option) any later |
| 104 |
version. This version of this license is in |
| 105 |
https://www.latex-project.org/lppl/lppl-1-3c.txt |
| 106 |
and the latest version of this license is in |
| 107 |
https://www.latex-project.org/lppl.txt |
| 108 |
and version 1.3 or later is part of all distributions of |
| 109 |
LaTeX version 2005/12/01 or later. |
| 110 |
|
| 111 |
This work has the LPPL maintenance status "maintained". |
| 112 |
|
| 113 |
The Current Maintainers of this work are |
| 114 |
Heiko Oberdiek and the Oberdiek Package Support Group |
| 115 |
https://github.com/ho-tex/oberdiek/issues |
| 116 |
|
| 117 |
|
| 118 |
This work consists of the main source file resizegather.dtx |
| 119 |
and the derived files |
| 120 |
resizegather.sty, resizegather.pdf, resizegather.ins, resizegather.drv, |
| 121 |
resizegather-test1.tex. |
| 122 |
|
| 123 |
\endpreamble |
| 124 |
\let\MetaPrefix\DoubleperCent |
| 125 |
|
| 126 |
\generate{% |
| 127 |
\file{resizegather.ins}{\from{resizegather.dtx}{install}}% |
| 128 |
\file{resizegather.drv}{\from{resizegather.dtx}{driver}}% |
| 129 |
\usedir{tex/latex/oberdiek}% |
| 130 |
\file{resizegather.sty}{\from{resizegather.dtx}{package}}% |
| 131 |
% \usedir{doc/latex/oberdiek/test}% |
| 132 |
% \file{resizegather-test1.tex}{\from{resizegather.dtx}{test1}}% |
| 133 |
} |
| 134 |
|
| 135 |
\catcode32=13\relax% active space |
| 136 |
\let =\space% |
| 137 |
\Msg{************************************************************************} |
| 138 |
\Msg{*} |
| 139 |
\Msg{* To finish the installation you have to move the following} |
| 140 |
\Msg{* file into a directory searched by TeX:} |
| 141 |
\Msg{*} |
| 142 |
\Msg{* resizegather.sty} |
| 143 |
\Msg{*} |
| 144 |
\Msg{* To produce the documentation run the file `resizegather.drv'} |
| 145 |
\Msg{* through LaTeX.} |
| 146 |
\Msg{*} |
| 147 |
\Msg{* Happy TeXing!} |
| 148 |
\Msg{*} |
| 149 |
\Msg{************************************************************************} |
| 150 |
|
| 151 |
\endbatchfile |
| 152 |
%</install> |
| 153 |
%<*ignore> |
| 154 |
\fi |
| 155 |
%</ignore> |
| 156 |
%<*driver> |
| 157 |
\NeedsTeXFormat{LaTeX2e} |
| 158 |
\ProvidesFile{resizegather.drv}% |
| 159 |
[2016/05/16 v1.3 Resize overly large equations (HO)]% |
| 160 |
\documentclass{ltxdoc} |
| 161 |
\usepackage{holtxdoc}[2011/11/22] |
| 162 |
\usepackage{iftex}[2019/11/07] |
| 163 |
\ifluatex |
| 164 |
\else |
| 165 |
\usepackage[T1]{fontenc}% |
| 166 |
\usepackage{textcomp}% |
| 167 |
\usepackage{lmodern}% |
| 168 |
\fi |
| 169 |
\begin{document} |
| 170 |
\DocInput{resizegather.dtx}% |
| 171 |
\end{document} |
| 172 |
%</driver> |
| 173 |
% \fi |
| 174 |
% |
| 175 |
% |
| 176 |
% |
| 177 |
% \GetFileInfo{resizegather.drv} |
| 178 |
% |
| 179 |
% \title{The \xpackage{resizegather} package} |
| 180 |
% \date{2016/05/16 v1.3} |
| 181 |
% \author{Heiko Oberdiek\thanks |
| 182 |
% {Please report any issues at \url{https://github.com/ho-tex/oberdiek/issues}}} |
| 183 |
% |
| 184 |
% \maketitle |
| 185 |
% |
| 186 |
% \begin{abstract} |
| 187 |
% Equations that are too large are resized to fit the available |
| 188 |
% space. The environment \textsf{gather} of package \xpackage{amsmath} |
| 189 |
% is supported. Also the environments \textsf{equation} and |
| 190 |
% \textsf{displaymath} are redefined using \textsf{gather} |
| 191 |
% and its starred version. |
| 192 |
% \end{abstract} |
| 193 |
% |
| 194 |
% \tableofcontents |
| 195 |
% |
| 196 |
% \makeatletter |
| 197 |
% \def\env#1{^^A |
| 198 |
% \textsf{\@env#1*\@nil}^^A |
| 199 |
% }% |
| 200 |
% \def\@env#1*#2\@nil{^^A |
| 201 |
% #1^^A |
| 202 |
% \ifx\\#2\\^^A |
| 203 |
% \expandafter\@gobble |
| 204 |
% \else |
| 205 |
% \textasteriskcentered |
| 206 |
% \expandafter\@firstofone |
| 207 |
% \fi |
| 208 |
% {\@env#2\@nil}^^A |
| 209 |
% } |
| 210 |
% \makeatother |
| 211 |
% |
| 212 |
% \section{Documentation} |
| 213 |
% |
| 214 |
% Sometimes an equation is just a little to large to fit in the |
| 215 |
% line. And breaking the equation across lines might be worse |
| 216 |
% than downscaling the equation. This package implements this |
| 217 |
% for the environments \env{gather} and \env{gather*} of |
| 218 |
% package \xpackage{amsmath}. That package already measures |
| 219 |
% the equations and simplifies the implementation of \xpackage{resizegather} |
| 220 |
% that only needs to hook into \xpackage{amsmath}'s code to add |
| 221 |
% the resizing feature. |
| 222 |
% |
| 223 |
% Resized equations are recorded in the \xext{log} file |
| 224 |
% for small exceeds (default setting is smaller than five percent). |
| 225 |
% Otherwise a warning is given. |
| 226 |
% |
| 227 |
% Also environments \env{equation} and \env{displaymath} |
| 228 |
% are supported by redefining them using \env{gather} |
| 229 |
% and \env{gather*}. |
| 230 |
% |
| 231 |
% \cs{[} and \cs{]} are not supported, because these macros |
| 232 |
% are not in environment form that is required for |
| 233 |
% \xpackage{amsmath}. The environment body is collected |
| 234 |
% first to be able to process the body twice for measuring |
| 235 |
% first. |
| 236 |
% |
| 237 |
% Also the environments using alignments are not supported. |
| 238 |
% If a single equation line would be resized, the alignment |
| 239 |
% would get lost. And resizing all equations of the alignment |
| 240 |
% does not seem appropriate either. |
| 241 |
% |
| 242 |
% \subsection{Options} |
| 243 |
% |
| 244 |
% \begin{description} |
| 245 |
% \item[\xoption{warningthreshold}:] |
| 246 |
% Print a warning if the original equation line exceeds |
| 247 |
% its available width by the given fraction. |
| 248 |
% Default is |0.05|: A warning is given if the equation |
| 249 |
% is too large by five percent. |
| 250 |
% Otherwise the exceed is recorded in the \xext{log} file |
| 251 |
% only. |
| 252 |
% \end{description} |
| 253 |
% The next options are boolean options. They are enabled |
| 254 |
% by value |true| or if no value is given. They are switched |
| 255 |
% off by value |false|. |
| 256 |
% \begin{description} |
| 257 |
% \item[\xoption{enable}:] The resize feature is active (default). |
| 258 |
% \item[\xoption{disable}:] The complementary option for \xoption{enable}, |
| 259 |
% added for convenience: |disable| (or |disable=true|) is the same |
| 260 |
% as |enable=false|. |
| 261 |
% \item[\xoption{equations}:] |
| 262 |
% \LaTeX\ environments \textsf{equation} and \textsf{displaymath} |
| 263 |
% environments are redefined. These equations |
| 264 |
% are now using environment \env{gather} and |
| 265 |
% \env{gather*}. This is the default. |
| 266 |
% \end{description} |
| 267 |
% The following table shows additional options if you |
| 268 |
% want to have finer control for the redefined |
| 269 |
% environments: |
| 270 |
% \begin{quote} |
| 271 |
% \def\unchanged{\textit{unchanged}} |
| 272 |
% \def\notprovided{\textit{not provided}} |
| 273 |
% \begin{tabular}{l|ll} |
| 274 |
% &\multicolumn{2}{c}{Environments}\\ |
| 275 |
% Option & \env{equation} & \env{displaymath}\\ |
| 276 |
% \hline |
| 277 |
% \xoption{equations} & \env{gather} & \env{gather*}\\ |
| 278 |
% \xoption{equation} & \env{gather} & \unchanged\\ |
| 279 |
% \xoption{displaymath} & \unchanged & \env{gather*}\\ |
| 280 |
% \end{tabular} |
| 281 |
% \end{quote} |
| 282 |
% If such an option is switched off, the original meaning |
| 283 |
% of the affected environments is restored. |
| 284 |
% |
| 285 |
% Options are evaluated in the following order: |
| 286 |
% \begin{enumerate} |
| 287 |
% \item |
| 288 |
% Configuration file \xfile{resizegather.cfg} using \cs{resizegathersetup} |
| 289 |
% if the file exists. |
| 290 |
% \item |
| 291 |
% Package options given for \cs{usepackage}. |
| 292 |
% \item |
| 293 |
% Later calls of \cs{resizegathersetup}. |
| 294 |
% \end{enumerate} |
| 295 |
% \begin{declcs}{resizegathersetup}\M{option list} |
| 296 |
% \end{declcs} |
| 297 |
% The options are key value options. Boolean options are enabled by |
| 298 |
% default (without value) or by using the explicit value \texttt{true}. |
| 299 |
% Value \texttt{false} disable the option. |
| 300 |
% |
| 301 |
% \subsection{Options for packages \xpackage{amsmath} or \xpackage{graphics}} |
| 302 |
% |
| 303 |
% The package loads the package \xpackage{amsmath} because is internally |
| 304 |
% measures the equations first. Thus this package hooks into this code |
| 305 |
% in order to resize the equations if they are too large. |
| 306 |
% The resizing itself is done by \cs{resizebox} of package \xpackage{graphics}. |
| 307 |
% If you need special options for these packages, just load them first or |
| 308 |
% use global options when appropriate. Example: |
| 309 |
% \begin{quote} |
| 310 |
%\begin{verbatim} |
| 311 |
%\usepackage[dvipdfm]{graphicx}% or graphics |
| 312 |
%\usepackage[fleqn]{amsmath} |
| 313 |
%\usepackage{resizegather} |
| 314 |
%\end{verbatim} |
| 315 |
%\end{quote} |
| 316 |
% |
| 317 |
% \StopEventually{ |
| 318 |
% } |
| 319 |
% |
| 320 |
% \section{Implementation} |
| 321 |
% \begin{macrocode} |
| 322 |
%<*package> |
| 323 |
% \end{macrocode} |
| 324 |
% Reload check, especially if the package is not used with \LaTeX. |
| 325 |
% \begin{macrocode} |
| 326 |
\begingroup\catcode61\catcode48\catcode32=10\relax% |
| 327 |
\catcode13=5 % ^^M |
| 328 |
\endlinechar=13 % |
| 329 |
\catcode35=6 % # |
| 330 |
\catcode39=12 % ' |
| 331 |
\catcode44=12 % , |
| 332 |
\catcode45=12 % - |
| 333 |
\catcode46=12 % . |
| 334 |
\catcode58=12 % : |
| 335 |
\catcode64=11 % @ |
| 336 |
\catcode123=1 % { |
| 337 |
\catcode125=2 % } |
| 338 |
\expandafter\let\expandafter\x\csname [email protected]\endcsname |
| 339 |
\ifx\x\relax % plain-TeX, first loading |
| 340 |
\else |
| 341 |
\def\empty{}% |
| 342 |
\ifx\x\empty % LaTeX, first loading, |
| 343 |
% variable is initialized, but \ProvidesPackage not yet seen |
| 344 |
\else |
| 345 |
\expandafter\ifx\csname PackageInfo\endcsname\relax |
| 346 |
\def\x#1#2{% |
| 347 |
\immediate\write-1{Package #1 Info: #2.}% |
| 348 |
}% |
| 349 |
\else |
| 350 |
\def\x#1#2{\PackageInfo{#1}{#2, stopped}}% |
| 351 |
\fi |
| 352 |
\x{resizegather}{The package is already loaded}% |
| 353 |
\aftergroup\endinput |
| 354 |
\fi |
| 355 |
\fi |
| 356 |
\endgroup% |
| 357 |
% \end{macrocode} |
| 358 |
% Package identification: |
| 359 |
% \begin{macrocode} |
| 360 |
\begingroup\catcode61\catcode48\catcode32=10\relax% |
| 361 |
\catcode13=5 % ^^M |
| 362 |
\endlinechar=13 % |
| 363 |
\catcode35=6 % # |
| 364 |
\catcode39=12 % ' |
| 365 |
\catcode40=12 % ( |
| 366 |
\catcode41=12 % ) |
| 367 |
\catcode44=12 % , |
| 368 |
\catcode45=12 % - |
| 369 |
\catcode46=12 % . |
| 370 |
\catcode47=12 % / |
| 371 |
\catcode58=12 % : |
| 372 |
\catcode64=11 % @ |
| 373 |
\catcode91=12 % [ |
| 374 |
\catcode93=12 % ] |
| 375 |
\catcode123=1 % { |
| 376 |
\catcode125=2 % } |
| 377 |
\expandafter\ifx\csname ProvidesPackage\endcsname\relax |
| 378 |
\def\x#1#2#3[#4]{\endgroup |
| 379 |
\immediate\write-1{Package: #3 #4}% |
| 380 |
\xdef#1{#4}% |
| 381 |
}% |
| 382 |
\else |
| 383 |
\def\x#1#2[#3]{\endgroup |
| 384 |
#2[{#3}]% |
| 385 |
\ifx#1\@undefined |
| 386 |
\xdef#1{#3}% |
| 387 |
\fi |
| 388 |
\ifx#1\relax |
| 389 |
\xdef#1{#3}% |
| 390 |
\fi |
| 391 |
}% |
| 392 |
\fi |
| 393 |
\expandafter\x\csname [email protected]\endcsname |
| 394 |
\ProvidesPackage{resizegather}% |
| 395 |
[2016/05/16 v1.3 Resize overly large equations (HO)]% |
| 396 |
% \end{macrocode} |
| 397 |
% |
| 398 |
% \begin{macrocode} |
| 399 |
\begingroup\catcode61\catcode48\catcode32=10\relax% |
| 400 |
\catcode13=5 % ^^M |
| 401 |
\endlinechar=13 % |
| 402 |
\catcode123=1 % { |
| 403 |
\catcode125=2 % } |
| 404 |
\catcode64=11 % @ |
| 405 |
\def\x{\endgroup |
| 406 |
\expandafter\edef\csname ResizeGather@AtEnd\endcsname{% |
| 407 |
\endlinechar=\the\endlinechar\relax |
| 408 |
\catcode13=\the\catcode13\relax |
| 409 |
\catcode32=\the\catcode32\relax |
| 410 |
\catcode35=\the\catcode35\relax |
| 411 |
\catcode61=\the\catcode61\relax |
| 412 |
\catcode64=\the\catcode64\relax |
| 413 |
\catcode123=\the\catcode123\relax |
| 414 |
\catcode125=\the\catcode125\relax |
| 415 |
}% |
| 416 |
}% |
| 417 |
\x\catcode61\catcode48\catcode32=10\relax% |
| 418 |
\catcode13=5 % ^^M |
| 419 |
\endlinechar=13 % |
| 420 |
\catcode35=6 % # |
| 421 |
\catcode64=11 % @ |
| 422 |
\catcode123=1 % { |
| 423 |
\catcode125=2 % } |
| 424 |
\def\TMP@EnsureCode#1#2{% |
| 425 |
\edef\ResizeGather@AtEnd{% |
| 426 |
\ResizeGather@AtEnd |
| 427 |
\catcode#1=\the\catcode#1\relax |
| 428 |
}% |
| 429 |
\catcode#1=#2\relax |
| 430 |
} |
| 431 |
\TMP@EnsureCode{10}{12}% ^^J |
| 432 |
\TMP@EnsureCode{33}{12}% ! |
| 433 |
\TMP@EnsureCode{36}{3}% $ |
| 434 |
\TMP@EnsureCode{38}{4}% & |
| 435 |
\TMP@EnsureCode{39}{12}% ' |
| 436 |
\TMP@EnsureCode{40}{12}% ( |
| 437 |
\TMP@EnsureCode{41}{12}% ) |
| 438 |
\TMP@EnsureCode{42}{12}% * |
| 439 |
\TMP@EnsureCode{43}{12}% + |
| 440 |
\TMP@EnsureCode{44}{12}% , |
| 441 |
\TMP@EnsureCode{45}{12}% - |
| 442 |
\TMP@EnsureCode{46}{12}% . |
| 443 |
\TMP@EnsureCode{47}{12}% / |
| 444 |
\TMP@EnsureCode{58}{12}% : |
| 445 |
\TMP@EnsureCode{59}{12}% ; |
| 446 |
\TMP@EnsureCode{60}{12}% < |
| 447 |
\TMP@EnsureCode{62}{12}% > |
| 448 |
\TMP@EnsureCode{63}{12}% ? |
| 449 |
\TMP@EnsureCode{91}{12}% [ |
| 450 |
\TMP@EnsureCode{93}{12}% ] |
| 451 |
\TMP@EnsureCode{94}{7}% ^ (superscript) |
| 452 |
\TMP@EnsureCode{96}{12}% ` |
| 453 |
\edef\ResizeGather@AtEnd{\ResizeGather@AtEnd\noexpand\endinput} |
| 454 |
% \end{macrocode} |
| 455 |
% |
| 456 |
% \begin{macrocode} |
| 457 |
\RequirePackage{kvoptions}[2009/12/04] |
| 458 |
\SetupKeyvalOptions{% |
| 459 |
family=resizegather,% |
| 460 |
prefix=ResizeGather@,% |
| 461 |
} |
| 462 |
% \end{macrocode} |
| 463 |
% \begin{macrocode} |
| 464 |
\@for\ResizeGather@option:=% |
| 465 |
centertags,% |
| 466 |
tbtags,% |
| 467 |
sumlimits,% |
| 468 |
nosumlimits,% |
| 469 |
intlimits,% |
| 470 |
nointlimits,% |
| 471 |
nonamelimits,% |
| 472 |
leqno,% |
| 473 |
reqno,% |
| 474 |
fleqn% |
| 475 |
\do{% |
| 476 |
\edef\ResizeGather@temp{% |
| 477 |
\noexpand\DeclareVoidOption{\ResizeGather@option}{% |
| 478 |
\noexpand\PassOptionsToPackage{amsmath}{\ResizeGather@option}% |
| 479 |
}% |
| 480 |
\noexpand\AtEndOfPackage{% |
| 481 |
\noexpand\DisableKeyvalOption[% |
| 482 |
action=error,% |
| 483 |
package=resizegather,% |
| 484 |
]{resizegather}{\ResizeGather@option}% |
| 485 |
}% |
| 486 |
}% |
| 487 |
\ResizeGather@temp |
| 488 |
} |
| 489 |
\@for\ResizeGather@option:=% |
| 490 |
draft,% |
| 491 |
final,% |
| 492 |
hiderotate,% |
| 493 |
hidescale,% |
| 494 |
hiresbb,% |
| 495 |
demo,% |
| 496 |
dvips,xdvi,dvipdf,dvipdfm,dvipdfmx,pdftex,dvipsone,% |
| 497 |
dviwindo,emtex,dviwin,pctexps,pctexwin,pctexhp,pctex32,% |
| 498 |
truetex,tcidvi,vtex,oztex,textures,xetex% |
| 499 |
\do{% |
| 500 |
\edef\ResizeGather@temp{% |
| 501 |
\noexpand\DeclareVoidOption{\ResizeGather@option}{% |
| 502 |
\noexpand\PassOptionsToPackage{graphics}{\ResizeGather@option}% |
| 503 |
}% |
| 504 |
\noexpand\AtEndOfPackage{% |
| 505 |
\noexpand\DisableKeyvalOption[% |
| 506 |
action=error,% |
| 507 |
package=resizegather,% |
| 508 |
]{resizegather}{\ResizeGather@option}% |
| 509 |
}% |
| 510 |
}% |
| 511 |
\ResizeGather@temp |
| 512 |
} |
| 513 |
% \end{macrocode} |
| 514 |
% |
| 515 |
% \begin{macrocode} |
| 516 |
\DeclareBoolOption[true]{enable} |
| 517 |
\DeclareComplementaryOption{disable}{enable} |
| 518 |
\DeclareStringOption[.05]{warningthreshold} |
| 519 |
\newif\ifResizeGather@NeedInit |
| 520 |
\DeclareBoolOption[true]{equations} |
| 521 |
\DeclareBoolOption[true]{equation} |
| 522 |
\DeclareBoolOption[true]{displaymath} |
| 523 |
\AddToKeyvalOption*{equations}{% |
| 524 |
\ResizeGather@NeedInittrue |
| 525 |
\ifResizeGather@equations |
| 526 |
\ResizeGather@equationtrue |
| 527 |
\ResizeGather@displaymathtrue |
| 528 |
\else |
| 529 |
\ResizeGather@equationfalse |
| 530 |
\ResizeGather@displaymathfalse |
| 531 |
\fi |
| 532 |
} |
| 533 |
\AddToKeyvalOption*{equation}{% |
| 534 |
\ResizeGather@NeedInittrue |
| 535 |
} |
| 536 |
\AddToKeyvalOption*{displaymath}{% |
| 537 |
\ResizeGather@NeedInittrue |
| 538 |
} |
| 539 |
% \end{macrocode} |
| 540 |
% |
| 541 |
% \begin{macro}{\resizegathersetup} |
| 542 |
% \begin{macrocode} |
| 543 |
\newcommand*{\resizegathersetup}[1]{% |
| 544 |
\ResizeGather@NeedInitfalse |
| 545 |
\setkeys{resizegather}{#1}% |
| 546 |
\ifResizeGather@NeedInit |
| 547 |
\ResizeGather@init |
| 548 |
\fi |
| 549 |
} |
| 550 |
\let\ResizeGather@init\relax |
| 551 |
% \end{macrocode} |
| 552 |
% \end{macro} |
| 553 |
% \begin{macrocode} |
| 554 |
\InputIfFileExists{resizegather.cfg}{}{}% |
| 555 |
\ProcessKeyvalOptions*\relax |
| 556 |
% \end{macrocode} |
| 557 |
% \begin{macrocode} |
| 558 |
\RequirePackage{amsmath} |
| 559 |
\RequirePackage{graphics} |
| 560 |
% \end{macrocode} |
| 561 |
% \begin{macro}{\ResizeGather@redefine} |
| 562 |
% \begin{macrocode} |
| 563 |
\def\ResizeGather@redefine#1#2#3#4#5{% |
| 564 |
\csname ifResizeGather@#1\endcsname |
| 565 |
\@ifundefined{ResizeGather@org@#2}{% |
| 566 |
\expandafter\let\csname ResizeGather@org@#2\expandafter\endcsname |
| 567 |
\csname #2\endcsname |
| 568 |
}{}% |
| 569 |
\@ifundefined{ResizeGather@org@#3}{% |
| 570 |
\expandafter\let\csname ResizeGather@org@#3\expandafter\endcsname |
| 571 |
\csname #3\endcsname |
| 572 |
}{}% |
| 573 |
\expandafter\edef\csname #2\endcsname{% |
| 574 |
\expandafter\noexpand\csname#4\endcsname |
| 575 |
}% |
| 576 |
\expandafter\edef\csname #3\endcsname{% |
| 577 |
\expandafter\noexpand\csname#5\endcsname |
| 578 |
}% |
| 579 |
\else |
| 580 |
\@ifundefined{ResizeGather@org@#2}{}{% |
| 581 |
\expandafter\let\csname #2\expandafter\endcsname |
| 582 |
\csname ResizeGather@org@#2\endcsname |
| 583 |
\expandafter\let\csname #3\expandafter\endcsname |
| 584 |
\csname ResizeGather@org@#3\endcsname |
| 585 |
}% |
| 586 |
\fi |
| 587 |
} |
| 588 |
% \end{macrocode} |
| 589 |
% \end{macro} |
| 590 |
% \begin{macro}{\ResizeGather@init} |
| 591 |
% \begin{macrocode} |
| 592 |
\def\ResizeGather@init{% |
| 593 |
\ResizeGather@redefine{equation}{equation}{endequation}% |
| 594 |
{gather}{endgather}% |
| 595 |
\ResizeGather@redefine{displaymath}{displaymath}{enddisplaymath}% |
| 596 |
{gather*}{endgather*}% |
| 597 |
} |
| 598 |
\ResizeGather@init |
| 599 |
% \end{macrocode} |
| 600 |
% \end{macro} |
| 601 |
% |
| 602 |
% \begin{macro}{\ResizeGather@ResizeGather} |
| 603 |
% \begin{macrocode} |
| 604 |
\def\ResizeGather@ResizeGather{% |
| 605 |
\ifResizeGather@enable |
| 606 |
\dimen@\displaywidth |
| 607 |
\if@fleqn |
| 608 |
\advance\dimen@-\@mathmargin |
| 609 |
\fi |
| 610 |
\ifdim\wdz@>\dimen@ |
| 611 |
\begingroup |
| 612 |
\advance\dimen@ -\wdz@ |
| 613 |
\dimen@ -\dimen@ |
| 614 |
\ifdim\ResizeGather@warningthreshold\wdz@>\dimen@ |
| 615 |
\expandafter\PackageInfo |
| 616 |
\else |
| 617 |
\expandafter\PackageWarning |
| 618 |
\fi |
| 619 |
{resizegather}{% |
| 620 |
Equation line \the\row@\space is too large % |
| 621 |
by \the\dimen@\MessageBreak |
| 622 |
in environment `\@currenvir'% |
| 623 |
}% |
| 624 |
\endgroup |
| 625 |
\setboxz@h to\dimen@{% |
| 626 |
\resizebox{\dimen@}{!}{\boxz@}% |
| 627 |
\hss |
| 628 |
}% |
| 629 |
\fi |
| 630 |
\fi |
| 631 |
} |
| 632 |
% \end{macrocode} |
| 633 |
% \end{macro} |
| 634 |
% \begin{macro}{\calc@shift@gather} |
| 635 |
% \begin{macrocode} |
| 636 |
\expandafter\def\expandafter\calc@shift@gather\expandafter{% |
| 637 |
\expandafter\ResizeGather@ResizeGather |
| 638 |
\calc@shift@gather |
| 639 |
} |
| 640 |
% \end{macrocode} |
| 641 |
% \end{macro} |
| 642 |
% \begin{macro}{\ResizeGather@org@gmeasure@} |
| 643 |
% \begin{macrocode} |
| 644 |
\let\ResizeGather@org@gmeasure@\gmeasure@ |
| 645 |
% \end{macrocode} |
| 646 |
% \end{macro} |
| 647 |
% \begin{macro}{\gmeasure@} |
| 648 |
% \begin{macrocode} |
| 649 |
\def\gmeasure@#1{% |
| 650 |
\ResizeGather@org@gmeasure@{#1}% |
| 651 |
\ifResizeGather@enable |
| 652 |
\ifdim\totwidth@>\displaywidth |
| 653 |
\totwidth@=\displaywidth |
| 654 |
\fi |
| 655 |
\fi |
| 656 |
} |
| 657 |
% \end{macrocode} |
| 658 |
% \end{macro} |
| 659 |
% |
| 660 |
% \begin{macrocode} |
| 661 |
\ResizeGather@AtEnd% |
| 662 |
%</package> |
| 663 |
% \end{macrocode} |
| 664 |
%% \section{Installation} |
| 665 |
% |
| 666 |
% \subsection{Download} |
| 667 |
% |
| 668 |
% \paragraph{Package.} This package is available on |
| 669 |
% CTAN\footnote{\CTANpkg{resizegather}}: |
| 670 |
% \begin{description} |
| 671 |
% \item[\CTAN{macros/latex/contrib/oberdiek/resizegather.dtx}] The source file. |
| 672 |
% \item[\CTAN{macros/latex/contrib/oberdiek/resizegather.pdf}] Documentation. |
| 673 |
% \end{description} |
| 674 |
% |
| 675 |
% |
| 676 |
% \paragraph{Bundle.} All the packages of the bundle `oberdiek' |
| 677 |
% are also available in a TDS compliant ZIP archive. There |
| 678 |
% the packages are already unpacked and the documentation files |
| 679 |
% are generated. The files and directories obey the TDS standard. |
| 680 |
% \begin{description} |
| 681 |
% \item[\CTANinstall{install/macros/latex/contrib/oberdiek.tds.zip}] |
| 682 |
% \end{description} |
| 683 |
% \emph{TDS} refers to the standard ``A Directory Structure |
| 684 |
% for \TeX\ Files'' (\CTANpkg{tds}). Directories |
| 685 |
% with \xfile{texmf} in their name are usually organized this way. |
| 686 |
% |
| 687 |
% \subsection{Bundle installation} |
| 688 |
% |
| 689 |
% \paragraph{Unpacking.} Unpack the \xfile{oberdiek.tds.zip} in the |
| 690 |
% TDS tree (also known as \xfile{texmf} tree) of your choice. |
| 691 |
% Example (linux): |
| 692 |
% \begin{quote} |
| 693 |
% |unzip oberdiek.tds.zip -d ~/texmf| |
| 694 |
% \end{quote} |
| 695 |
% |
| 696 |
% \subsection{Package installation} |
| 697 |
% |
| 698 |
% \paragraph{Unpacking.} The \xfile{.dtx} file is a self-extracting |
| 699 |
% \docstrip\ archive. The files are extracted by running the |
| 700 |
% \xfile{.dtx} through \plainTeX: |
| 701 |
% \begin{quote} |
| 702 |
% \verb|tex resizegather.dtx| |
| 703 |
% \end{quote} |
| 704 |
% |
| 705 |
% \paragraph{TDS.} Now the different files must be moved into |
| 706 |
% the different directories in your installation TDS tree |
| 707 |
% (also known as \xfile{texmf} tree): |
| 708 |
% \begin{quote} |
| 709 |
% \def\t{^^A |
| 710 |
% \begin{tabular}{@{}>{\ttfamily}l@{ $\rightarrow$ }>{\ttfamily}l@{}} |
| 711 |
% resizegather.sty & tex/latex/oberdiek/resizegather.sty\\ |
| 712 |
% resizegather.pdf & doc/latex/oberdiek/resizegather.pdf\\ |
| 713 |
% resizegather.dtx & source/latex/oberdiek/resizegather.dtx\\ |
| 714 |
% \end{tabular}^^A |
| 715 |
% }^^A |
| 716 |
% \sbox0{\t}^^A |
| 717 |
% \ifdim\wd0>\linewidth |
| 718 |
% \begingroup |
| 719 |
% \advance\linewidth by\leftmargin |
| 720 |
% \advance\linewidth by\rightmargin |
| 721 |
% \edef\x{\endgroup |
| 722 |
% \def\noexpand\lw{\the\linewidth}^^A |
| 723 |
% }\x |
| 724 |
% \def\lwbox{^^A |
| 725 |
% \leavevmode |
| 726 |
% \hbox to \linewidth{^^A |
| 727 |
% \kern-\leftmargin\relax |
| 728 |
% \hss |
| 729 |
% \usebox0 |
| 730 |
% \hss |
| 731 |
% \kern-\rightmargin\relax |
| 732 |
% }^^A |
| 733 |
% }^^A |
| 734 |
% \ifdim\wd0>\lw |
| 735 |
% \sbox0{\small\t}^^A |
| 736 |
% \ifdim\wd0>\linewidth |
| 737 |
% \ifdim\wd0>\lw |
| 738 |
% \sbox0{\footnotesize\t}^^A |
| 739 |
% \ifdim\wd0>\linewidth |
| 740 |
% \ifdim\wd0>\lw |
| 741 |
% \sbox0{\scriptsize\t}^^A |
| 742 |
% \ifdim\wd0>\linewidth |
| 743 |
% \ifdim\wd0>\lw |
| 744 |
% \sbox0{\tiny\t}^^A |
| 745 |
% \ifdim\wd0>\linewidth |
| 746 |
% \lwbox |
| 747 |
% \else |
| 748 |
% \usebox0 |
| 749 |
% \fi |
| 750 |
% \else |
| 751 |
% \lwbox |
| 752 |
% \fi |
| 753 |
% \else |
| 754 |
% \usebox0 |
| 755 |
% \fi |
| 756 |
% \else |
| 757 |
% \lwbox |
| 758 |
% \fi |
| 759 |
% \else |
| 760 |
% \usebox0 |
| 761 |
% \fi |
| 762 |
% \else |
| 763 |
% \lwbox |
| 764 |
% \fi |
| 765 |
% \else |
| 766 |
% \usebox0 |
| 767 |
% \fi |
| 768 |
% \else |
| 769 |
% \lwbox |
| 770 |
% \fi |
| 771 |
% \else |
| 772 |
% \usebox0 |
| 773 |
% \fi |
| 774 |
% \end{quote} |
| 775 |
% If you have a \xfile{docstrip.cfg} that configures and enables \docstrip's |
| 776 |
% TDS installing feature, then some files can already be in the right |
| 777 |
% place, see the documentation of \docstrip. |
| 778 |
% |
| 779 |
% \subsection{Refresh file name databases} |
| 780 |
% |
| 781 |
% If your \TeX~distribution |
| 782 |
% (\TeX\,Live, \mikTeX, \dots) relies on file name databases, you must refresh |
| 783 |
% these. For example, \TeX\,Live\ users run \verb|texhash| or |
| 784 |
% \verb|mktexlsr|. |
| 785 |
% |
| 786 |
% \subsection{Some details for the interested} |
| 787 |
% |
| 788 |
% \paragraph{Unpacking with \LaTeX.} |
| 789 |
% The \xfile{.dtx} chooses its action depending on the format: |
| 790 |
% \begin{description} |
| 791 |
% \item[\plainTeX:] Run \docstrip\ and extract the files. |
| 792 |
% \item[\LaTeX:] Generate the documentation. |
| 793 |
% \end{description} |
| 794 |
% If you insist on using \LaTeX\ for \docstrip\ (really, |
| 795 |
% \docstrip\ does not need \LaTeX), then inform the autodetect routine |
| 796 |
% about your intention: |
| 797 |
% \begin{quote} |
| 798 |
% \verb|latex \let\install=y\input{resizegather.dtx}| |
| 799 |
% \end{quote} |
| 800 |
% Do not forget to quote the argument according to the demands |
| 801 |
% of your shell. |
| 802 |
% |
| 803 |
% \paragraph{Generating the documentation.} |
| 804 |
% You can use both the \xfile{.dtx} or the \xfile{.drv} to generate |
| 805 |
% the documentation. The process can be configured by the |
| 806 |
% configuration file \xfile{ltxdoc.cfg}. For instance, put this |
| 807 |
% line into this file, if you want to have A4 as paper format: |
| 808 |
% \begin{quote} |
| 809 |
% \verb|\PassOptionsToClass{a4paper}{article}| |
| 810 |
% \end{quote} |
| 811 |
% An example follows how to generate the |
| 812 |
% documentation with pdf\LaTeX: |
| 813 |
% \begin{quote} |
| 814 |
%\begin{verbatim} |
| 815 |
%pdflatex resizegather.dtx |
| 816 |
%makeindex -s gind.ist resizegather.idx |
| 817 |
%pdflatex resizegather.dtx |
| 818 |
%makeindex -s gind.ist resizegather.idx |
| 819 |
%pdflatex resizegather.dtx |
| 820 |
%\end{verbatim} |
| 821 |
% \end{quote} |
| 822 |
% |
| 823 |
% \section{Acknowledgement} |
| 824 |
% |
| 825 |
% \begin{description} |
| 826 |
% \item[Dieter Jurzitza:] |
| 827 |
% He wanted the resizing feature at the \TeX\ table |
| 828 |
% in Karlsruhe of December 2009. Thus this package is a kind of |
| 829 |
% Christmas present. |
| 830 |
% \end{description} |
| 831 |
% |
| 832 |
% \begin{History} |
| 833 |
% \begin{Version}{2009/12/04 v1.0} |
| 834 |
% \item |
| 835 |
% The first version. |
| 836 |
% \end{Version} |
| 837 |
% \begin{Version}{2009/12/05 v1.1} |
| 838 |
% \item |
| 839 |
% Options \xoption{enable} and \xoption{disable} added. |
| 840 |
% \end{Version} |
| 841 |
% \begin{Version}{2010/03/01 v1.2} |
| 842 |
% \item |
| 843 |
% TDS location moved from `generic' to `latex'. |
| 844 |
% \end{Version} |
| 845 |
% \begin{Version}{2016/05/16 v1.3} |
| 846 |
% \item |
| 847 |
% Documentation updates. |
| 848 |
% \end{Version} |
| 849 |
% \end{History} |
| 850 |
% |
| 851 |
% \PrintIndex |
| 852 |
% |
| 853 |
% \Finale |
| 854 |
\endinput |