summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/padcount
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-05-05 21:14:21 +0000
committerKarl Berry <karl@freefriends.org>2018-05-05 21:14:21 +0000
commit9131aae12d9a1826be738381d79bffab364d93b6 (patch)
treedeae7972bed6416b2d2452ac900fa9a868145289 /Master/texmf-dist/tex/latex/padcount
parentf0145b0157ebca6d2b1a9815e2547e82c968dac4 (diff)
padcount (5may18)
git-svn-id: svn://tug.org/texlive/trunk@47621 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/padcount')
-rw-r--r--Master/texmf-dist/tex/latex/padcount/padcount.sty69
1 files changed, 69 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/padcount/padcount.sty b/Master/texmf-dist/tex/latex/padcount/padcount.sty
new file mode 100644
index 00000000000..48e7aa28495
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/padcount/padcount.sty
@@ -0,0 +1,69 @@
+%%
+%% This is file `padcount.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% padcount.dtx (with options: `package')
+%% This is a generated file.
+%%
+%% This document is copyright 2018 by Donald P. Goodman, and is
+%% released publicly under the LaTeX Project Public License. The
+%% distribution and modification of this work is constrained by the
+%% conditions of that license. See
+%% http://www.latex-project.org/lppl.txt
+%% for the text of the license. This document is released
+%% under version 1.3c of that license, and this work may be distributed
+%% or modified under the terms of that license or, at your option, any
+%% later version.
+%%
+%% This work has the LPPL maintenance status 'maintained'.
+%%
+%% The Current Maintainer of this work is Donald P. Goodman
+%% (dgoodmaniii@gmail.com).
+%%
+%% This work consists of padcount.dtx, padcount.ins, and
+%% derived files padcount.sty and padcount.pdf.
+
+\NeedsTeXFormat{LaTeX2e}[1999/12/01]
+\ProvidesPackage{padcount}[2018/05/04 v1.0 Pad numbers with arbitrary characters]
+\newcount\pad@charcount%
+\def\pad@expandloop#1{%
+\pad@xloop#1\relax
+}
+\def\pad@xloop#1{%
+\ifx\relax#1%
+\else%
+\advance\pad@charcount by1%
+\expandafter\pad@xloop%
+\fi%
+}%
+\def\pad@countchar#1{%
+\pad@charcount=0%
+\expandafter\expandafter\pad@expandloop{#1}%
+}%
+\newcount\pad@tmp%
+\newcount\pad@tmpi%
+\newcount\pad@num\pad@num=2%
+\def\pad@char{0}%
+\def\padnum#1{%
+\edef\pad@yy{#1}%
+\expandafter\pad@countchar{\pad@yy}%
+\pad@tmp=\pad@charcount%
+\multiply\pad@tmp by-1%
+\advance\pad@tmp by\pad@num%
+\pad@tmpi=0%
+\ifnum\pad@tmp>0%
+\loop%
+\ifnum\pad@tmpi<\pad@tmp%
+\pad@char%
+\advance\pad@tmpi by1%
+\repeat%
+\fi%
+\leavevmode#1%
+}%
+\def\setpadnum#1{\pad@num=#1}%
+\def\setpadchar#1{\def\pad@char{#1}}%
+\endinput
+%%
+%% End of file `padcount.sty'.