summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Master/texmf-dist/doc/latex/showdim/README26
-rw-r--r--Master/texmf-dist/tex/latex/showdim/showdim.sty97
-rwxr-xr-xMaster/tlpkg/bin/tlpkg-ctan-check3
-rw-r--r--Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc1
-rw-r--r--Master/tlpkg/tlpsrc/showdim.tlpsrc0
5 files changed, 126 insertions, 1 deletions
diff --git a/Master/texmf-dist/doc/latex/showdim/README b/Master/texmf-dist/doc/latex/showdim/README
new file mode 100644
index 00000000000..c5e51279232
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/showdim/README
@@ -0,0 +1,26 @@
+Copyright 1999 Michael John Downes.
+Copyright 2012 TeX Users Group.
+This file is part of the showdim package, released under the LPPL;
+see showdim.sty for details.
+
+This package (showdim) prints dimensions in various values:
+
+\tenthpt - Print dimen in points, rounded to the nearest tenth
+\tenthpc - Print dimen in picas, rounded to the nearest tenth
+\hundredthpc - Print dimen in picas, rounded to the nearest hundredth
+\tenthpcpt - Print dimen in tenths of a pica and whole points.
+\pttenthpc - Print dimen in points and tenths of a pica.
+\pthundredthpc - Print dimen in points followed by the equivalent in picas
+ (to two decimal places).
+\points - Print dimen rounded to the nearest whole point.
+\picas - Print dimen converted to the nearest whole pica.
+
+This package was written by Michael Downes, who passed away in 2003. He
+released it without a license, which is considered nonfree nowadays. In
+October 2012, his heirs (his children Zoe, Elizabeth, and Mia Downes)
+have all agreed to re-releasing his work under any version of the LaTeX
+Public Project License. Therefore, the package is now released under
+the LPPL, version 1 or (at your option) any later version.
+
+The only change in this release is to the license (and typos).
+The actual code is the same as Michael's last release.
diff --git a/Master/texmf-dist/tex/latex/showdim/showdim.sty b/Master/texmf-dist/tex/latex/showdim/showdim.sty
new file mode 100644
index 00000000000..1bf74accc9a
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/showdim/showdim.sty
@@ -0,0 +1,97 @@
+% Copyright 1999 Michael John Downes.
+% Copyright 2012 TeX Users Group.
+% This file is part of the showdim package.
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2003/12/01 or later.
+%
+% This work has the LPPL maintenance status "unmaintained".
+%
+% There are only two files in this package: showdim.sty and README.
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{showdim}[2012/12/18 v1.2]
+
+% Print dimen in points, rounded to the nearest tenth.
+%
+\newcommand{\tenthpt}[1]{\dimen@#1\relax
+% Round up to the nearest tenth, by half-adding:
+ \advance\dimen@ \ifdim\dimen@<\z@-\fi .05\p@
+ \expandafter\tenth@extract\the\dimen@ pt}
+
+% Print dimen in picas, rounded to the nearest tenth.
+%
+\newcommand{\tenthpc}[1]{\dimen@#1\relax
+% Round up to the nearest tenth
+ \advance\dimen@ \ifdim\dimen@<\z@-\fi .05pc%
+ \divide\dimen@ 12 \expandafter\tenth@extract\the\dimen@ pc}
+
+% Print dimen in picas, rounded to the nearest hundredth.
+%
+\newcommand{\hundredthpc}[1]{\dimen@#1\relax
+% Round up to the nearest hundredth
+ \advance\dimen@ \ifdim\dimen@<\z@-\fi .005pc%
+ \divide\dimen@ 12 \expandafter\hundredth@extract\the\dimen@ pc}
+
+% Print dimen in tenths of a pica and whole points.
+%
+\newcommand{\tenthpcpt}[1]{\tenthpc{#1} (\points{#1})}
+
+% Print dimen in points and tenths of a pica.
+%
+\newcommand{\pttenthpc}[1]{\points{#1} (\tenthpc{#1})}
+
+% Print dimen in points followed by the equivalent in picas (to
+% two decimal places).
+%
+\newcommand{\pthundredthpc}[1]{\points{#1} (\hundredthpc{#1})}
+
+% Print dimen truncated to one place after the decimal point
+% (maximum).
+%
+\edef\@tempa#1pt{#1\string p\string t}\@tempa
+\def\tenth@extract#1.#2#3pt{#1\ifnum#2=\z@ \else.#2\fi}
+
+% Print dimen truncated to two places after the decimal point
+% (maximum).
+%
+\edef\@tempa#1pt{#1\string p\string t}\@tempa
+\def\hundredth@extract#1.#2#3pt{#1\h@extract#2#300\@nil}
+
+% Extract a hundredths value: .0 is converted to "", .1 and .10 are both
+% converted to ".1", and .03 or .93 are printed as is.
+%
+\def\h@extract#1#2#3\@nil{%
+ \ifnum#1#2=\z@ \else.#1\ifnum#2=\z@ \else#2\fi\fi}
+
+% Print dimen rounded to the nearest whole point.
+%
+\newcommand{\points}[1]{\dimen@#1\relax
+ \advance\dimen@ \ifdim\dimen@<\z@-\fi .5\p@
+ \expandafter\wholepart@extract\the\dimen@\@nil pt}
+
+% Convert a negative point value to a positive value, for use in
+% messages such as "height of box A is \negpoints{\dimen@} less
+% than height of box B", where the negativity is conveyed by the
+% word "less" and therefore the minus sign should be removed from
+% the actual value that is printed in order not to be redundant.
+%
+\newcommand{\negpoints}[1]{\points{-#1}}
+
+% Print dimen converted to the nearest whole pica.
+%
+\newcommand{\picas}[1]{\dimen@#1\relax
+ \advance\dimen@ \ifdim\dimen@<\z@-\fi .5pc%
+ \divide\dimen@ 12 \expandafter\wholepart@extract\the\dimen@\@nil pc}
+
+% Extract the whole part of a decimal number (i.e. the part before
+% the decimal point.)
+%
+\def\wholepart@extract#1.#2\@nil{#1}
+
+\endinput %
diff --git a/Master/tlpkg/bin/tlpkg-ctan-check b/Master/tlpkg/bin/tlpkg-ctan-check
index 0ad36930153..702e4685538 100755
--- a/Master/tlpkg/bin/tlpkg-ctan-check
+++ b/Master/tlpkg/bin/tlpkg-ctan-check
@@ -375,7 +375,8 @@ my @TLP_working = qw(
sf298 sffms sfg
sfmath sgame shade shadethm shadow shadowtext shapepar
shipunov shorttoc
- show2e showcharinbox showexpl showhyphens showlabels showtags shuffle
+ show2e showcharinbox showdim showexpl showhyphens showlabels showtags
+ shuffle
sidecap sidenotes sides silence
simplecd simplecv simplewick simplified-latex
sitem siunitx
diff --git a/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc b/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc
index 4c01d30fbb8..5b53194a174 100644
--- a/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc
+++ b/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc
@@ -692,6 +692,7 @@ depend shipunov
depend shorttoc
depend show2e
depend showcharinbox
+depend showdim
depend showexpl
depend showlabels
depend sidecap
diff --git a/Master/tlpkg/tlpsrc/showdim.tlpsrc b/Master/tlpkg/tlpsrc/showdim.tlpsrc
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/Master/tlpkg/tlpsrc/showdim.tlpsrc