diff options
author | Karl Berry <karl@freefriends.org> | 2006-01-12 23:54:29 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-01-12 23:54:29 +0000 |
commit | ad73d498164957eb83add5ac6424b396686afdf3 (patch) | |
tree | 06773f1978cdc56fa8e801cf565c8cc20e62f205 /Master/texmf-dist/tex/latex/easy/easy.sty | |
parent | 9b0a12d65600c00972d9f4953249e8f4b6d31f68 (diff) |
easy
git-svn-id: svn://tug.org/texlive/trunk@842 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/easy/easy.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/easy/easy.sty | 653 |
1 files changed, 653 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/easy/easy.sty b/Master/texmf-dist/tex/latex/easy/easy.sty new file mode 100644 index 00000000000..af005223129 --- /dev/null +++ b/Master/texmf-dist/tex/latex/easy/easy.sty @@ -0,0 +1,653 @@ +%%% ==================================================================== +%%% @LaTeX-style-file{ +%%% author = "Enrico Bertolazzi", +%%% version = "1.1", +%%% date = "31-MAY-2001", +%%% filename = "easy.sty", +%%% address = "Dipartimento di Ingeneria Meccanica e Strutturale, +%%% Trento University, +%%% Via Mesiano 77, Trento, Italy", +%%% FAX = "+39 (461) 882599", +%%% email = "enrico.bertolazzi@ing.unitn.it (Internet)", +%%% supported = "yes. Please send comments via E-mail", +%%% +%%% ==================================================================== +%%% +%%% INSTALLATION: +%%% Put this file where your TeX looks for inputs. +%%% +%%% DOCUMENTATION: +%%% no documentation +%%% +%%% Copyright 1999 Enrico Bertolazzi +%%% +%%% This program can be redistributed and/or modified under the terms +%%% of the LaTeX Project Public License Distributed from CTAN +%%% archives in directory macros/latex/base/lppl.txt; either +%%% version 1 of the License, or any later version. +%%% +%%% } +%%% ====================================================================%%% +%%% ___ ____ ___ _ _ ___ ____ ___ _ _ %%% +%%% / \ / / \ \ / / \ / / \ \ / %%% +%%% /____/ /__ /____/ \/ /____/ /__ /____/ \/ %%% +%%% / \ / / \ / / \ / / \ / %%% +%%% /____/ /____ / \ / /____/ /____ / \ / %%% +%%% ====================================================================%%% +%%% +%%% v1.0 30-AUG-1999 +%%% v1.1 31-MAY-2001 changed \@roman with \romannumeral (thanks to Claudio Beccari) +%%% added \easydashlen \easydashsep + +\def\filedate{2001/05/31} +\def\fileversion{v1.1} +\typeout{Document Style `easy' \fileversion\space<\filedate>.} +%% +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{easy}[\filedate\space\fileversion] + +\def\@easy@disable@space{\catcode`\ =9\endlinechar=-1} +\def\@easy@enable@space{\catcode`\ =10\endlinechar=`\^^M} + +\@easy@disable@space + +\newcount\@easy@level\@easy@level=\z@\relax +\newcount\@easy@ncol +\newcount\@easy@nrow +\newcount\@easy@cnt + +% +% define boxes for internal computation. +% +\@tempcnta=8\relax +\@whilenum\@tempcnta>\z@\do{ + \expandafter\global\expandafter\newbox\csname @easy@box\romannumeral\@tempcnta\endcsname + \expandafter\global\expandafter\newdimen\csname @easy@minx\romannumeral\@tempcnta\endcsname + \expandafter\global\expandafter\newdimen\csname @easy@miny\romannumeral\@tempcnta\endcsname + \expandafter\global\expandafter\newdimen\csname @easy@maxx\romannumeral\@tempcnta\endcsname + \expandafter\global\expandafter\newdimen\csname @easy@maxy\romannumeral\@tempcnta\endcsname + \advance\@tempcnta by\m@ne +} +% +% define dimens for internal computation. +% +\@tempcnta=30\relax +\@whilenum\@tempcnta>\z@\do{% + \expandafter\global\expandafter\newdimen\csname @easy@hsize\romannumeral\@tempcnta\endcsname% + \expandafter\global\expandafter\newdimen\csname @easy@vsize\romannumeral\@tempcnta\endcsname% + \advance\@tempcnta by\m@ne +} + +\def\@easy@ifnextchar#1#2#3{% + \let\reserved@d=#1% + \def\reserved@a{#2} + \def\reserved@b{#3}% + \futurelet\@let@token\@easy@ifnch} +\def\@easy@ifnch{% + \ifx\@let@token\reserved@d + \let\reserved@c\reserved@a + \else + \let\reserved@c\reserved@b + \fi + \reserved@c} + +\def\@easy@edef(#1)#2{\expandafter\edef\csname#1\endcsname{#2}} +\def\@easy@xdef(#1)#2{\expandafter\xdef\csname#1\endcsname{#2}} +\def\@easy@gdef(#1)#2{\expandafter\gdef\csname#1\endcsname{#2}} +\def\@easy@def(#1)#2{\expandafter\def\csname#1\endcsname{#2}} + +\def\@easy@let(#1)#2{% + \expandafter\let\csname#1\expandafter\endcsname\csname#2\endcsname} +\def\@easy@glet(#1)#2{% + \expandafter\global\expandafter\let\csname#1\expandafter\endcsname\csname#2\endcsname} + +% \@easy@rotate{\macro} +% rotate the contens of a macro, for example: +% +% \def\macro{abc} +% \@easy@rotate{\macro} +% +% now macro contains {bca} +\def\@easy@rotate@#1#2\end{#2#1}% +\def\@easy@rotate#1{\xdef#1{\expandafter\@easy@rotate@#1\end}}% + +% \@easy@firstchar{string} +% get the first character of a string. +% If the string is empty return `-' +\def\@easy@firstchar@#1#2\end{#1}% +\def\@easy@firstchar#1{\expandafter\@easy@firstchar@#1-\end}% + +\def\@easy@parse@cols#1{% + \gdef\@easy@list@align{lrc}% + \global\let\@easy@rules\@empty% + \global\let\@easy@align\@empty% + \expandafter\@easy@parsea#1\end% + \@easy@xdef(@easy@col@align\romannumeral\@easy@level){`\@easy@align}% + \@easy@xdef(@easy@col@rules\romannumeral\@easy@level){`\@easy@rules}% +} + +\def\@easy@parse@rows#1{% + \gdef\@easy@list@align{tbc}% + \global\let\@easy@rules\@empty% + \global\let\@easy@align\@empty% + \expandafter\@easy@parsea#1\end% + \@easy@xdef(@easy@row@align\romannumeral\@easy@level){`\@easy@align}% + \@easy@xdef(@easy@row@rules\romannumeral\@easy@level){`\@easy@rules}% +} + +% \@easy@list@align{string} +% Parse a string with alignement definitions and separate +% rules definition. +% \@easy@list@align muist contains the possible alignments. +% the rules coding is fixed as: +% @ => no rule +% . => dotted rule +% ; => dot-dash rule +% : => dased rule +% | => solid rule +% 0123456789 => solid rule 0 => thin 9 => thick +% +% The output are +% \@easy@align: which will contain alignement string +% \@easy@rules: which will contain rule definition string +% +% for example +% \def\@easy@list@align{rcl} +% \@easy@list@align{|r;cl} +% results in +% \@easy@align => rcl +% \@easy@rules => |;@@ +% +\def\@easy@parsea{\futurelet\@tempb\@easy@parseb} +\def\@easy@parseb{%parse column separator + \def\next{\xdef\@easy@rules{@\@easy@rules}\@easy@parsec}% + \@tfor\@tempa:=@.;:|0123456789\do{% + \expandafter\ifx\expandafter\@tempb\@tempa% + \xdef\@easy@rules{\@tempa\@easy@rules} + \def\next##1{\@easy@parsec}% + \@break@tfor% + \fi% + } + \next} + +\def\@easy@parsec{\futurelet\@tempb\@easy@parsed} +\def\@easy@parsed{% parse column alignment + \def\next{\@easy@parse@error}% + \ifx\@tempb\end% + \def\next##1{}% eat end + \else + \expandafter\@tfor\expandafter\@tempa\expandafter:\expandafter=\@easy@list@align\do{% + \expandafter\ifx\expandafter\@tempb\@tempa% + \xdef\@easy@align{\@tempa\@easy@align}% + \def\next##1{\@easy@parsea}% + \@break@tfor% + \fi% + } + \fi% + \next} + +\@easy@enable@space +\def\@easy@parse@error{% +\PackageWarningNoLine{`easy'}% +{unrecognized command \meaning\@tempb \space on line \the\inputlineno}} +\@easy@disable@space + +\newdimen\@easy@dash@len \@easy@dash@len=5pt\relax +\newdimen\@easy@dash@sep \@easy@dash@sep=2pt\relax + +\def\easydashlen#1{\@easy@dash@len=#1\relax} +\def\easydashsep#1{\@easy@dash@sep=#1\relax} + +% \@easy@h@dash{height}{width}{sep} +% +----+ | +% #1 | | | +% +----+ | +% #2 #3 +% \@easy@v@dash{width}{height}{sep} +% #1 +% +----+ +% #2 | | +% +----+ +% #3 +% ----- +\def\@easy@h@dash#1#2#3{\hbox{\vrule\@width#2\@height#1\@depth\z@\kern#3}} +\def\@easy@v@dash#1#2#3{\vbox{\hrule\@width#1\@height#2\@depth\z@\kern#3}} +% \@easy@h@dashes{totalwidth}{height}{sep1}{width}{sep2} +% |-------- totalwidth --------- | +% +---+ +----------+ | +% height | | | | | +% +---+ +----------+ | +% height sep1 width sep2 +% +\def\@easy@h@dashes#1#2#3#4#5{% + \setbox\@tempboxa\hbox{}% + \@tempdima=#1\relax% + \@tempcnta=\@ne% + \loop\advance\@tempcnta by\@ne% + \ifodd\@tempcnta\setbox0\@easy@h@dash{#2}{#2}{#3}\else\setbox0\@easy@h@dash{#2}{#4}{#5}\fi% + \@tempdimb=\wd\@tempboxa\relax\advance\@tempdimb by\wd0\relax + \ifdim\@tempdimb<\@tempdima\relax% + \setbox\@tempboxa\hbox{\unhbox\@tempboxa\unhbox0}% + \repeat% + \advance\@tempdima by -\wd\@tempboxa\relax% + \@tempdimb=\ht\@tempboxa\relax% + \hbox{\unhbox\@tempboxa\vrule\@width\@tempdima\@height\@tempdimb\@depth\z@} +} +\def\@easy@v@dashes#1#2#3#4#5{% + \setbox\@tempboxa\vbox{}% + \@tempdima=#1\relax% + \@tempcnta=\@ne% + \loop\advance\@tempcnta by\@ne% + \ifodd\@tempcnta\setbox0\@easy@v@dash{#2}{#2}{#3}\else\setbox0\@easy@v@dash{#2}{#4}{#5}\fi% + \@tempdimb=\ht\@tempboxa\relax\advance\@tempdimb by\ht0\relax% + \ifdim\@tempdimb<\@tempdima\relax% + \setbox\@tempboxa\vbox{\unvbox\@tempboxa\unvbox0}% + \repeat% + \advance\@tempdima by -\ht\@tempboxa\relax% + \@tempdimb=\wd\@tempboxa\relax% + \vbox{\unvbox\@tempboxa\hrule\@width\@tempdimb\@height\@tempdima\@depth\z@} +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\def\@easy@hdots(#1,#2){\@easy@h@dashes{#1}{#2}\@easy@dash@sep\z@\z@} +\def\@easy@vdots(#1,#2){\@easy@v@dashes{#1}{#2}\@easy@dash@sep\z@\z@} + +\def\@easy@hdashes(#1,#2){\@easy@h@dashes{#1}{#2}\z@\@easy@dash@len\@easy@dash@sep} +\def\@easy@vdashes(#1,#2){\@easy@v@dashes{#1}{#2}\z@\@easy@dash@len\@easy@dash@sep} + +\def\@easy@hdotdash(#1,#2){\@easy@h@dashes{#1}{#2}\@easy@dash@sep\@easy@dash@len\@easy@dash@sep} +\def\@easy@vdotdash(#1,#2){\@easy@v@dashes{#1}{#2}\@easy@dash@sep\@easy@dash@len\@easy@dash@sep} + +\def\@easy@hrule(#1,#2){\hbox{\vrule\@width#1\@height#2\@depth\z@}} +\def\@easy@vrule(#1,#2){\vbox{\hrule\@width#2\@height#1\@depth\z@}} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\def\@easy@h@draw#1#2{% + \expandafter\ifx#1.\@easy@hdots(#2,\@easy@size@dash)\else% + \expandafter\ifx#1;\@easy@hdotdash(#2,\@easy@size@dash)\else% + \expandafter\ifx#1:\@easy@hdashes(#2,\@easy@size@dash)\else% + \expandafter\ifx#1|\@easy@hrule(#2,\@easy@size@rule)\else% + \expandafter\ifx#1-\@easy@hrule(#2,\@easy@size@rule)\else% + \expandafter\ifx#1@\else% + \@easy@set@size{#1} + \@easy@hrule(#2,\@tempdima)% + \fi\fi\fi\fi\fi\fi% +} + +\def\@easy@v@draw#1#2{% + \expandafter\ifx#1.\@easy@vdots(#2,\@easy@size@dash)\else% + \expandafter\ifx#1;\@easy@vdotdash(#2,\@easy@size@dash)\else% + \expandafter\ifx#1:\@easy@vdashes(#2,\@easy@size@dash)\else% + \expandafter\ifx#1|\@easy@vrule(#2,\@easy@size@rule)\else% + \expandafter\ifx#1@\else + \@easy@set@size{#1} + \@easy@vrule(#2,\@tempdima)% + \fi\fi\fi\fi\fi% +} + +\def\@easy@set@size#1{ + \@tempdima=\@easy@size@rule\relax + \ifcase\number#1 + \divide\@tempdima5 + \or\divide\@tempdima4 + \or\divide\@tempdima3 + \or\divide\@tempdima2 + \or\divide\@tempdima1 + \or\multiply\@tempdima2 + \or\multiply\@tempdima3 + \or\multiply\@tempdima4 + \or\multiply\@tempdima5 + \or\multiply\@tempdima6 + \fi +} + +\def\@easy@kern@size#1{% + \expandafter\ifx#1.\@tempdima=\@easy@size@dash\else% + \expandafter\ifx#1;\@tempdima=\@easy@size@dash\else% + \expandafter\ifx#1:\@tempdima=\@easy@size@dash\else% + \expandafter\ifx#1|\@tempdima=\@easy@size@rule\else% + \expandafter\ifx#1-\@tempdima=\@easy@size@rule\else% + \expandafter\ifx#1@\@tempdima=\z@\else\@easy@set@size{#1}% + \fi\fi\fi\fi\fi\fi% +} + +\def\@easy@kern#1{\@easy@kern@size{#1}\kern\@tempdima} + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% \@easy@hbox[halign,valign,width,heigth,sep,content] +% +\def\@easy@hbox[#1,#2,#3,#4,#5,#6]{% + \hbox{\vbox to#4{\expandafter\ifx#2t\else\vss\fi% + \kern#5\hbox to#3{% + \expandafter\ifx#1l\else\hss\fi% + \kern#5\vphantom{\copy#6}\unhbox#6\kern#5% + \expandafter\ifx#1r\else\hss\fi}% + \kern#5\expandafter\ifx#2b\else\vss\fi}}} +% +% evaluate dimensions of box of boxes, it return +% \@easy@vsize max heigth + \@easy@spread +% \@easy@hsize max width + \@easy@spread +% +\def\@easy@evaldim{% + \@tempcnta=30\relax + \@whilenum\@tempcnta>\z@\do{% + \global\@nameuse{@easy@hsize\romannumeral\@tempcnta}=\z@% + \global\@nameuse{@easy@vsize\romannumeral\@tempcnta}=\z@% + \advance\@tempcnta by \m@ne}% + \setbox0\vbox{% + \unvcopy\@easy@mainbox% + \global\@easy@nrow=\z@% + \loop% + \unskip\global\setbox\@ne\lastbox% + \ifhbox\@ne% + \global\advance\@easy@nrow\@ne%%%% + \global\@easy@ncol=\z@ + \@tempdima\dp\@ne\relax + \advance\@tempdima\ht\@ne\relax + \advance\@tempdima\@easy@spread\relax + \advance\@tempdima\@easy@spread\relax + \global\@nameuse{@easy@vsize\romannumeral\@easy@nrow}=\@tempdima% + \setbox0=\hbox{% + \unhbox\@ne% + \loop% + \unskip\global\setbox\tw@=\lastbox% + \ifhbox\tw@% + \global\advance\@easy@ncol\@ne%%%% + \@tempdima\wd\tw@\relax + \advance\@tempdima\@easy@spread\relax + \advance\@tempdima\@easy@spread\relax + \ifdim\@tempdima>\@nameuse{@easy@hsize\romannumeral\@easy@ncol}\relax + \global\@nameuse{@easy@hsize\romannumeral\@easy@ncol}=\@tempdima% + \fi% + \repeat% + }% + \repeat% + }% +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\def\@easy@loop@cols#1{\@tempcnta=\@easy@ncol\relax% +\@whilenum\@tempcnta>\z@\do{#1\advance\@tempcnta by\m@ne}} + +\def\@easy@loop@rows#1{\@tempcnta=\@easy@nrow\relax% +\@whilenum\@tempcnta>\z@\do{#1\advance\@tempcnta by\m@ne}} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\def\@easy@balance@cols#1{% + \@tempdima=#1\relax% + \@easy@loop@cols{\@tempdimb=\@nameuse{@easy@hsize\romannumeral\@tempcnta}\relax + \ifdim\@tempdima<\@tempdimb\relax\@tempdima=\@tempdimb\fi} + \@easy@loop@cols{\global\@nameuse{@easy@hsize\romannumeral\@tempcnta}=\@tempdima\relax} +} + +\def\@easy@balance@rows#1{% + \@tempdima=#1\relax% + \@easy@loop@rows{\@tempdimb=\@nameuse{@easy@vsize\romannumeral\@tempcnta}\relax + \ifdim\@tempdima<\@tempdimb\relax\@tempdima=\@tempdimb\fi} + \@easy@loop@rows{\global\@nameuse{@easy@vsize\romannumeral\@tempcnta}=\@tempdima\relax} +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\def\@easy@balance@equalize#1{% + \@tempdima=#1\relax% + \@easy@loop@cols{\@tempdimb=\@nameuse{@easy@hsize\romannumeral\@tempcnta}\relax% + \ifdim\@tempdima<\@tempdimb\relax\@tempdima=\@tempdimb\fi} + \@easy@loop@rows{\@tempdimb=\@nameuse{@easy@vsize\romannumeral\@tempcnta}\relax% + \ifdim\@tempdima<\@tempdimb\relax\@tempdima=\@tempdimb\fi} + \@easy@loop@cols{\global\@nameuse{@easy@hsize\romannumeral\@tempcnta}=\@tempdima\relax} + \@easy@loop@rows{\global\@nameuse{@easy@vsize\romannumeral\@tempcnta}=\@tempdima\relax} +} + +\def\@easy@balance@row@col{% + \expandafter\ifx\@easy@balance c\@easy@balance@cols{\@easy@minx}\else% + \expandafter\ifx\@easy@balance r\@easy@balance@rows{\@easy@miny}\else% + \expandafter\ifx\@easy@balance b\@easy@balance@cols{\@easy@minx}\@easy@balance@rows{\@easy@miny}\else% + \expandafter\ifx\@easy@balance e\@easy@balance@equalize{\@easy@minx}% + \else% no balancing + \@tempdima=\@easy@minx\relax + \@tempdimb=\@easy@miny\relax + \@easy@loop@cols{\ifdim\@tempdima>\@nameuse{@easy@hsize\romannumeral\@tempcnta}% + \global\@nameuse{@easy@hsize\romannumeral\@tempcnta}=\@tempdima\fi} + \@easy@loop@rows{\ifdim\@tempdimb>\@nameuse{@easy@vsize\romannumeral\@tempcnta}% + \global\@nameuse{@easy@vsize\romannumeral\@tempcnta}=\@tempdimb\fi} + \fi\fi\fi\fi% +% + \ifdim\@easy@maxx>\z@ + \@tempdimc=\@easy@maxx\relax + \loop + \@easy@rotate\@easy@col@rules% + \edef\@tempc{\@easy@firstchar\@easy@col@rules}% + \expandafter\ifx\@tempc`\else + \@easy@kern@size\@tempc + \advance\@tempdimc by -\@tempdima\relax + \repeat + \@easy@loop@cols{\advance\@tempdimc by -\@nameuse{@easy@hsize\romannumeral\@tempcnta}\relax} + \divide\@tempdimc by\@easy@ncol\relax + \ifdim\@tempdimc>\z@ + \@easy@loop@cols{\global\advance\@nameuse{@easy@hsize\romannumeral\@tempcnta} by \@tempdimc\relax} + \fi + \fi +% + \ifdim\@easy@maxy>\z@ + \@tempdimc=\@easy@maxy\relax + \loop + \@easy@rotate\@easy@row@rules% + \edef\@tempc{\@easy@firstchar\@easy@row@rules}% + \expandafter\ifx\@tempc`\else + \@easy@kern@size\@tempc + \advance\@tempdimc by -\@tempdima\relax + \repeat + \@easy@loop@rows{\advance\@tempdimc by -\@nameuse{@easy@vsize\romannumeral\@tempcnta}\relax} + \divide\@tempdimc by\@easy@nrow\relax + \ifdim\@tempdimc>\z@ + \@easy@loop@rows{\global\advance\@nameuse{@easy@vsize\romannumeral\@tempcnta} by \@tempdimc\relax} + \fi + \fi + } + +\def\@easy@buildbox{% + \setbox0=\vbox{% + \unvbox\@easy@mainbox% + \@easy@rotate\@easy@row@rules% + \edef\@tempc{\@easy@firstchar\@easy@row@rules}% + \global\setbox\@easy@mainbox\vbox{\@easy@kern\@tempc}% + \global\@easy@nrow=\z@% + \loop% + \unskip\global\setbox\@ne=\lastbox% + \ifhbox\@ne% + \global\advance\@easy@nrow\@ne% + \@easy@rotate\@easy@row@rules% + \@easy@rotate\@easy@row@align% + \@easy@buildboxa% + \edef\@tempc{\@easy@firstchar\@easy@row@rules}% + \global\setbox\@easy@mainbox\vbox + {\@easy@kern\@tempc\box\tw@\unvbox\@easy@mainbox}% + \repeat + \@easy@rotate\@easy@row@rules% elim ` + \@easy@rotate\@easy@row@align% elim ` + } +} + +\def\@easy@buildboxa{% + \setbox0\hbox{% + \unhbox\@ne% + \@easy@rotate\@easy@col@rules% + \edef\@tempc{\@easy@firstchar\@easy@col@rules}% + \global\setbox\tw@\hbox{\@easy@kern\@tempc}% + \global\@easy@ncol=\z@% + \loop% + \unskip\global\setbox\@ne=\lastbox% + \ifhbox\@ne% + \global\advance\@easy@ncol\@ne% + \@easy@rotate\@easy@col@rules% + \@easy@rotate\@easy@col@align% + \edef\@tempa{\@easy@firstchar\@easy@col@align}% + \edef\@tempb{\@easy@firstchar\@easy@row@align}% + \edef\@tempc{\@easy@firstchar\@easy@col@rules}% + \global\setbox\tw@\hbox{% + \@easy@kern\@tempc% + \@easy@hbox[\@tempa,\@tempb,% + \@nameuse{@easy@hsize\romannumeral\@easy@ncol},% + \@nameuse{@easy@vsize\romannumeral\@easy@nrow},% + \@easy@spread,\@ne]% + \unhbox\tw@}% + \repeat + \@easy@rotate\@easy@col@rules% elim ` + \@easy@rotate\@easy@col@align% elim ` + } +} + +%%%%%%%%%%%%%%% Vertical lines %%%%%%%%%%%%%%%%%% +\def\@easy@vlines{% + \@tempcntb=\z@% + \@easy@rotate\@easy@col@rules% + \edef\@tempc{\@easy@firstchar\@easy@col@rules} + \global\setbox\@ne\hbox{\@easy@v@draw\@tempc{\ht\@easy@mainbox}}% + \loop% + \advance\@tempcntb\@ne% + \@easy@rotate\@easy@col@rules% + \edef\@tempc{\@easy@firstchar\@easy@col@rules}% + \expandafter\ifx\@tempc`\relax\else% + \global\setbox\@ne\hbox{% + \@easy@v@draw\@tempc{\ht\@easy@mainbox} + \kern\@nameuse{@easy@hsize\romannumeral\@tempcntb} + \unhbox\@ne}% + \repeat% +} + +%%%%%%%%%%%%%%% Horizontal lines %%%%%%%%%%%%%%%%%% +\def\@easy@hlines{% + \@tempcntb=\z@% + \@easy@rotate\@easy@row@rules% + \edef\@tempc{\@easy@firstchar\@easy@row@rules}% + \global\setbox\tw@\vbox{\@easy@h@draw\@tempc{\wd\@easy@mainbox}}% + \loop% + \advance\@tempcntb\@ne% + \@easy@rotate\@easy@row@rules% + \edef\@tempc{\@easy@firstchar\@easy@row@rules}% + \expandafter\ifx\@tempc`\relax\else% + \global\setbox\tw@\vbox{% + \@easy@h@draw\@tempc{\wd\@easy@mainbox} + \kern\@nameuse{@easy@vsize\romannumeral\@tempcntb} + \unvbox\tw@}% + \repeat% +} + + +%%%%%%%%%%%%%%% PATH COMMANDS %%%%%%%%%%%%%%% + +\def\addpath#1{\g@addto@macro\@easy@path{[#1]}} + +\def\@easy@dopath{%adjust size boxex + \global\setbox\thr@@\hbox{} + \@tempcntb=\z@% + \@easy@rotate\@easy@col@rules% + \edef\@tempc{\@easy@firstchar\@easy@col@rules} + \@easy@kern@size\@tempc% + \loop% + \advance\@tempcntb\@ne% + \global\advance\@nameuse{@easy@hsize\romannumeral\@tempcntb}\@tempdima + \@easy@rotate\@easy@col@rules% + \edef\@tempc{\@easy@firstchar\@easy@col@rules}% + \expandafter\ifx\@tempc`\relax\else% + \@easy@kern@size\@tempc + \divide\@tempdima\tw@ + \global\advance\@nameuse{@easy@hsize\romannumeral\@tempcntb}\@tempdima + \repeat% + \global\advance\@nameuse{@easy@hsize\romannumeral\@tempcntb}\@tempdima +% + \@tempcntb=\z@% + \@easy@rotate\@easy@row@rules% + \edef\@tempc{\@easy@firstchar\@easy@row@rules} + \@easy@kern@size\@tempc% + \loop% + \advance\@tempcntb\@ne% + \global\advance\@nameuse{@easy@vsize\romannumeral\@tempcntb}\@tempdima + \@easy@rotate\@easy@row@rules% + \edef\@tempc{\@easy@firstchar\@easy@row@rules}% + \expandafter\ifx\@tempc`\relax\else% + \@easy@kern@size\@tempc + \divide\@tempdima\tw@ + \global\advance\@nameuse{@easy@vsize\romannumeral\@tempcntb}\@tempdima + \repeat% + \global\advance\@nameuse{@easy@vsize\romannumeral\@tempcntb}\@tempdima + \expandafter\@easy@do@path@parse\@easy@path`} + +\def\@easy@do@path@parse{\futurelet\@tempa\@easy@do@path@parsea} +\def\@easy@do@path@parsea{% + \ifx`\@tempa\expandafter\@gobble + \else\expandafter\@easy@do@path\fi} + +\def\@easy@do@path[(#1,#2,#3)#4]{% + \xdef\@easy@k@line{#3}% + \global\@tempcnta\@easy@ncol% + \global\advance\@tempcnta-#1% + \global\@tempcntb#2% + \expandafter\@easy@do@path@path#4`\@easy@do@path@parse} + +\def\@easy@do@path@path{\futurelet\@tempa\@easy@do@path@patha} +\def\@easy@do@path@patha{% + \def\next##1{\@easy@do@path@path} + \ifx r\@tempa + \ifnum\@tempcnta=\z@\global\@tempcnta\@easy@ncol\fi + \global\advance\@tempcnta\m@ne + \@easy@add@h@tobox + \global\advance\@tempcnta\m@ne + \else\ifx l\@tempa + \@easy@add@h@tobox + \else\ifx u\@tempa + \@easy@add@v@tobox + \else\ifx d\@tempa + \ifnum\@tempcntb=\z@\global\@tempcntb\@easy@nrow\fi + \global\advance\@tempcntb\m@ne + \@easy@add@v@tobox + \global\advance\@tempcntb\m@ne + \else\def\next##1{} + \fi\fi\fi\fi\next} + +\def\@easy@add@h@tobox{% + \ifnum\@tempcnta=\@easy@ncol\global\@tempcnta\z@\fi + \global\setbox\thr@@\hbox{% + \rlap{\box\thr@@} + \@easy@ycoord{\@tempcntb}\raise\@tempdimc + \hb@xt@\z@{% + \@easy@xcoord{\@tempcnta}\kern\@tempdimc + \global\advance\@tempcnta\@ne + \kern-\@nameuse{@easy@hsize\romannumeral\@tempcnta} + \@easy@h@draw\@easy@k@line{\@nameuse{@easy@hsize\romannumeral\@tempcnta}}\hss} + } +} + +\def\@easy@add@v@tobox{% + \ifnum\@tempcntb=\@easy@nrow\global\@tempcntb\z@\fi + \global\setbox\thr@@\hbox{% + \rlap{\box\thr@@} + \@easy@ycoord{\@tempcntb}\raise\@tempdimc + \hb@xt@\z@{% + \@easy@xcoord{\@tempcnta}\kern\@tempdimc + \global\advance\@tempcntb\@ne + \@easy@v@draw\@easy@k@line{\@nameuse{@easy@vsize\romannumeral\@tempcntb}}\hss} + } +} + +\def\@easy@xcoord#1{% + \@tempdimc=\wd\@easy@mainbox + \@easy@cnt=\z@ + \@whilenum\@easy@cnt<#1\do{% + \advance\@easy@cnt\@ne + \advance\@tempdimc-\@nameuse{@easy@hsize\romannumeral\@easy@cnt} + }} + +\def\@easy@ycoord#1{% + \@tempdimc=\z@\@easy@cnt=\z@ + \@whilenum\@easy@cnt<#1\do{% + \advance\@easy@cnt\@ne + \advance\@tempdimc\@nameuse{@easy@vsize\romannumeral\@easy@cnt} + }} + +\@easy@enable@space + +\endinput +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |