summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/counttexruns
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-08-30 13:41:21 +0000
committerKarl Berry <karl@freefriends.org>2012-08-30 13:41:21 +0000
commitf8b362e32c55156f476cbd23cafd70e627c4f98f (patch)
tree73c29e723fdfa2af335e673f63058c8c77f6679c /Master/texmf-dist/tex/latex/counttexruns
parent27ae79473074206d0a11d96c1ad6c66d409d8189 (diff)
new latex package counttexruns (29aug12)
git-svn-id: svn://tug.org/texlive/trunk@27555 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/counttexruns')
-rw-r--r--Master/texmf-dist/tex/latex/counttexruns/counttexruns.sty28
1 files changed, 28 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/counttexruns/counttexruns.sty b/Master/texmf-dist/tex/latex/counttexruns/counttexruns.sty
new file mode 100644
index 00000000000..317b46d8f58
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/counttexruns/counttexruns.sty
@@ -0,0 +1,28 @@
+%% See file 'counttexruns.dtx' for copyright and licence.
+\NeedsTeXFormat{LaTeX2e}[1998/12/01]
+\ProvidesPackage{counttexruns}
+ [2012/08/27 v1.00 Counts the TeX runs]
+%% ^^A \% is ignored ...
+\newcounter{counttexruns}
+\newwrite\@counttexrunsfile
+\RequirePackage{kvoptions}
+\DeclareStringOption[ctr]{extension}
+\ProcessLocalKeyvalOptions*
+\IfFileExists{\jobname.\counttexruns@extension}{
+\immediate\openin\@counttexrunsfile=\jobname.\counttexruns@extension
+\immediate\read\@counttexrunsfile to \counttexruns
+\immediate\read\@counttexrunsfile to \counttexruns
+\immediate\closeout\@counttexrunsfile
+\setcounter{counttexruns}{\counttexruns}
+}{} %% \value{counttexruns} is still zero
+\stepcounter{counttexruns}
+\immediate\openout\@counttexrunsfile=\jobname.\counttexruns@extension
+\catcode`\%=11\relax
+\immediate\write\@counttexrunsfile{%% This file
+ '\jobname.\counttexruns@extension' was generated by the package counttexruns}
+\catcode`\%=14\relax
+\immediate\write\@counttexrunsfile{\arabic{counttexruns}}
+\immediate\closeout\@counttexrunsfile
+\endinput
+%%
+%% End of file `counttexruns.sty'.