diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/morefloats/morefloats.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/morefloats/morefloats.sty | 286 |
1 files changed, 191 insertions, 95 deletions
diff --git a/Master/texmf-dist/tex/latex/morefloats/morefloats.sty b/Master/texmf-dist/tex/latex/morefloats/morefloats.sty index 9dbf566648c..5199a1e9b2a 100644 --- a/Master/texmf-dist/tex/latex/morefloats/morefloats.sty +++ b/Master/texmf-dist/tex/latex/morefloats/morefloats.sty @@ -9,9 +9,9 @@ %% This is a generated file. %% %% Project: morefloats -%% Version: 2012/01/28 v1.0f +%% Version: 2015/07/16 v1.0g %% -%% Copyright (C) 2010 - 2012 by +%% Copyright (C) 2010 - 2015 by %% H.-Martin M"unch <Martin dot Muench at Uni-Bonn dot de> %% Portions of code copyrighted by other people as marked. %% @@ -34,10 +34,14 @@ %% %% The Current Maintainer of this work is H.-Martin Muench. %% -%% The main code of this package was invented by -%% Don Hosek, Quixote 1990/07/27 (Thanks!). +%% LaTeX 2015 provides the extrafloats command. +%% Don Hosek, Quixote, 1990/07/27 (Thanks!) +%% invented the main code for handling more floats +%% before extrafloats was available. %% Maintenance has been taken over in September 2010 %% by H.-Martin Muench. +%% David Carlisle pointed the maintainer to the new +%% extrafloats command (Thanks!). %% %% This work consists of the main source file morefloats.dtx, %% the README, and the derived files @@ -45,131 +49,210 @@ %% morefloats.ins, morefloats.drv, %% morefloats-example.tex, morefloats-example.pdf. %% +%% In memoriam +%% Claudia Simone Barth + 1996/01/30 +%% Tommy Muench + 2014/01/02 +%% Hans-Klaus Muench + 2014/08/24 +%% \NeedsTeXFormat{LaTeX2e}[2011/06/27] -\ProvidesPackage{morefloats}[2012/01/28 v1.0f - Raise limit of unprocessed floats (HMM; DH)] +%% The current format at the time of the release of this version of the +%% morefloats package was 2015/01/01. +\ProvidesPackage{morefloats}[2015/07/16 v1.0g + Raise limit of unprocessed floats (HMM)] -\RequirePackage{kvoptions}[2010/12/23]% v3.10 +\RequirePackage{kvoptions}[2011/06/30]% v3.11 %% morefloats may work with earlier versions of LaTeX2e and that %% package, but this was not tested. %% Please consider updating your LaTeX and package %% to the most recent version (if they are not already the most %% recent version). -\SetupKeyvalOptions{family = morefloats,prefix = morefloats@} +\SetupKeyvalOptions{family=morefloats,prefix=morefloats@} \DeclareStringOption{maxfloats}% \morefloats@maxfloats \DeclareStringOption{morefloats}% \morefloats@morefloats \ProcessKeyvalOptions* -\ifx\morefloats@maxfloats\@empty +\ifx\morefloats@maxfloats\@empty% \ifx\morefloats@morefloats\@empty% apply defaults: - \gdef\morefloats@maxfloats{36} - \gdef\morefloats@morefloats{18} - \else - \@tempcnta=18\relax% - \advance\@tempcnta by \morefloats@morefloats% - \xdef\morefloats@maxfloats{\the\@tempcnta} - \fi -\else - \ifx\morefloats@morefloats\@empty + \gdef\morefloats@maxfloats{36}% + \gdef\morefloats@morefloats{18}% + \else% + \@tempcnta=\morefloats@morefloats\relax% + \ifnum\@tempcnta>1569\relax% + \PackageWarning{morefloats}{% + \morefloats@morefloats\space more floats requested.\MessageBreak% + LaTeX might run out of memory before this\MessageBreak% + (in which case it will notify you)\MessageBreak% + }% + \fi% + \advance \@tempcnta by +18% + \xdef\morefloats@maxfloats{\the\@tempcnta}% + \fi% +\else% + \ifx\morefloats@morefloats\@empty% \@tempcnta=\morefloats@maxfloats\relax% - \advance\@tempcnta by -18% - \xdef\morefloats@morefloats{\the\@tempcnta} - \fi -\fi + \advance \@tempcnta by -18% + \xdef\morefloats@morefloats{\the\@tempcnta}% + \ifnum\morefloats@maxfloats>1587\relax% + \PackageWarning{morefloats}{% + \morefloats@maxfloats\space floats requested.\MessageBreak% + LaTeX might run out of memory before this\MessageBreak% + (in which case it will notify you)\MessageBreak% + }% + \fi% + \fi% +\fi% \@tempcnta=\morefloats@maxfloats\relax% -\edef\morefloats@max{\the\@tempcnta} +\edef\morefloats@max{\the\@tempcnta}% -\ifnum \@tempcnta<18 +\ifnum\@tempcnta<18\relax% \PackageError{morefloats}{Option maxfloats is \the\@tempcnta<18}{% - maxfloats must be a number equal to or larger than 18\MessageBreak% - (or not used at all).\MessageBreak% - Now setting maxfloats=18.\MessageBreak% - } - \gdef\morefloats@max{18} -\fi + maxfloats must be a number equal to or larger than 18\MessageBreak% + (or not used at all).\MessageBreak% + Now setting maxfloats=18.\MessageBreak% + }% + \gdef\morefloats@max{18}% +\fi% \@tempcnta=\morefloats@morefloats\relax% +\edef\morefloats@more{\the\@tempcnta}% -\edef\morefloats@more{\the\@tempcnta} - -\ifnum \@tempcnta<0 +\ifnum\@tempcnta<0\relax% \PackageError{morefloats}{Option morefloats is \the\@tempcnta<0}{% - morefloats must be a number equal to or larger than 0\MessageBreak% - (or not used at all).\MessageBreak% - Now setting morefloats=0.\MessageBreak% - } - \gdef\morefloats@more{0} -\fi + morefloats must be a number equal to or larger than 0\MessageBreak% + (or not used at all).\MessageBreak% + Now setting morefloats=0.\MessageBreak% + }% + \gdef\morefloats@more{0}% +\fi% \@tempcnta=18\relax% \advance\@tempcnta by \morefloats@more% \advance\@tempcnta by -\morefloats@max% -\edef\morefloats@mx{\the\@tempcnta} -\ifnum \morefloats@mx=0% OK - \@tempcnta=\morefloats@maxfloats\relax -\else +\edef\morefloats@mx{\the\@tempcnta}% +\ifnum\morefloats@mx=0\relax% OK + \@tempcnta=\morefloats@maxfloats\relax% +\else% \PackageError{morefloats}{% Clash between options maxfloats and morefloats}{% Option maxfloats must be empty\MessageBreak% or the sum of 18 and option value morefloats,\MessageBreak% - but it is maxfloats=\morefloats@maxfloats \space and % + but it is maxfloats=\morefloats@maxfloats\space and % morefloats=\morefloats@morefloats .\MessageBreak% - } + }% \ifnum \@tempcnta<0% \morefloats@max > \morefloats@more \@tempcnta=\morefloats@maxfloats\relax% \else% \@tempcnta>0, \morefloats@max < \morefloats@more \@tempcnta=18\relax% \advance\@tempcnta by \morefloats@morefloats% - \fi -\fi + \fi% +\fi% +\edef\morefloats@mx{\the\@tempcnta}% +\xdef\morefloats@maxfloats{\the\@tempcnta}% +\advance\@tempcnta by -18 +\xdef\morefloats@morefloats{\the\@tempcnta}% +\gdef\morefloats@test{1}% +\ifx\morefloats@morefloats\morefloats@test\relax% + \PackageInfo{morefloats}{% + Maximum number of possible floats asked for: \morefloats@maxfloats% + \MessageBreak% + (i.e. one more float)\@gobble% + }% +\else% + \PackageInfo{morefloats}{% + Maximum number of possible floats asked for: \morefloats@maxfloats% + \MessageBreak% + (i.e. \morefloats@morefloats\space more floats).\MessageBreak% + LaTeX might run out of memory before this\MessageBreak% + (in which case it will notify you)% + \@gobble% + }% +\fi% -\edef\morefloats@mx{\the\@tempcnta} +%% Test for new mechanism in LaTeX 2015: +\gdef\morefloats@efa{0}% +\ifx\e@alloc\@undefined\relax% + %% This is an old LaTeX format, \extrafloats is not available. + \PackageWarning{morefloats}{% + \fmtname\space <\fmtversion> found.\MessageBreak% + LaTeX 2015/01/01 is now available\MessageBreak% + and can handle even more floats% + \@gobble% + }% + %\gdef\morefloats@efa{0}, but it already has this value +\else% + %% This is new in LaTeX 2015, \extrafloats is available, + %% but older versions of the etex package are incompatible. + \@ifpackageloaded{etex}% + {% etex package loaded + \PackageError{morefloats}{etex package loaded}{% + The etex package was loaded\MessageBreak% + but breaks the \string\extrafloats\space command.\MessageBreak% + Therefore now not more than 256 floats will be available.\MessageBreak% + }% + %\gdef\morefloats@efa{0}, but it already has this value + }{% etex package not loaded + \gdef\morefloats@efa{1}% + }% +\fi% +\gdef\morefloats@test{1}% +\ifx\morefloats@efa\morefloats@test\relax% + \extrafloats{\morefloats@morefloats}% + % The part after the test is no longer needed and therefore not loaded: + \expandafter\endinput% +\fi% +%% End of the test for LaTeX 2015 (or newer). -%% similar to Heiko Oberdiek, http://permalink.gmane.org/gmane.comp.tex.latex.latex3/2159 +\RequirePackage{ifetex}[2011/12/15]% v1.2 +\ifetex% + %% then we can use the code of David Carlisle: + %% https://tex.stackexchange.com/a/212483/6865 + \mathchardef\float@count=32767\relax% + \def\dc@extrafloats#1{% + \ifnum#1>\z@% + \count@\numexpr\float@count-1\relax% + \mathchardef\float@count\count@\relax% + \expandafter\mathchardef\csname bx@\the\float@count\endcsname\float@count% + \@cons\@freelist{\csname bx@\the\float@count\endcsname}% + \expandafter% + \dc@extrafloats\expandafter{\numexpr#1-1\relax}% + \fi}% + \dc@extrafloats{\morefloats@morefloats}% + \expandafter\endinput% +\fi% + +%% Not eTeX, otherwise the last \endinput would have been applied. +\PackageWarning{morefloats}{% + e-TeX is not available here\MessageBreak% + but it is available in almost all\MessageBreak% + recent TeX distributions.\MessageBreak% + Maybe consider updating to one of those% + \@gobble% + }% + +%% Code similar to the one from Heiko Oberdiek, +%% http://permalink.gmane.org/gmane.comp.tex.latex.latex3/2159 \@tempcnta=\the\count10 \relax \def\maxfloats@vln{count} % -\ifnum \count11>\@tempcnta \@tempcnta=\the\count11 \relax \def\maxfloats@vln{dimen} \fi -\ifnum \count12>\@tempcnta \@tempcnta=\the\count12 \relax \def\maxfloats@vln{skip} \fi -\ifnum \count14>\@tempcnta \@tempcnta=\the\count14 \relax \def\maxfloats@vln{box} \fi +\ifnum \count11>\@tempcnta \@tempcnta=\the\count11 \relax \def\maxfloats@vln{dimen} \fi% +\ifnum \count12>\@tempcnta \@tempcnta=\the\count12 \relax \def\maxfloats@vln{skip} \fi% +\ifnum \count14>\@tempcnta \@tempcnta=\the\count14 \relax \def\maxfloats@vln{box} \fi% %% end similar -\@ifpackageloaded{etex}{\@tempcntb=\et@xins\relax}{\@tempcntb=234\relax} -\advance\@tempcntb by -\@tempcnta% -\@tempcnta=\@tempcntb\relax -\advance\@tempcntb by +18% reserved by default -\ifnum \morefloats@mx>\@tempcntb \relax - \@ifpackageloaded{etex}{% - \PackageError{morefloats}{Too many floats requested}{% - Maximum number of possible floats asked for: \morefloats@mx .\MessageBreak% - There are only \the\@tempcnta\space regular \maxfloats@vln\space left,\MessageBreak% - therefore only \the\@tempcntb\space floats will be possible.\MessageBreak% - To have more floats available, use\MessageBreak% - \string\usepackage{etex}\MessageBreak% - \@backslashchar reserveinserts{...}\MessageBreak% - right after \string\documentclass[...]{...},\MessageBreak% - where the argument of \@backslashchar reserveinserts should be\MessageBreak% - at least \morefloats@mx\space (plus 10 if bigfoot or manyfoot package is used;\MessageBreak% - but \@backslashchar reserveinserts < about 234).\MessageBreak% - } - }{ - \PackageError{morefloats}{Too many floats requested}{% +\@tempcntb=234\relax% +\advance\@tempcntb by -\@tempcnta\relax% +\@tempcnta=\@tempcntb\relax% +\advance\@tempcntb by +18% already reserved by default +\ifnum\morefloats@mx>\@tempcntb\relax% + \PackageError{morefloats}{Too many floats requested}{% Maximum number of possible floats asked for: \morefloats@mx .\MessageBreak% There are only \the\@tempcnta\space \maxfloats@vln\space left,\MessageBreak% therefore only \the\@tempcntb\space floats will be possible.\MessageBreak% Reduce the number of used \maxfloats@vln\space to have more floats available!\MessageBreak% - (Or load the etex package before the morefloats package.)\MessageBreak% - } - } + }% \gdef\morefloats@mx{\the\@tempcntb}% -\else - \PackageInfo{morefloats}{% - Maximum number of possible floats asked for: \morefloats@mx .\MessageBreak% - LaTeX might run out of memory before this\MessageBreak% - (in which case it will notify you).\MessageBreak% - } -\fi +\fi% \global\long\def\@freelist{\@elt\bx@A\@elt\bx@B\@elt\bx@C\@elt\bx@D\@elt\bx@E\@elt\bx@F\@elt\bx@G\@elt\bx@H\@elt% \bx@I\@elt\bx@J\@elt\bx@K\@elt\bx@L\@elt\bx@M\@elt\bx@N\@elt\bx@O\@elt\bx@P\@elt\bx@Q\@elt\bx@R} @@ -412,18 +495,31 @@ \ifnum \morefloats@mx>253 \newinsert\bx@IT \expandafter\gdef\expandafter\@freelist\expandafter{\@freelist \@elt\bx@IT} \ifnum \morefloats@mx>254 \newinsert\bx@IU \expandafter\gdef\expandafter\@freelist\expandafter{\@freelist \@elt\bx@IU} \ifnum \morefloats@mx>255 \newinsert\bx@IV \expandafter\gdef\expandafter\@freelist\expandafter{\@freelist \@elt\bx@IV} -\ifnum \morefloats@mx>256 - \PackageError{morefloats}{Too many floats called for}{% - You requested more than 256 floats.\MessageBreak% - (\morefloats@mx\space to be precise.)\MessageBreak% - According to my knowledge, LaTeX cannot process\MessageBreak% - more than 256 floats, therefore the morefloats\MessageBreak% - package only provides 256 floats.\MessageBreak% - If you really need more floats,\MessageBreak% - maybe ask a wizard to increase this number.\MessageBreak% - (I expected LaTeX to run out of dimensions or memory\MessageBreak% - \space long before reaching this anyway.)\MessageBreak% - } +\ifnum \morefloats@mx>256\relax% + \ifx\e@alloc\@undefined\relax% old LaTeX format + \PackageError{morefloats}{Too many floats called for}{% + You requested more than 256 floats.\MessageBreak% + (\morefloats@mx\space to be precise.)\MessageBreak% + LaTeX before 2015 could not process\MessageBreak% + more than 256 floats, therefore the morefloats\MessageBreak% + package only provides 256 floats.\MessageBreak% + If you need more floats,\MessageBreak% + update to a current (>=2015) LaTeX distribution.\MessageBreak% + I expected LaTeX (prior 2015) to run out of dimensions\MessageBreak% + or memory long before reaching this anyway.\MessageBreak% + }% + \else% new LaTeX format, therefore we are here + % because an outdated version of the etex package was used + \PackageError{morefloats}{Too many floats called for}{% + You requested more than 256 floats.\MessageBreak% + (\morefloats@mx\space to be precise.)\MessageBreak% + LaTeX can process more than 256 floats since 2015,\MessageBreak% + but not if an outdated version of the etex package\MessageBreak% + was loaded before the morefloats package.\MessageBreak% + Therefore the morefloats package only provides\MessageBreak% + 256 floats now. If you need more floats,\MessageBreak% + update your etex package to the recent version!\MessageBreak% + }% \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi @@ -437,7 +533,7 @@ \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi -\fi \fi \fi \fi \fi +\fi \fi \fi \fi \fi \fi \endinput %% |