summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2007-09-04 18:08:46 +0000
committerKarl Berry <karl@freefriends.org>2007-09-04 18:08:46 +0000
commit0e84bd293ad2e94ba3327368ad44991e9c70ee22 (patch)
treec54776d6ff5b07548159ccfa3ff9aad5503627fa
parentc9c46ee3e0affbd186d61b95b6cf4db1b0127fb1 (diff)
new package subdepth (3sep07)
git-svn-id: svn://tug.org/texlive/trunk@4876 c570f23f-e606-0410-a88d-b1316a301751
-rwxr-xr-xBuild/tools/tpm-ctan-check3
-rw-r--r--Master/texmf-dist/doc/latex/subdepth/README14
-rw-r--r--Master/texmf-dist/doc/latex/subdepth/subdepth.pdfbin0 -> 107960 bytes
-rw-r--r--Master/texmf-dist/source/latex/subdepth/subdepth.dtx252
-rw-r--r--Master/texmf-dist/source/latex/subdepth/subdepth.ins61
-rw-r--r--Master/texmf-dist/tex/latex/subdepth/subdepth.sty81
-rw-r--r--Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc1
-rw-r--r--Master/tlpkg/tlpsrc/subdepth.tlpsrc2
8 files changed, 413 insertions, 1 deletions
diff --git a/Build/tools/tpm-ctan-check b/Build/tools/tpm-ctan-check
index f585d4943bd..180a0dd6bde 100755
--- a/Build/tools/tpm-ctan-check
+++ b/Build/tools/tpm-ctan-check
@@ -127,7 +127,8 @@ my @WorkingTPM = qw(
snapshot songbook sort-by-letters soul sparklines spie
splines splitbib splitindex spotcolor sprite srcltx sseq
ssqquote stack stage stdclsdv stdpage stellenbosch struktex
- sttools subeqn subeqnarray subfig subfigure subfloat substr sudoku
+ sttools subdepth subeqn subeqnarray
+ subfig subfigure subfloat substr sudoku
sudokubundle sugconf supertabular svgcolor svn svn-multi svninfo
swebib syntax synproof syntrace synttree
t-angles Tabbing tableaux tabulary tabvar talk tamethebeast
diff --git a/Master/texmf-dist/doc/latex/subdepth/README b/Master/texmf-dist/doc/latex/subdepth/README
new file mode 100644
index 00000000000..09656e19cf7
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/subdepth/README
@@ -0,0 +1,14 @@
+___________________
+The SUBDEPTH package
+v0.1
+
+This package uses some Donald Arseneau code to unify the heights
+of math subscripts regardless of the presence of a superscript above.
+Compare $M_n$ to $M_n'$ in regular LaTeX for why this can be desirable.
+
+__________________________
+Packaged by Will Robertson
+wspr 81 [at] gmail [dot] com
+
+Copyright 2007
+Distributed under the LaTeX Project Public License
diff --git a/Master/texmf-dist/doc/latex/subdepth/subdepth.pdf b/Master/texmf-dist/doc/latex/subdepth/subdepth.pdf
new file mode 100644
index 00000000000..16fedccc7cb
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/subdepth/subdepth.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex/subdepth/subdepth.dtx b/Master/texmf-dist/source/latex/subdepth/subdepth.dtx
new file mode 100644
index 00000000000..2edf4c133f0
--- /dev/null
+++ b/Master/texmf-dist/source/latex/subdepth/subdepth.dtx
@@ -0,0 +1,252 @@
+% \iffalse
+%<*internal>
+\iffalse
+%</internal>
+%<*readme>
+____________________
+The SUBDEPTH package
+v0.1
+
+This package uses some Donald Arseneau code to unify the heights
+of math subscripts regardless of the presence of a superscript above.
+Compare $M_n$ to $M_n'$ in regular LaTeX for why this can be desirable.
+
+__________________________
+Packaged by Will Robertson
+wspr 81 [at] gmail [dot] com
+
+Copyright 2007
+Distributed under the LaTeX Project Public License
+%</readme>
+%<*internal>
+\fi
+\begingroup
+%</internal>
+%<*batchfile>
+\input docstrip.tex
+\keepsilent
+\preamble
+
+ __________________________________
+ Copyright (C) 2007 Will Robertson
+
+ License information appended.
+
+
+\endpreamble
+\postamble
+
+Copyright (C) 2007 by Will Robertson <wspr81@gmail.com>
+
+Distributable under the LaTeX Project Public License,
+version 1.3c or higher (your choice). The latest version of
+this license is at: http://www.latex-project.org/lppl.txt
+
+This work is "maintained" (as per LPPL maintenance status)
+by Will Robertson.
+
+This work consists of the file subdepth.dtx
+ and the derived files subdepth.pdf,
+ subdepth.sty, and
+ subdepth.ins.
+
+\endpostamble
+\askforoverwritefalse
+\generate{\file{subdepth.sty}{\from{subdepth.dtx}{package}}}
+%</batchfile>
+%<batchfile>\endbatchfile
+%<*internal>
+\generate{\file{\jobname.ins}{\from{\jobname.dtx}{batchfile}}}
+\nopreamble\nopostamble
+\generate{\file{README.txt}{\from{\jobname.dtx}{readme}}}
+\generate{\file{prepare.sh}{\from{\jobname.dtx}{prepare}}}
+\endgroup
+\immediate\write18{makeindex -s gind.ist -o \jobname.ind \jobname.idx}
+\immediate\write18{makeindex -s gglo.ist -o \jobname.gls \jobname.glo}
+%</internal>
+%
+%<*driver>
+\documentclass{ltxdoc}
+\EnableCrossrefs
+\CodelineIndex
+\RecordChanges
+%\OnlyDescription
+\newsavebox\wspr
+\savebox\wspr{\Huge $M_n$ $M_n'$}
+\usepackage{subdepth}
+\usepackage{url}
+\begin{document}
+ \DocInput{\jobname.dtx}
+\end{document}
+%</driver>
+%
+%
+% \fi
+%
+% \CheckSum{0}
+% \makeatletter
+%
+% \title{Unify subscript depths}
+% \author{Code by Donald Arseneau\\ Packaged by Will Robertson}
+% \GetFileInfo{subdepth.sty}
+% \date{\filedate \qquad \fileversion}
+%
+% \maketitle
+%
+% \begin{quote}\small
+% This small package comes essentially verbatim from the following |c.t.t.| post by Donald Arseneau: \url{http://groups.google.com/group/comp.text.tex/msg/f207c7535810d2c1}.\footnote{I am distributing this package with the LPPL license, while I assume that Donald's original code to be in the public domain. This license stuff can be a bit messy sometimes.}
+% \end{quote}
+%
+% Consider the standard output of a subscript with and without a superscript above:
+% \begin{center}
+% \usebox\wspr
+% \end{center}
+% The second $n$ is lower due to \TeX's default of jiggling the space when there are both superscripts and subscripts attached to a math symbol.
+%
+% In some circumstances, this isn't particularly desirable; this package adjusts \LaTeX's behaviour to unify the position of the subscript in both cases:
+% \begin{center}
+% \Huge $M_n$ $M_n'$
+% \end{center}
+%
+% Notice that to compensate for the higher subscript, the superscript position is slightly raised. The |[low-sup]| package option will suppress this change to the height of the superscripts.
+%
+%
+% \StopEventually{}
+%
+% \clearpage
+% \part{\textsf{\jobname} implementation}
+%\iffalse
+%<*package>
+%\fi
+%
+% This is the package.
+%
+% \begin{macrocode}
+\ProvidesPackage{subdepth}
+ [2007/09/02 v0.1 Unify subscript depths]
+% \end{macrocode}
+%
+% \changes{v0.1}{2007/08/30}{Initial version.}
+% \PrintChanges
+%
+% \section{Loading and package options}
+%
+% Since this package is extracted from \textsf{dchem}, don't bother if that package is already loaded:
+% \begin{macrocode}
+\@ifpackageloaded{dchem}{\PackageWarning{subdepth incorporated within dchem; aborting loading}\endinput}{}
+% \end{macrocode}
+%
+% Package option to lower the superscript height.
+% \begin{macrocode}
+\newif\if@wspr@sup@low@
+\DeclareOption{low-sup}{\@wspr@sup@low@true}
+\ProcessOptions
+% \end{macrocode}
+%
+% \section{Don's code}
+%
+% \textit{The comments that follow are Donald's. His out-commented diagnostic messages have been removed for clarity.}
+%
+% Set the fontdimen parameters for subscript and superscript position
+% so that |C_2H_5^+| has both subscripts at the same vertical position.
+% Do this by actually comparing |H_2| with |H_2^+| and adjusting the font's
+% sub-lowering (16, 17) by half the difference and setting the super-
+% raising (13, 14, 15) to the matching position. The settings (for
+% all three fonts t,s,ss) are determined once per text-font-size and
+% stored in the macro |\dch@sizet<size>| (e.g.\ |\csname dch@sizet12\endcsname|).
+% Since some specific fonts are used in different roles at different
+% text-font-sizes, the original (tfm) settings for each particular font
+% are saved in a macro |\dch@size<size>| (no "t") before they are changed
+% for the first time. When that font appears in a different role for
+% another text-font size, those original settings are restored first
+% before making changes.
+%
+% \begin{macrocode}
+\addto@hook\every@math@size{\dch@scr@hook}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\dch@scr@adjust{\@ifundefined{dch@sizet\f@size}%
+ {\expandafter\dch@set@script\csname dch@sizet\f@size\endcsname}%
+ {\csname dch@sizet\f@size\endcsname}}
+% \end{macrocode}
+% textfont done last so it takes precedence in case it is the same as
+% another style (like at \cmd\tiny)
+%
+% |#1| = single-token command name for executing settings
+% \begin{macrocode}
+\def\dch@set@script#1{%
+ \begingroup % fontdimen settings are global anyway
+ \frozen@everymath{}% Prevent recursion!
+ \let#1\@empty
+ \let\dch@do@one\relax
+ \dch@set@one\scriptscriptstyle\scriptscriptfont#1\ssf@size
+ \dch@set@one\scriptstyle\scriptfont#1\sf@size
+ \dch@set@one\textstyle\textfont#1\f@size
+ \endgroup
+ #1}
+% \end{macrocode}
+% ({\itshape Added conditional for the |[low-sup]| package option}):
+% \begin{macrocode}
+\def\dch@set@one#1#2#3#4{%
+ \@ifundefined{dch@size#4}%
+ {\expandafter\xdef\csname dch@size#4\endcsname{%
+ \unless\if@wspr@sup@low@
+ \fontdimen13\the#2\tw@=\the\fontdimen13#2\tw@
+ \fontdimen14\the#2\tw@=\the\fontdimen14#2\tw@
+ \fontdimen15\the#2\tw@=\the\fontdimen15#2\tw@
+ \fi
+ \fontdimen16\the#2\tw@=\the\fontdimen16#2\tw@
+ \fontdimen17\the#2\tw@=\the\fontdimen17#2\tw@}%
+ }{\csname dch@size#4\endcsname}%
+ \setbox\z@\hbox{$#1H_2$}\@tempdima\dp\z@
+ \setbox\z@\hbox{$#1H_2^{+\vrule \@height 1em}$}%
+% \end{macrocode}
+% {\itshape I've adapted Donald's code to use e\TeX\ methods for dimension calculating. \cmd\@tempdima\ is the `new sub lowering'. In \cmd\@tempdimb, the first two terms are the `adjustment', the second two the `new super raising'.}
+% \begin{macrocode}
+ \ifdim\@tempdima<\dp\z@
+ \@tempdima\dimexpr (\@tempdima+\dp\z@)/2 \relax
+ \@tempdimb\dimexpr (\dp\z@-\@tempdima+\ht\z@-1em) \relax
+ \xdef#3{#3\dch@do@one#2{\the\@tempdimb}{\the\@tempdima}}%
+ \fi}
+% \end{macrocode}
+% ({\itshape Added conditional for the |[low-sup]| package option}):
+% \begin{macrocode}
+\def\dch@do@one#1#2#3{%
+ \unless\if@wspr@sup@low@
+ \fontdimen13#1\tw@#2\relax
+ \fontdimen14#1\tw@\fontdimen13#1\tw@
+ \fontdimen15#1\tw@\fontdimen13#1\tw@
+ \fi
+ \fontdimen\sixt@@n#1\tw@#3
+ \fontdimen17#1\tw@
+ \fontdimen\sixt@@n#1\tw@}%
+% \end{macrocode}
+%
+% \begin{macrocode}
+\let\dch@scr@hook\dch@scr@adjust
+\ifx\glb@currsize\f@size
+ \dch@scr@adjust
+\fi
+% \end{macrocode}
+%
+%\iffalse
+%</package>
+%<*prepare>
+rm subdepth.zip
+latex subdepth.dtx
+mv README.txt README
+zip subdepth.zip subdepth.dtx subdepth.ins subdepth.pdf README
+%</prepare>
+%\fi
+%
+% \typeout{*************************************************************}
+% \typeout{*}
+% \typeout{* To finish the installation you have to move the following}
+% \typeout{* file into a directory searched by XeTeX:}
+% \typeout{*}
+% \typeout{* \space\space\space subdepth.sty}
+% \typeout{*}
+% \typeout{*************************************************************}
+%
+\endinput
diff --git a/Master/texmf-dist/source/latex/subdepth/subdepth.ins b/Master/texmf-dist/source/latex/subdepth/subdepth.ins
new file mode 100644
index 00000000000..10500d96fa9
--- /dev/null
+++ b/Master/texmf-dist/source/latex/subdepth/subdepth.ins
@@ -0,0 +1,61 @@
+%%
+%% This is file `subdepth.ins',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% subdepth.dtx (with options: `batchfile')
+%%
+%% __________________________________
+%% Copyright (C) 2007 Will Robertson
+%%
+%% License information appended.
+%%
+%%
+\input docstrip.tex
+\keepsilent
+\preamble
+
+ __________________________________
+ Copyright (C) 2007 Will Robertson
+
+ License information appended.
+
+\endpreamble
+\postamble
+
+Copyright (C) 2007 by Will Robertson <wspr81@gmail.com>
+
+Distributable under the LaTeX Project Public License,
+version 1.3c or higher (your choice). The latest version of
+this license is at: http://www.latex-project.org/lppl.txt
+
+This work is "maintained" (as per LPPL maintenance status)
+by Will Robertson.
+
+This work consists of the file subdepth.dtx
+ and the derived files subdepth.pdf,
+ subdepth.sty, and
+ subdepth.ins.
+
+\endpostamble
+\askforoverwritefalse
+\generate{\file{subdepth.sty}{\from{subdepth.dtx}{package}}}
+\endbatchfile
+%%
+%% Copyright (C) 2007 by Will Robertson <wspr81@gmail.com>
+%%
+%% Distributable under the LaTeX Project Public License,
+%% version 1.3c or higher (your choice). The latest version of
+%% this license is at: http://www.latex-project.org/lppl.txt
+%%
+%% This work is "maintained" (as per LPPL maintenance status)
+%% by Will Robertson.
+%%
+%% This work consists of the file subdepth.dtx
+%% and the derived files subdepth.pdf,
+%% subdepth.sty, and
+%% subdepth.ins.
+%%
+%%
+%% End of file `subdepth.ins'.
diff --git a/Master/texmf-dist/tex/latex/subdepth/subdepth.sty b/Master/texmf-dist/tex/latex/subdepth/subdepth.sty
new file mode 100644
index 00000000000..010b190bfbe
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/subdepth/subdepth.sty
@@ -0,0 +1,81 @@
+%%
+%% This is file `subdepth.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% subdepth.dtx (with options: `package')
+%%
+%% __________________________________
+%% Copyright (C) 2007 Will Robertson
+%%
+%% License information appended.
+%%
+\ProvidesPackage{subdepth}
+ [2007/09/02 v0.1 Unify subscript depths]
+\@ifpackageloaded{dchem}{\PackageWarning{subdepth incorporated within dchem; aborting loading}\endinput}{}
+\newif\if@wspr@sup@low@
+\DeclareOption{low-sup}{\@wspr@sup@low@true}
+\ProcessOptions
+\addto@hook\every@math@size{\dch@scr@hook}
+\def\dch@scr@adjust{\@ifundefined{dch@sizet\f@size}%
+ {\expandafter\dch@set@script\csname dch@sizet\f@size\endcsname}%
+ {\csname dch@sizet\f@size\endcsname}}
+\def\dch@set@script#1{%
+ \begingroup % fontdimen settings are global anyway
+ \frozen@everymath{}% Prevent recursion!
+ \let#1\@empty
+ \let\dch@do@one\relax
+ \dch@set@one\scriptscriptstyle\scriptscriptfont#1\ssf@size
+ \dch@set@one\scriptstyle\scriptfont#1\sf@size
+ \dch@set@one\textstyle\textfont#1\f@size
+ \endgroup
+ #1}
+\def\dch@set@one#1#2#3#4{%
+ \@ifundefined{dch@size#4}%
+ {\expandafter\xdef\csname dch@size#4\endcsname{%
+ \unless\if@wspr@sup@low@
+ \fontdimen13\the#2\tw@=\the\fontdimen13#2\tw@
+ \fontdimen14\the#2\tw@=\the\fontdimen14#2\tw@
+ \fontdimen15\the#2\tw@=\the\fontdimen15#2\tw@
+ \fi
+ \fontdimen16\the#2\tw@=\the\fontdimen16#2\tw@
+ \fontdimen17\the#2\tw@=\the\fontdimen17#2\tw@}%
+ }{\csname dch@size#4\endcsname}%
+ \setbox\z@\hbox{$#1H_2$}\@tempdima\dp\z@
+ \setbox\z@\hbox{$#1H_2^{+\vrule \@height 1em}$}%
+ \ifdim\@tempdima<\dp\z@
+ \@tempdima\dimexpr (\@tempdima+\dp\z@)/2 \relax
+ \@tempdimb\dimexpr (\dp\z@-\@tempdima+\ht\z@-1em) \relax
+ \xdef#3{#3\dch@do@one#2{\the\@tempdimb}{\the\@tempdima}}%
+ \fi}
+\def\dch@do@one#1#2#3{%
+ \unless\if@wspr@sup@low@
+ \fontdimen13#1\tw@#2\relax
+ \fontdimen14#1\tw@\fontdimen13#1\tw@
+ \fontdimen15#1\tw@\fontdimen13#1\tw@
+ \fi
+ \fontdimen\sixt@@n#1\tw@#3
+ \fontdimen17#1\tw@
+ \fontdimen\sixt@@n#1\tw@}%
+\let\dch@scr@hook\dch@scr@adjust
+\ifx\glb@currsize\f@size
+ \dch@scr@adjust
+\fi
+%%
+%% Copyright (C) 2007 by Will Robertson <wspr81@gmail.com>
+%%
+%% Distributable under the LaTeX Project Public License,
+%% version 1.3c or higher (your choice). The latest version of
+%% this license is at: http://www.latex-project.org/lppl.txt
+%%
+%% This work is "maintained" (as per LPPL maintenance status)
+%% by Will Robertson.
+%%
+%% This work consists of the file subdepth.dtx
+%% and the derived files subdepth.pdf,
+%% subdepth.sty, and
+%% subdepth.ins.
+%%
+%%
+%% End of file `subdepth.sty'.
diff --git a/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc b/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc
index e2734205de9..45ac56822f7 100644
--- a/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc
+++ b/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc
@@ -440,6 +440,7 @@ depend Package/statistik
depend Package/stdclsdv
depend Package/stdpage
depend Package/sttools
+depend Package/subdepth
depend Package/subeqn
depend Package/subeqnarray
depend Package/subfigure
diff --git a/Master/tlpkg/tlpsrc/subdepth.tlpsrc b/Master/tlpkg/tlpsrc/subdepth.tlpsrc
new file mode 100644
index 00000000000..aedec797d47
--- /dev/null
+++ b/Master/tlpkg/tlpsrc/subdepth.tlpsrc
@@ -0,0 +1,2 @@
+name subdepth
+category Package