summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/regstats
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-05-17 23:09:04 +0000
committerKarl Berry <karl@freefriends.org>2011-05-17 23:09:04 +0000
commit2890d22f6ec817ed72f4929071ba6d63ede0c4b4 (patch)
tree5ffdeee429658f7d04704e73189fbd81392734d9 /Master/texmf-dist/tex/latex/regstats
parent36dd34a850a6284be752b454845c199ef83f62af (diff)
new latex package regstats (17may11)
git-svn-id: svn://tug.org/texlive/trunk@22508 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/regstats')
-rw-r--r--Master/texmf-dist/tex/latex/regstats/regstats.sty229
1 files changed, 229 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/regstats/regstats.sty b/Master/texmf-dist/tex/latex/regstats/regstats.sty
new file mode 100644
index 00000000000..946a338bf9f
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/regstats/regstats.sty
@@ -0,0 +1,229 @@
+%%
+%% This is file `regstats.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% regstats.dtx (with options: `package')
+%%
+%% This is a generated file.
+%%
+%% Project: regstats
+%% Version: 2011/05/16 v1.0b
+%%
+%% Copyright (C) 2011 by
+%% H.-Martin M"unch <Martin dot Muench at Uni-Bonn dot de>
+%%
+%% The usual disclaimer applys:
+%% If it doesn't work right that's your problem.
+%% (Nevertheless, send an e-mail to the maintainer
+%% when you find an error in this package.)
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%% http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is H.-Martin Muench.
+%%
+%% This work consists of the main source file regstats.dtx
+%% and the derived files
+%% regstats.sty, regstats.pdf, regstats.ins, regstats.drv,
+%% regstats-example.tex.
+%%
+\NeedsTeXFormat{LaTeX2e}[2009/09/24]
+\ProvidesPackage{regstats}[2011/05/16 v1.0b
+ Counting used registers (HMM)]
+
+%% Allows to count the number of used registers
+%% (counter, dimen, skip, muskip, box, token, input, output,
+%% math families, languages, insertions)
+%% and compare these to the maximum available number of such registers.
+
+\RequirePackage{kvoptions}[2010/12/23]% v3.10
+\RequirePackage{atveryend}[2011/04/23]% v1.7
+
+%% regstats may work with earlier versions of LaTeX and these
+%% packages, but this was not tested. Please consider updating
+%% your LaTeX and packages to the most recent version
+%% (if they are not already the most recent version).
+
+\SetupKeyvalOptions{family=regstats,prefix=regstats@}
+\DeclareBoolOption{proof}% \regstats@proof
+\ProcessKeyvalOptions*
+
+\newif\ifetex
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname eTeXversion\endcsname\relax
+ \etexfalse
+\else
+ \etextrue
+\fi
+
+\ifetex
+ \PackageInfo{regstats}{e-TeX found.}
+\else
+ \PackageWarning{regstats}{Could not find e-TeX.\MessageBreak%
+ That can mean that e-TeX was disabled or\MessageBreak%
+ that your distribution of TeX does not contain e-TeX.\MessageBreak%
+ Some packages will not work without e-TeX,\MessageBreak%
+ but should give according messages.\MessageBreak%
+ }
+\fi
+
+\AtVeryEndDocument{%
+ \AtVeryVeryEnd{%
+ \newcommand{\regstats@s}[3]{%
+ \setcounter{regstatscount}{#1}
+ \ifnum \value{regstatscount}=0
+ \setcounter{regstatscount}{2}
+ \fi
+ \ifnum \value{regstatscount}>1
+ \gdef\regstats@pl{#3}
+ \else
+ \gdef\regstats@pl{#2}
+ \fi
+ }
+ \newcounter{regstatscount}
+ \edef\regstats@counter{\the\allocationnumber}
+ \ifregstats@proof
+ \PackageWarning{regstats}{%
+ Package regstats loaded with option 'proof'.\MessageBreak%
+ This package itself will use one of each register\MessageBreak%
+ for testing!%
+ }%
+ \def\regstats@proof{1}
+ \edef\regstats@test{\the\count10}
+ \ifx\regstats@counter\regstats@test
+ \else \message{Discrepancy when counting count registers.^^J}
+ \def\regstats@proof{0}
+ \fi
+ \newdimen{\regstatsdimen}
+ \edef\regstats@dimen{\the\allocationnumber}
+ \edef\regstats@test{\the\count11}
+ \ifx\regstats@dimen\regstats@test
+ \else \message{Discrepancy when counting dimen registers.^^J}
+ \def\regstats@proof{0}
+ \fi
+ \newskip\regstatsskip
+ \edef\regstats@skip{\the\allocationnumber}
+ \edef\regstats@test{\the\count12}
+ \ifx\regstats@skip\regstats@test
+ \else \message{Discrepancy when counting skip registers.^^J}
+ \def\regstats@proof{0}
+ \fi
+ \newmuskip\regstatsmuskip
+ \edef\regstats@muskip{\the\allocationnumber}
+ \edef\regstats@test{\the\count13}
+ \ifx\regstats@muskip\regstats@test
+ \else \message{Discrepancy when counting muskip registers.^^J}
+ \def\regstats@proof{0}
+ \fi
+ \newbox\regstatsbox
+ \edef\regstats@box{\the\allocationnumber}
+ \edef\regstats@test{\the\count14}
+ \ifx\regstats@box\regstats@test
+ \else \message{Discrepancy when counting box registers.^^J}
+ \def\regstats@proof{0}
+ \fi
+ \newtoks\regstatstoks
+ \edef\regstats@toks{\the\allocationnumber}
+ \edef\regstats@test{\the\count15}
+ \ifx\regstats@toks\regstats@test
+ \else \message{Discrepancy when counting toks registers.^^J}
+ \def\regstats@proof{0}
+ \fi
+ \newread\regstatsread
+ \edef\regstats@read{\the\allocationnumber}
+ \edef\regstats@test{\the\count16}
+ \ifx\regstats@read\regstats@test
+ \else \message{Discrepancy when counting read registers.^^J}
+ \def\regstats@proof{0}
+ \fi
+ \newwrite\regstatswrite
+ \edef\regstats@write{\the\allocationnumber}
+ \edef\regstats@test{\the\count17}
+ \ifx\regstats@write\regstats@test
+ \else \message{Discrepancy when counting write registers.^^J}
+ \def\regstats@proof{0}
+ \fi
+ \newfam\regstatsfam
+ \edef\regstats@fam{\the\allocationnumber}
+ \edef\regstats@test{\the\count18}
+ \ifx\regstats@fam\regstats@test
+ \else \message{Discrepancy when counting fam registers.^^J}
+ \def\regstats@proof{0}
+ \fi
+ \newlanguage\regstatslanguage
+ \edef\regstats@language{\the\allocationnumber}
+ \edef\regstats@test{\the\count19}
+ \ifx\regstats@language\regstats@test
+ \else \message{Discrepancy when counting language registers.^^J}
+ \def\regstats@proof{0}
+ \fi
+ \newinsert\regstatsinsert
+ \edef\regstats@insert{\the\allocationnumber}
+ \edef\regstats@test{\the\count20}
+ \ifx\regstats@insert\regstats@test
+ \else \message{Discrepancy when counting insert registers.^^J}
+ \def\regstats@proof{0}
+ \fi
+ \edef\regstats@test{0}
+ \ifx\regstats@proof\regstats@test
+ \message{Regstats test for register numbers failed.^^J}
+ \message{Therefore option 'proof' is necessary to get the right numbers.^^J}
+ \fi
+ \else
+ \edef\regstats@dimen{\the\count11}
+ \edef\regstats@skip{\the\count12}
+ \edef\regstats@muskip{\the\count13}
+ \edef\regstats@box{\the\count14}
+ \edef\regstats@toks{\the\count15}
+ \edef\regstats@read{\the\count16}
+ \edef\regstats@write{\the\count17}
+ \edef\regstats@fam{\the\count18}
+ \edef\regstats@language{\the\count19}
+ \edef\regstats@insert{\the\count20}
+ \fi
+ \setcounter{regstatscount}{233}
+ \addtocounter{regstatscount}{-\regstats@insert}
+ \addtocounter{regstatscount}{+1}
+ \edef\regstats@insert{\arabic{regstatscount}}
+ \message{^^J}
+ \message{Here is how much of TeX's registers you used^^J}%
+ \message{\space (numbers of available registers are estimated!):^^J}%
+ \regstats@s{\regstats@counter}{}{s}
+ \message{ \regstats@counter\space counter register\regstats@pl\space out of}\ifetex\message{32767}\else\message{233}\fi
+ \regstats@s{\regstats@dimen}{}{s}
+ \message{^^J \regstats@dimen\space dimen register\regstats@pl\space out of}\ifetex\message{32767}\else\message{233}\fi
+ \regstats@s{\regstats@skip}{}{s}
+ \message{^^J \regstats@skip\space skip register\regstats@pl\space out of 233}
+ \regstats@s{\regstats@muskip}{}{s}
+ \message{^^J \regstats@muskip\space muskip register\regstats@pl\space out of}\ifetex\message{32767}\else\message{255}\fi
+ \regstats@s{\regstats@box}{}{s}
+ \message{^^J \regstats@box\space box register\regstats@pl\space out of}\ifetex\message{32767}\else\message{233}\fi
+ \regstats@s{\regstats@toks}{}{s}
+ \message{^^J \regstats@toks\space toks register\regstats@pl\space out of}\ifetex\message{32767}\else\message{255}\fi
+ \regstats@s{\regstats@read}{}{s}
+ \message{^^J \regstats@read\space input stream\regstats@pl\space (read) out of 15}
+ \regstats@s{\regstats@write}{}{s}
+ \message{^^J \regstats@write\space output stream\regstats@pl\space (write) out of 15}
+ \regstats@s{\regstats@fam}{y}{ies}
+ \message{^^J \regstats@fam\space math famil\regstats@pl\space (fam) out of 15}
+ \regstats@s{\regstats@language}{}{s}
+ \message{^^J \regstats@language\space language code\regstats@pl\space out of 255}
+ \regstats@s{\regstats@insert}{}{s}
+ \message{^^J \regstats@insert\space insertion\regstats@pl\space out of}\ifetex\message{124^^J}\else\message{101^^J}\fi
+ }
+ }
+
+\endinput
+%%
+%% End of file `regstats.sty'.