summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/makebase
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-05-10 21:31:42 +0000
committerKarl Berry <karl@freefriends.org>2016-05-10 21:31:42 +0000
commit880ed92665fb54066cc81173fb63170c174d0e12 (patch)
tree39a5533991a9c3f753c0353953593054a7fe923e /Master/texmf-dist/tex/latex/makebase
parentf2bbe39c5a0a52b3c110193d15b7fecc7033b74c (diff)
makebase (10may16)
git-svn-id: svn://tug.org/texlive/trunk@41012 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/makebase')
-rw-r--r--Master/texmf-dist/tex/latex/makebase/makebase.sty60
1 files changed, 60 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/makebase/makebase.sty b/Master/texmf-dist/tex/latex/makebase/makebase.sty
new file mode 100644
index 00000000000..ab2552b7a14
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/makebase/makebase.sty
@@ -0,0 +1,60 @@
+%%
+%% This is file `makebase.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% makebase.dtx (with options: `package')
+%% This file was generated from an XML master source.
+%% Amendments and corrections should be notified to the
+%% maintainer for inclusion in future versions.
+\NeedsTeXFormat{LaTeX2e}[2014/09/29]
+\ProvidesPackage{makebase}[2016/05/10 v0.2
+ Typeset counters in a different base]
+%%
+%% Packages required
+%%
+%% Required for calculations involving lengths or counters, such as changes to widths for margin adjustment.
+\RequirePackage{calc}
+\newcounter{Sil@MB@prenum}
+\newcounter{Sil@MB@postnum}
+\newcounter{Sil@MB@quot}
+\newcounter{Sil@MB@rem}
+\newcounter{Sil@MB@div}
+\newcommand{\Sil@MB@maxdiv}[2][16]{%
+ \setcounter{Sil@MB@div}{#1}%
+ \setcounter{Sil@MB@prenum}{#2}%
+ \loop
+ \divide\c@Sil@MB@prenum by\c@Sil@MB@div
+ \multiply\c@Sil@MB@prenum by\c@Sil@MB@div
+ \multiply\c@Sil@MB@div by#1
+ \ifnum\c@Sil@MB@prenum>0
+ \repeat
+ \divide\c@Sil@MB@div by#1
+ \divide\c@Sil@MB@div by#1
+}
+\newcommand{\makebase}[2][16]{%
+ \Sil@MB@maxdiv[#1]{#2}%
+ \ifnum#1=16 0x\else\ifnum#1=8 0\fi\fi
+ \setcounter{Sil@MB@prenum}{#2}%
+ \setcounter{Sil@MB@postnum}{#2}%
+ \loop
+ \ifnum\c@Sil@MB@div>\c@Sil@MB@prenum
+ 0\divide\c@Sil@MB@div by#1
+ \fi
+ \divide\c@Sil@MB@postnum by\c@Sil@MB@div
+ \setcounter{Sil@MB@quot}{\value{Sil@MB@postnum}}%
+ \multiply\c@Sil@MB@postnum by\c@Sil@MB@div
+ \setcounter{Sil@MB@rem}{\value{Sil@MB@prenum}-\value{Sil@MB@postnum}}%
+ \ifcase\c@Sil@MB@quot 0\or 1\or 2\or 3\or 4\or 5\or 6\or
+ 7\or 8\or 9\or A\or B\or C\or D\or E\or F\else !Z\fi
+ \setcounter{Sil@MB@prenum}{\value{Sil@MB@rem}}%
+ \setcounter{Sil@MB@postnum}{\value{Sil@MB@rem}}%
+ \divide\c@Sil@MB@div by#1
+ \ifnum\c@Sil@MB@rem>0
+ \repeat
+}
+
+\endinput
+%%
+%% End of file `makebase.sty'.