diff options
author | Karl Berry <karl@freefriends.org> | 2006-01-12 23:55:01 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-01-12 23:55:01 +0000 |
commit | 91f6a50595e5936ee4bfa015bba61aeedde08fdf (patch) | |
tree | 70eeca2b08203ac6d18e6dad5a7f98e853d19e9e /Master/texmf-dist/tex/latex | |
parent | 54fd1ca03b48f955c5df0fa2dcd2f8d1f3440187 (diff) |
eqparbox
git-svn-id: svn://tug.org/texlive/trunk@873 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r-- | Master/texmf-dist/tex/latex/eqparbox/eqparbox.sty | 115 |
1 files changed, 115 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/eqparbox/eqparbox.sty b/Master/texmf-dist/tex/latex/eqparbox/eqparbox.sty new file mode 100644 index 00000000000..e4f36bb0b92 --- /dev/null +++ b/Master/texmf-dist/tex/latex/eqparbox/eqparbox.sty @@ -0,0 +1,115 @@ +%% +%% This is file `eqparbox.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% eqparbox.dtx (with options: `package') +%% +%% This is a generated file. +%% +%% Copyright (C) 2004 Scott Pakin <scott+eqp@pakin.org> +%% ------------------------------------------------------- +%% +%% This package may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.2 +%% 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.2 or later is part of all distributions of LaTeX +%% version 1999/12/01 or later. +%% +%% File: eqparbox.dtx Copyright (C) 2004 Scott Pakin <scott+eqp@pakin.org> +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{eqparbox} + [2004/08/02 v2.1 Create equal-widthed parboxes] +\newlength{\eqp@tempdima} \newlength{\eqp@tempdimb} +\def\eqp@taglist{} +\newif\ifeqp@must@rerun +\AtEndDocument{% + \begingroup + \def\@elt#1{% + \eqp@tempdima\csname eqp@this@#1\endcsname\relax + \eqp@tempdimb\csname eqp@next@#1\endcsname\relax + \ifdim\eqp@tempdima=\eqp@tempdimb + \else + \@latex@warning@no@line{Rerun to correct the width of eqparbox `#1'}% + \fi + \immediate\write\@auxout{% + \string\expandafter\string\gdef\string\csname\space + eqp@this@#1\string\endcsname{% + \csname eqp@next@#1\endcsname + }% + ^^J% + \string\expandafter\string\gdef\string\csname\space + eqp@next@#1\string\endcsname{0pt}% + }% + }% + \eqp@taglist + \endgroup + \ifeqp@must@rerun + \@latex@warning@no@line{Rerun to correct eqparbox widths} + \fi +} +\newcommand*{\eqp@storefont}{% + \xdef\eqp@restorefont{% + \noexpand\usefont{\f@encoding}{\f@family}{\f@series}{\f@shape}% + \noexpand\fontsize{\f@size}{\f@baselineskip}% + \noexpand\selectfont + }% +} +\RequirePackage{array} +\newcommand{\eqp@settowidth}[2]{% + \settowidth{#1}{{% + \eqp@storefont + \begin{tabular}{@{}>{\eqp@restorefont}l<{\eqp@storefont}@{}}% + #2% + \end{tabular}% + }}% +} +\DeclareRobustCommand\eqparbox{% + \@ifnextchar[%] + {\eqparbox@i}% + {\eqparbox@iii[c][\relax][s]}% +} +\def\eqparbox@i[#1]{% + \@ifnextchar[%] + {\eqparbox@ii[#1]}% + {\eqparbox@iii[#1][\relax][s]}% +} +\def\eqparbox@ii[#1][#2]{% + \@ifnextchar[%] + {\eqparbox@iii[#1][#2]}% + {\eqparbox@iii[#1][#2][#1]}% +} +\def\eqparbox@iii[#1][#2][#3]#4#5{% + \eqp@settowidth{\eqp@tempdimb}{#5}% + \expandafter + \ifx\csname eqp@this@#4\endcsname\relax + \global\eqp@must@reruntrue + \expandafter\xdef\csname eqp@this@#4\endcsname{\the\eqp@tempdimb}% + \expandafter\xdef\csname eqp@next@#4\endcsname{\the\eqp@tempdimb}% + \else + \eqp@tempdima=\csname eqp@this@#4\endcsname\relax + \ifdim\eqp@tempdima<\eqp@tempdimb + \expandafter\xdef\csname eqp@this@#4\endcsname{\the\eqp@tempdimb}% + \global\eqp@must@reruntrue + \fi + \eqp@tempdima=\csname eqp@next@#4\endcsname\relax + \ifdim\eqp@tempdima<\eqp@tempdimb + \expandafter\xdef\csname eqp@next@#4\endcsname{\the\eqp@tempdimb}% + \fi + \fi + \@ifundefined{eqp@seen@#4}{% + \expandafter\gdef\csname eqp@seen@#4\endcsname{}% + \@cons\eqp@taglist{{#4}}% + }{}% + \eqp@tempdima=\csname eqp@this@#4\endcsname\relax + \parbox[#1][#2][#3]{\eqp@tempdima}{#5}% +} +\newcommand*{\eqboxwidth}[1]{% + \@ifundefined{eqp@this@#1}{0pt}{\csname eqp@this@#1\endcsname}% +} +\endinput +%% +%% End of file `eqparbox.sty'. |