summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/texdraw
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-01-12 23:46:03 +0000
committerKarl Berry <karl@freefriends.org>2006-01-12 23:46:03 +0000
commit873660d1a83ece926fe7206288dda9c36b349c1b (patch)
treea48f77125c309a355b5d0eb58d6b24446abe9d62 /Master/texmf-dist/tex/generic/texdraw
parent2939242967231097459df0fc3150fabc2f639111 (diff)
generic 1
git-svn-id: svn://tug.org/texlive/trunk@613 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/texdraw')
-rw-r--r--Master/texmf-dist/tex/generic/texdraw/blockdiagram.tex201
-rw-r--r--Master/texmf-dist/tex/generic/texdraw/texdraw.sty48
-rw-r--r--Master/texmf-dist/tex/generic/texdraw/texdraw.tex580
-rw-r--r--Master/texmf-dist/tex/generic/texdraw/txdps.tex45
-rw-r--r--Master/texmf-dist/tex/generic/texdraw/txdtools.tex80
5 files changed, 954 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/generic/texdraw/blockdiagram.tex b/Master/texmf-dist/tex/generic/texdraw/blockdiagram.tex
new file mode 100644
index 00000000000..7ac47c94c66
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/texdraw/blockdiagram.tex
@@ -0,0 +1,201 @@
+% Block diagrams in TeXdraw
+
+% $Id: blockdiagram.tex,v 1.11 1995/08/24 texdraw-V2R0 $
+
+% Copyright (C) 1993 Peter Kabal
+
+% The routines in this file are provided free of charge without
+% warranty of any kind. Note that the TeXdraw routines are copyrighted.
+% They may be distributed freely provided that the recipients also
+% acquire the right to distribute them freely. The notices to this
+% effect must be preserved when the files are distributed.
+
+% Peter Kabal
+% Department of Electrical Engineering
+% McGill University
+% 3480 University
+% Montreal, Quebec
+% Canada H3A 2A7
+
+% kabal@TSP.EE.McGill.CA
+
+% ===============================================================
+
+\input txdtools
+
+% size of sum and product circles
+\def\cradius{0.08}
+
+% \bdot
+% big dot
+\def\bdot{\fcir f:0 r:0.02 }
+
+% centred, stacked items
+\def\hcp#1{$\vcenter{\halign{\hss ##\hss\cr #1\crcr}}$}
+
+% left justified, stacked items
+\def\hlp#1{$\vcenter{\halign{##\hss\cr #1\crcr}}$}
+
+% right justified, stacked items
+\def\hrp#1{$\vcenter{\halign{\hss ##\cr #1\crcr}}$}
+
+% signal labels - Top text, Bottom text, Left text, Right text,
+% and Center text
+\def\Ttext#1{\bsegment
+ \textref h:C v:B \htext (0 +0.06){\hcp{#1}}
+ \esegment}
+\def\Btext#1{\bsegment
+ \textref h:C v:T \htext (0 -0.06){\hcp{#1}}
+ \esegment}
+\def\Ltext#1{\bsegment
+ \textref h:R v:C \htext (-0.06 0){\hrp{#1}}
+ \esegment}
+\def\Rtext#1{\bsegment
+ \textref h:L v:C \htext (+0.06 0){\hlp{#1}}
+ \esegment}
+\def\Ctext#1{\bsegment
+ \textref h:C v:C \htext{\hcp{#1}}
+ \esegment}
+
+% ruled box (horizontal) with centered label,
+% position set to the end of the box
+% \Fbox W H text
+\def\Fbox#1#2#3{\bsegment
+ \bsegment
+ \setsegscale 0.5
+ \textref h:C v:C \htext (#1 0){\hcp{#3}}
+ \esegment
+ \setsegscale 0.5 \lvec (0 #2)
+ \setsegscale 1
+ \rlvec (#1 0) \rlvec (0 -#2) \rlvec (-#1 0) \lvec (0 0)
+ \savepos (#1 0)(*@x *@y)
+ \esegment
+ \move (*@x *@y)}
+
+% ruled box (vertical) with centered label, position set to the end of the box
+% \Gbox W H text
+\def\Gbox#1#2#3{\bsegment
+ \bsegment
+ \setsegscale 0.5
+ \textref h:C v:C \htext (0 #2){\hcp{#3}}
+ \esegment
+ \setsegscale 0.5 \lvec (#1 0)
+ \setsegscale 1
+ \rlvec (0 #2) \rlvec (-#1 0) \rlvec (0 -#2) \lvec (0 0)
+ \savepos (0 #2)(*@x *@y)
+ \esegment
+ \move (*@x *@y)}
+
+% ruled triangle (horizontal) with centered label,
+% position set to the end of the box
+% \Ftri W H text
+\def\Ftri#1#2#3{\bsegment
+ \bsegment
+ \setsegscale 0.3333
+ \textref h:C v:C \htext (#1 0){\hcp{#3}}
+ \esegment
+ \bsegment
+ \savepos (#1 0)(*@x *@y)
+ \esegment
+ \setsegscale 0.5 \lvec (0 #2)
+ \setsegscale 1 \lvec (#1 0)
+ \setsegscale 0.5 \lvec (0 -#2) \lvec (0 0)
+ \esegment
+ \move (*@x *@y)}
+
+% \pluss
+% plus sign
+\def\pluss {\bsegment
+ \setsegscale {\cradius}
+ \move (-0.5 0) \lvec (+0.5 0)
+ \move (0 -0.5) \lvec (0 +0.5)
+ \esegment}
+
+% \minuss
+% minus sign
+\def\minuss {\bsegment
+ \setsegscale {\cradius}
+ \move (-0.5 0) \lvec (+0.5 0)
+ \esegment}
+% \mults
+% multiplication sign
+\def\mults {\bsegment
+ \setsegscale {\cradius}
+ \realmult \cradius {0.354} \tmpa
+ \move (-0.354 -0.354) \lvec (+0.354 +0.354)
+ \move (-0.354 +0.354) \lvec (+0.354 -0.354)
+ \esegment}
+
+% \pcir
+% circle of given radius with a plus sign
+\def\pcir {\lcir r:{\cradius} \pluss}
+
+% \mcir
+% circle of given radius with a multiplication sign
+\def\mcir {\lcir r:{\cradius} \mults}
+
+% \putn, \putnne, etc
+% places text at an offset from the center of a circle, with
+% the position of the text specified in compass directions
+\def\puttext (#1 #2)#3{\bsegment
+ \setsegscale {\cradius}
+ \textref h:C v:C \htext (#1 #2){#3}
+ \esegment}
+\def\putn #1{\puttext ( 0 +2 ){#1}}
+\def\putnne #1{\puttext (+1.2 +1.7){#1}}
+\def\putene #1{\puttext (+1.7 +1.2){#1}}
+\def\putese #1{\puttext (+1.7 -1.2){#1}}
+\def\putsse #1{\puttext (+1.2 -1.7){#1}}
+\def\puts #1{\puttext ( 0 -2 ){#1}}
+\def\putssw #1{\puttext (-1.2 -1.7){#1}}
+\def\putwsw #1{\puttext (-1.7 -1.2){#1}}
+\def\putwnw #1{\puttext (-1.7 +1.2){#1}}
+\def\putnnw #1{\puttext (-1.2 +1.7){#1}}
+
+
+% \avectoc
+% arrow vector to a circle
+\def\avectoc (#1 #2){\currentpos \xa\ya
+ \cossin ({\xa} \ya)(#1 #2)\cosa\sina
+ \savepos (#1 #2)(*@x *@y)%
+ \bsegment
+ \move (*@x *@y)%
+ \setsegscale {\cradius}
+ \rmove ({-\cosa} -\sina)%
+ \savecurrpos (*@x *@y)%
+ \esegment
+ \avec (*@x *@y)%
+ \move (#1 #2)}
+% \avecfrc
+% arrow vector from a circle
+\def\avecfrc (#1 #2){\currentpos \xa\ya
+ \cossin ({\xa} \ya)(#1 #2)\cosa\sina
+ \bsegment
+ \setsegscale {\cradius}
+ \move ({\cosa} \sina)%
+ \savecurrpos (*@x *@y)%
+ \esegment
+ \move (*@x *@y)%
+ \avec (#1 #2)}
+% \avecfrctoc
+% arrow vector from a circle to a circle
+\def\avecfrctoc (#1 #2){\currentpos \xa\ya
+ \cossin ({\xa} \ya)(#1 #2)\cosa\sina
+ \bsegment
+ \setsegscale {\cradius}
+ \move ({\cosa} \sina)%
+ \savecurrpos (*@x *@y)%
+ \esegment
+ \move (*@x *@y)%
+ \avectoc (#1 #2)}
+% \lvecfrc
+% line vector from a circle
+\def\lvecfrc (#1 #2){\currentpos \xa\ya
+ \cossin ({\xa} \ya)(#1 #2)\cosa\sina
+ \bsegment
+ \setsegscale {\cradius}
+ \move ({\cosa} {\sina})%
+ \savecurrpos (*@x *@y)%
+ \esegment
+ \move (*@x *@y)%
+ \lvec (#1 #2)}
diff --git a/Master/texmf-dist/tex/generic/texdraw/texdraw.sty b/Master/texmf-dist/tex/generic/texdraw/texdraw.sty
new file mode 100644
index 00000000000..1ae95b44a97
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/texdraw/texdraw.sty
@@ -0,0 +1,48 @@
+% TeXdraw macros
+
+% $Id: texdraw.sty,v 2.3 1995/12/19 texdraw-V2R0 $
+
+% Copyright (C) 1991-1995 Peter Kabal
+
+% The TeXdraw routines in this file are provided free of charge without
+% warranty of any kind. Note that the TeXdraw routines are copyrighted.
+% They may be distributed freely provided that the recipients also
+% acquire the right to distribute them freely. The notices to this
+% effect must be preserved when the files are distributed.
+
+% Peter Kabal
+% Department of Electrical Engineering
+% McGill University
+% 3480 University
+% Montreal, Quebec
+% Canada H3A 2A7
+
+% kabal@TSP.EE.McGill.CA
+
+% ===============================================================
+
+\NeedsTeXFormat{LaTeX2e}
+
+% Pass all options to the graphics package
+\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{graphics}}
+\ProcessOptions
+
+% Load the graphics package if not already loaded
+\RequirePackage{graphics}
+
+% Define the error routine
+\def\t@xderror #1{%
+ \GenericError{%
+ \space\space\space\@spaces\@spaces\@spaces
+ }{%
+ TeXdraw Error: #1%
+ }{%
+ See the TeXdraw manual for an explanation.%
+ }{\@ehc}%
+}
+
+% Load the TeXdraw macros
+\input texdraw
+\ProvidesPackage{texdraw}[\TeXdrawId]
+\newenvironment{texdraw}{\leavevmode\btexdraw}{\etexdraw}
+
diff --git a/Master/texmf-dist/tex/generic/texdraw/texdraw.tex b/Master/texmf-dist/tex/generic/texdraw/texdraw.tex
new file mode 100644
index 00000000000..9b354424510
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/texdraw/texdraw.tex
@@ -0,0 +1,580 @@
+% TeXdraw macros
+
+% $Id: texdraw.tex,v 2.3 1995/12/19 texdraw-V2R0 $
+
+% Copyright (C) 1991-1995 Peter Kabal
+
+% The TeXdraw routines in this file are provided free of charge without
+% warranty of any kind. Note that the TeXdraw routines are copyrighted.
+% They may be distributed freely provided that the recipients also
+% acquire the right to distribute them freely. The notices to this
+% effect must be preserved when the files are distributed.
+
+% Peter Kabal
+% Department of Electrical Engineering
+% McGill University
+% 3480 University
+% Montreal, Quebec
+% Canada H3A 2A7
+
+% kabal@TSP.EE.McGill.CA
+\def\setRevDate $#1 #2 #3${#2}
+\def\TeXdrawId{\setRevDate $Date: 1995/12/19 16:40:42 $ TeXdraw V2R0}
+\chardef\catamp=\the\catcode`\@
+\catcode`\@=11
+\long
+\def\centertexdraw #1{\hbox to \hsize{\hss
+\btexdraw #1\etexdraw
+\hss}}
+\def\btexdraw {\x@pix=0 \y@pix=0
+\x@segoffpix=\x@pix \y@segoffpix=\y@pix
+\t@exdrawdef
+\setbox\t@xdbox=\vbox\bgroup\offinterlineskip
+\global\d@bs=0
+\global\t@extonlytrue
+\global\p@osinitfalse
+\s@avemove \x@pix \y@pix
+\m@pendingfalse
+\global\p@osinitfalse
+\p@athfalse
+\the\everytexdraw}
+\def\etexdraw {\ift@extonly \else
+\t@drclose
+\fi
+\egroup
+\ifdim \wd\t@xdbox>0pt
+\t@xderror {TeXdraw box non-zero size,
+possible extraneous text}%
+\fi
+\vbox {\offinterlineskip
+\pixtobp \xminpix \l@lxbp \pixtobp \yminpix \l@lybp
+\pixtobp \xmaxpix \u@rxbp \pixtobp \ymaxpix \u@rybp
+\hbox{\t@xdinclude
+[{\l@lxbp},{\l@lybp}][{\u@rxbp},{\u@rybp}]{\p@sfile}}%
+\pixtodim \xminpix \t@xpos \pixtodim \yminpix \t@ypos
+\kern \t@ypos
+\hbox {\kern -\t@xpos
+\box\t@xdbox
+\kern \t@xpos}%
+\kern -\t@ypos\relax}}
+\def\drawdim #1 {\def\d@dim{#1\relax}}
+\def\setunitscale #1 {\edef\u@nitsc{#1}%
+\realmult \u@nitsc \s@egsc \d@sc}
+\def\relunitscale #1 {\realmult {#1}\u@nitsc \u@nitsc
+\realmult \u@nitsc \s@egsc \d@sc}
+\def\setsegscale #1 {\edef\s@egsc {#1}%
+\realmult \u@nitsc \s@egsc \d@sc}
+\def\relsegscale #1 {\realmult {#1}\s@egsc \s@egsc
+\realmult \u@nitsc \s@egsc \d@sc}
+\def\bsegment {\ifp@ath
+\f@lushbs
+\f@lushmove
+\fi
+\begingroup
+\x@segoffpix=\x@pix
+\y@segoffpix=\y@pix
+\setsegscale 1
+\global\advance \d@bs by 1\relax}
+\def\esegment {\endgroup
+\ifnum \d@bs=0
+\writetx {es}%
+\else
+\global\advance \d@bs by -1
+\fi}
+\def\savecurrpos (#1 #2){\getsympos (#1 #2)\a@rgx\a@rgy
+\s@etcsn \a@rgx {\the\x@pix}%
+\s@etcsn \a@rgy {\the\y@pix}}
+\def\savepos (#1 #2)(#3 #4){\getpos (#1 #2)\a@rgx\a@rgy
+\coordtopix \a@rgx \t@pixa
+\advance \t@pixa by \x@segoffpix
+\coordtopix \a@rgy \t@pixb
+\advance \t@pixb by \y@segoffpix
+\getsympos (#3 #4)\a@rgx\a@rgy
+\s@etcsn \a@rgx {\the\t@pixa}%
+\s@etcsn \a@rgy {\the\t@pixb}}
+\def\linewd #1 {\coordtopix {#1}\t@pixa
+\f@lushbs
+\writetx {\the\t@pixa\space sl}}
+\def\setgray #1 {\f@lushbs
+\writetx {#1 sg}}
+\def\lpatt (#1){\listtopix (#1)\p@ixlist
+\f@lushbs
+\writetx {[\p@ixlist] sd}}
+\def\lvec (#1 #2){\getpos (#1 #2)\a@rgx\a@rgy
+\s@etpospix \a@rgx \a@rgy
+\writeps {\the\x@pix\space \the\y@pix\space lv}}
+\def\rlvec (#1 #2){\getpos (#1 #2)\a@rgx\a@rgy
+\r@elpospix \a@rgx \a@rgy
+\writeps {\the\x@pix\space \the\y@pix\space lv}}
+\def\move (#1 #2){\getpos (#1 #2)\a@rgx\a@rgy
+\s@etpospix \a@rgx \a@rgy
+\s@avemove \x@pix \y@pix}
+\def\rmove (#1 #2){\getpos (#1 #2)\a@rgx\a@rgy
+\r@elpospix \a@rgx \a@rgy
+\s@avemove \x@pix \y@pix}
+\def\lcir r:#1 {\coordtopix {#1}\t@pixa
+\writeps {\the\t@pixa\space cr}%
+\r@elupd \t@pixa \t@pixa
+\r@elupd {-\t@pixa}{-\t@pixa}}
+\def\fcir f:#1 r:#2 {\coordtopix {#2}\t@pixa
+\writeps {\the\t@pixa\space #1 fc}%
+\r@elupd \t@pixa \t@pixa
+\r@elupd {-\t@pixa}{-\t@pixa}}
+\def\lellip rx:#1 ry:#2 {\coordtopix {#1}\t@pixa
+\coordtopix {#2}\t@pixb
+\writeps {\the\t@pixa\space \the\t@pixb\space el}%
+\r@elupd \t@pixa \t@pixb
+\r@elupd {-\t@pixa}{-\t@pixb}}
+\def\fellip f:#1 rx:#2 ry:#3 {\coordtopix {#2}\t@pixa
+\coordtopix {#3}\t@pixb
+\writeps {\the\t@pixa\space \the\t@pixb\space #1 fe}%
+\r@elupd \t@pixa \t@pixb
+\r@elupd {-\t@pixa}{-\t@pixb}}
+\def\larc r:#1 sd:#2 ed:#3 {\coordtopix {#1}\t@pixa
+\writeps {\the\t@pixa\space #2 #3 ar}}
+\def\ifill f:#1 {\writeps {#1 fl}}
+\def\lfill f:#1 {\writeps {#1 fp}}
+\def\htext #1{\def\testit {#1}%
+\ifx \testit\l@paren
+\let\next=\h@move
+\else
+\let\next=\h@text
+\fi
+\next {#1}}
+\def\rtext td:#1 #2{\def\testit {#2}%
+\ifx \testit\l@paren
+\let\next=\r@move
+\else
+\let\next=\r@text
+\fi
+\next td:#1 {#2}}
+\def\vtext {\rtext td:90 }
+\def\textref h:#1 v:#2 {\ifx #1R%
+\edef\l@stuff {\hss}\edef\r@stuff {}%
+\else
+\ifx #1C%
+\edef\l@stuff {\hss}\edef\r@stuff {\hss}%
+\else
+\edef\l@stuff {}\edef\r@stuff {\hss}%
+\fi
+\fi
+\ifx #2T%
+\edef\t@stuff {}\edef\b@stuff {\vss}%
+\else
+\ifx #2C%
+\edef\t@stuff {\vss}\edef\b@stuff {\vss}%
+\else
+\edef\t@stuff {\vss}\edef\b@stuff {}%
+\fi
+\fi}
+\def\avec (#1 #2){\getpos (#1 #2)\a@rgx\a@rgy
+\s@etpospix \a@rgx \a@rgy
+\writeps {\the\x@pix\space \the\y@pix\space (\a@type)
+\the\a@lenpix\space \the\a@widpix\space av}}
+\def\ravec (#1 #2){\getpos (#1 #2)\a@rgx\a@rgy
+\r@elpospix \a@rgx \a@rgy
+\writeps {\the\x@pix\space \the\y@pix\space (\a@type)
+\the\a@lenpix\space \the\a@widpix\space av}}
+\def\arrowheadsize l:#1 w:#2 {\coordtopix{#1}\a@lenpix
+\coordtopix{#2}\a@widpix}
+\def\arrowheadtype t:#1 {\edef\a@type{#1}}
+\def\clvec (#1 #2)(#3 #4)(#5 #6)%
+{\getpos (#1 #2)\a@rgx\a@rgy
+\coordtopix \a@rgx\t@pixa
+\advance \t@pixa by \x@segoffpix
+\coordtopix \a@rgy\t@pixb
+\advance \t@pixb by \y@segoffpix
+\getpos (#3 #4)\a@rgx\a@rgy
+\coordtopix \a@rgx\t@pixc
+\advance \t@pixc by \x@segoffpix
+\coordtopix \a@rgy\t@pixd
+\advance \t@pixd by \y@segoffpix
+\getpos (#5 #6)\a@rgx\a@rgy
+\s@etpospix \a@rgx \a@rgy
+\writeps {\the\t@pixa\space \the\t@pixb\space
+\the\t@pixc\space \the\t@pixd\space
+\the\x@pix\space \the\y@pix\space cv}}
+\def\drawbb {\bsegment
+\drawdim bp
+\linewd 0.24
+\setunitscale {\p@sfactor}
+\writeps {\the\xminpix\space \the\yminpix\space mv}%
+\writeps {\the\xminpix\space \the\ymaxpix\space lv}%
+\writeps {\the\xmaxpix\space \the\ymaxpix\space lv}%
+\writeps {\the\xmaxpix\space \the\yminpix\space lv}%
+\writeps {\the\xminpix\space \the\yminpix\space lv}%
+\esegment}
+\def\getpos (#1 #2)#3#4{\g@etargxy #1 #2 {} \\#3#4%
+\c@heckast #3%
+\ifa@st
+\g@etsympix #3\t@pixa
+\advance \t@pixa by -\x@segoffpix
+\pixtocoord \t@pixa #3%
+\fi
+\c@heckast #4%
+\ifa@st
+\g@etsympix #4\t@pixa
+\advance \t@pixa by -\y@segoffpix
+\pixtocoord \t@pixa #4%
+\fi}
+\def\getsympos (#1 #2)#3#4{\g@etargxy #1 #2 {} \\#3#4%
+\c@heckast #3%
+\ifa@st \else
+\t@xderror {TeXdraw: invalid symbolic coordinate}%
+\fi
+\c@heckast #4%
+\ifa@st \else
+\t@xderror {TeXdraw: invalid symbolic coordinate}%
+\fi}
+\def\listtopix (#1)#2{\def #2{}%
+\edef\l@ist {#1 }%
+\m@oretrue
+\loop
+\expandafter\g@etitem \l@ist \\\a@rgx\l@ist
+\a@pppix \a@rgx #2%
+\ifx \l@ist\empty
+\m@orefalse
+\fi
+\ifm@ore
+\repeat}
+\def\realmult #1#2#3{\dimen0=#1pt
+\dimen2=#2\dimen0
+\edef #3{\expandafter\c@lean\the\dimen2}}
+\def\intdiv #1#2#3{\t@counta=#1
+\t@countb=#2
+\ifnum \t@countb<0
+\t@counta=-\t@counta
+\t@countb=-\t@countb
+\fi
+\t@countd=1
+\ifnum \t@counta<0
+\t@counta=-\t@counta
+\t@countd=-1
+\fi
+\t@countc=\t@counta \divide \t@countc by \t@countb
+\t@counte=\t@countc \multiply \t@counte by \t@countb
+\advance \t@counta by -\t@counte
+\t@counte=-1
+\loop
+\advance \t@counte by 1
+\ifnum \t@counte<16
+\multiply \t@countc by 2
+\multiply \t@counta by 2
+\ifnum \t@counta<\t@countb \else
+\advance \t@countc by 1
+\advance \t@counta by -\t@countb
+\fi
+\repeat
+\divide \t@countb by 2
+\ifnum \t@counta<\t@countb
+\advance \t@countc by 1
+\fi
+\ifnum \t@countd<0
+\t@countc=-\t@countc
+\fi
+\dimen0=\t@countc sp
+\edef #3{\expandafter\c@lean\the\dimen0}}
+\def\coordtopix #1#2{\dimen0=#1\d@dim
+\dimen2=\d@sc\dimen0
+\t@counta=\dimen2
+\t@countb=\s@ppix
+\divide \t@countb by 2
+\ifnum \t@counta<0
+\advance \t@counta by -\t@countb
+\else
+\advance \t@counta by \t@countb
+\fi
+\divide \t@counta by \s@ppix
+#2=\t@counta}
+\def\pixtocoord #1#2{\t@counta=#1%
+\multiply \t@counta by \s@ppix
+\dimen0=\d@sc\d@dim
+\t@countb=\dimen0
+\intdiv \t@counta \t@countb #2}
+\def\pixtodim #1#2{\t@countb=#1%
+\multiply \t@countb by \s@ppix
+#2=\t@countb sp\relax}
+\def\pixtobp #1#2{\dimen0=\p@sfactor pt
+\t@counta=\dimen0
+\multiply \t@counta by #1%
+\ifnum \t@counta < 0
+\advance \t@counta by -32768
+\else
+\advance \t@counta by 32768
+\fi
+\divide \t@counta by 65536
+\edef #2{\the\t@counta}}
+\newcount\t@counta \newcount\t@countb
+\newcount\t@countc \newcount\t@countd
+\newcount\t@counte
+\newcount\t@pixa \newcount\t@pixb
+\newcount\t@pixc \newcount\t@pixd
+\newdimen\t@xpos \newdimen\t@ypos
+\newcount\xminpix \newcount\xmaxpix
+\newcount\yminpix \newcount\ymaxpix
+\newcount\a@lenpix \newcount\a@widpix
+\newcount\x@pix \newcount\y@pix
+\newcount\x@segoffpix \newcount\y@segoffpix
+\newcount\x@savepix \newcount\y@savepix
+\newcount\s@ppix
+\newcount\d@bs
+\newcount\t@xdnum
+\global\t@xdnum=0
+\newbox\t@xdbox
+\newwrite\drawfile
+\newif\ifm@pending
+\newif\ifp@ath
+\newif\ifa@st
+\newif\ifm@ore
+\newif \ift@extonly
+\newif\ifp@osinit
+\newtoks\everytexdraw
+\def\l@paren{(}
+\def\a@st{*}
+\catcode`\%=12
+\def\p@b {%!} \def\p@p {%%}
+\catcode`\%=14
+\catcode`\{=12 \catcode`\}=12 \catcode`\u=1 \catcode`\v=2
+\def\l@br u{v \def\r@br u}v
+\catcode `\{=1 \catcode`\}=2 \catcode`\u=11 \catcode`\v=11
+{\catcode`\p=12 \catcode`\t=12
+\gdef\c@lean #1pt{#1}}
+\def\sppix#1/#2 {\dimen0=1#2 \s@ppix=\dimen0
+\t@counta=#1%
+\divide \t@counta by 2
+\advance \s@ppix by \t@counta
+\divide \s@ppix by #1%
+\t@counta=\s@ppix
+\multiply \t@counta by 65536
+\advance \t@counta by 32891
+\divide \t@counta by 65782
+\dimen0=\t@counta sp
+\edef\p@sfactor {\expandafter\c@lean\the\dimen0}}
+\def\g@etargxy #1 #2 #3 #4\\#5#6{\def #5{#1}%
+\ifx #5\empty
+\g@etargxy #2 #3 #4 \\#5#6% leading blank
+\else
+\def #6{#2}%
+\def\next {#3}%
+\ifx \next\empty \else
+\t@xderror {TeXdraw: invalid coordinate}%
+\fi
+\fi}
+\def\c@heckast #1{\expandafter
+\c@heckastll #1\\}
+\def\c@heckastll #1#2\\{\def\testit {#1}%
+\ifx \testit\a@st
+\a@sttrue
+\else
+\a@stfalse
+\fi}
+\def\g@etsympix #1#2{\expandafter
+\ifx \csname #1\endcsname \relax
+\t@xderror {TeXdraw: undefined symbolic coordinate}%
+\fi
+#2=\csname #1\endcsname}
+\def\s@etcsn #1#2{\expandafter
+\xdef\csname#1\endcsname {#2}}
+\def\g@etitem #1 #2\\#3#4{\edef #4{#2}\edef #3{#1}}
+\def\a@pppix #1#2{\edef\next {#1}%
+\ifx \next\empty \else
+\coordtopix {#1}\t@pixa
+\ifx #2\empty
+\edef #2{\the\t@pixa}%
+\else
+\edef #2{#2 \the\t@pixa}%
+\fi
+\fi}
+\def\s@etpospix #1#2{\coordtopix {#1}\x@pix
+\advance \x@pix by \x@segoffpix
+\coordtopix {#2}\y@pix
+\advance \y@pix by \y@segoffpix
+\u@pdateminmax \x@pix \y@pix}
+\def\r@elpospix #1#2{\coordtopix {#1}\t@pixa
+\advance \x@pix by \t@pixa
+\coordtopix {#2}\t@pixa
+\advance \y@pix by \t@pixa
+\u@pdateminmax \x@pix \y@pix}
+\def\r@elupd #1#2{\t@counta=\x@pix
+\advance\t@counta by #1%
+\t@countb=\y@pix
+\advance\t@countb by #2%
+\u@pdateminmax \t@counta \t@countb}
+\def\u@pdateminmax #1#2{\ifnum #1>\xmaxpix
+\global\xmaxpix=#1%
+\fi
+\ifnum #1<\xminpix
+\global\xminpix=#1%
+\fi
+\ifnum #2>\ymaxpix
+\global\ymaxpix=#2%
+\fi
+\ifnum #2<\yminpix
+\global\yminpix=#2%
+\fi}
+\def\s@avemove #1#2{\x@savepix=#1\y@savepix=#2%
+\m@pendingtrue
+\ifp@osinit \else
+\global\p@osinittrue
+\global\xminpix=\x@savepix \global\yminpix=\y@savepix
+\global\xmaxpix=\x@savepix \global\ymaxpix=\y@savepix
+\fi}
+\def\f@lushmove {\global\p@osinittrue
+\ifm@pending
+\writetx {\the\x@savepix\space \the\y@savepix\space mv}%
+\m@pendingfalse
+\p@athfalse
+\fi}
+\def\f@lushbs {\loop
+\ifnum \d@bs>0
+\writetx {bs}%
+\global\advance \d@bs by -1
+\repeat}
+\def\h@move #1#2 #3)#4{\move (#2 #3)%
+\h@text {#4}}
+\def\h@text #1{\pixtodim \x@pix \t@xpos
+\pixtodim \y@pix \t@ypos
+\vbox to 0pt{\normalbaselines
+\t@stuff
+\kern -\t@ypos
+\hbox to 0pt{\l@stuff
+\kern \t@xpos
+\hbox {#1}%
+\kern -\t@xpos
+\r@stuff}%
+\kern \t@ypos
+\b@stuff\relax}}
+\def\r@move td:#1 #2#3 #4)#5{\move (#3 #4)%
+\r@text td:#1 {#5}}
+\def\r@text td:#1 #2{\vbox to 0pt{\pixtodim \x@pix \t@xpos
+\pixtodim \y@pix \t@ypos
+\kern -\t@ypos
+\hbox to 0pt{\kern \t@xpos
+\rottxt {#1}{\z@sb {#2}}%
+\hss}%
+\vss}}
+\def\z@sb #1{\vbox to 0pt{\normalbaselines
+\t@stuff
+\hbox to 0pt{\l@stuff \hbox {#1}\r@stuff}%
+\b@stuff}}
+\ifx \rotatebox\@undefined
+\def\rottxt #1#2{\bgroup
+\special {ps: gsave currentpoint currentpoint translate
+#1\space neg rotate
+neg exch neg exch translate}%
+#2%
+\special {ps: currentpoint grestore moveto}%
+\egroup}
+\else
+\let\rottxt=\rotatebox
+\fi
+\ifx \t@xderror\@undefined
+\let\t@xderror=\errmessage
+\fi
+\def\t@exdrawdef {\sppix 300/in
+\drawdim in
+\edef\u@nitsc {1}%
+\setsegscale 1
+\arrowheadsize l:0.16 w:0.08
+\arrowheadtype t:T
+\textref h:L v:B }
+\ifx \includegraphics\@undefined
+\def\t@xdinclude [#1,#2][#3,#4]#5{%
+\begingroup
+\message {<#5>}%
+\leavevmode
+\t@counta=-#1%
+\t@countb=-#2%
+\setbox0=\hbox{%
+\special {PSfile="#5"\space
+hoffset=\the\t@counta\space voffset=\the\t@countb}}%
+\t@ypos=#4 bp%
+\advance \t@ypos by -#2 bp%
+\t@xpos=#3 bp%
+\advance \t@xpos by -#1 bp%
+\dp0=0pt \ht0=\t@ypos \wd0=\t@xpos
+\box0%
+\endgroup}
+\else
+\let\t@xdinclude=\includegraphics
+\fi
+\def\writeps #1{\f@lushbs
+\f@lushmove
+\p@athtrue
+\writetx {#1}}
+\def\writetx #1{\ift@extonly
+\global\t@extonlyfalse
+\t@xdpsfn \p@sfile
+\t@dropen \p@sfile
+\fi
+\w@rps {#1}}
+\def\w@rps #1{\immediate\write\drawfile {#1}}
+\def\t@xdpsfn #1{%
+\global\advance \t@xdnum by 1
+\ifnum \t@xdnum<10
+\xdef #1{\jobname.ps\the\t@xdnum}
+\else
+\xdef #1{\jobname.p\the\t@xdnum}
+\fi
+}
+\def\t@dropen #1{%
+\immediate\openout\drawfile=#1%
+\w@rps {\p@b PS-Adobe-3.0 EPSF-3.0}%
+\w@rps {\p@p BoundingBox: (atend)}%
+\w@rps {\p@p Title: TeXdraw drawing: #1}%
+\w@rps {\p@p Pages: 1}%
+\w@rps {\p@p Creator: \TeXdrawId}%
+\w@rps {\p@p CreationDate: \the\year/\the\month/\the\day}%
+\w@rps {50 dict begin}%
+\w@rps {/mv {stroke moveto} def}%
+\w@rps {/lv {lineto} def}%
+\w@rps {/st {currentpoint stroke moveto} def}%
+\w@rps {/sl {st setlinewidth} def}%
+\w@rps {/sd {st 0 setdash} def}%
+\w@rps {/sg {st setgray} def}%
+\w@rps {/bs {gsave} def /es {stroke grestore} def}%
+\w@rps {/fl \l@br gsave setgray fill grestore}%
+\w@rps { currentpoint newpath moveto\r@br\space def}%
+\w@rps {/fp {gsave setgray fill grestore st} def}%
+\w@rps {/cv {curveto} def}%
+\w@rps {/cr \l@br gsave currentpoint newpath 3 -1 roll 0 360 arc}%
+\w@rps { stroke grestore\r@br\space def}%
+\w@rps {/fc \l@br gsave setgray currentpoint newpath}%
+\w@rps { 3 -1 roll 0 360 arc fill grestore\r@br\space def}%
+\w@rps {/ar {gsave currentpoint newpath 5 2 roll arc stroke grestore} def}%
+\w@rps {/el \l@br gsave /svm matrix currentmatrix def}%
+\w@rps { currentpoint translate scale newpath 0 0 1 0 360 arc}%
+\w@rps { svm setmatrix stroke grestore\r@br\space def}%
+\w@rps {/fe \l@br gsave setgray currentpoint translate scale newpath}%
+\w@rps { 0 0 1 0 360 arc fill grestore\r@br\space def}%
+\w@rps {/av \l@br /hhwid exch 2 div def /hlen exch def}%
+\w@rps { /ah exch def /tipy exch def /tipx exch def}%
+\w@rps { currentpoint /taily exch def /tailx exch def}%
+\w@rps { /dx tipx tailx sub def /dy tipy taily sub def}%
+\w@rps { /alen dx dx mul dy dy mul add sqrt def}%
+\w@rps { /blen alen hlen sub def}%
+\w@rps { gsave tailx taily translate dy dx atan rotate}%
+\w@rps { (V) ah ne {blen 0 gt {blen 0 lineto} if} {alen 0 lineto} ifelse}%
+\w@rps { stroke blen hhwid neg moveto alen 0 lineto blen hhwid lineto}%
+\w@rps { (T) ah eq {closepath} if}%
+\w@rps { (W) ah eq {gsave 1 setgray fill grestore closepath} if}%
+\w@rps { (F) ah eq {fill} {stroke} ifelse}%
+\w@rps { grestore tipx tipy moveto\r@br\space def}%
+\w@rps {\p@sfactor\space \p@sfactor\space scale}%
+\w@rps {1 setlinecap 1 setlinejoin}%
+\w@rps {3 setlinewidth [] 0 setdash}%
+\w@rps {0 0 moveto}%
+}
+\def\t@drclose {%
+\bgroup
+\w@rps {stroke end showpage}%
+\w@rps {\p@p Trailer:}%
+\pixtobp \xminpix \l@lxbp \pixtobp \yminpix \l@lybp
+\pixtobp \xmaxpix \u@rxbp \pixtobp \ymaxpix \u@rybp
+\w@rps {\p@p BoundingBox: \l@lxbp\space \l@lybp\space
+\u@rxbp\space \u@rybp}%
+\w@rps {\p@p EOF}%
+\egroup
+\immediate\closeout\drawfile
+}
+\catcode`\@=\catamp
diff --git a/Master/texmf-dist/tex/generic/texdraw/txdps.tex b/Master/texmf-dist/tex/generic/texdraw/txdps.tex
new file mode 100644
index 00000000000..16eb8a926f7
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/texdraw/txdps.tex
@@ -0,0 +1,45 @@
+% TeXdraw macros to access PostScript builtins
+
+% $Id: txdps.tex,v 1.7 1993/04/10 texdraw-V2R0 $
+
+% Copyright (C) 1991, 1992 Peter Kabal
+
+% The routines in this file are provided free of charge without
+% warranty of any kind. Note that the TeXdraw routines are copyrighted.
+% They may be distributed freely provided that the recipients also
+% acquire the right to distribute them freely. The notices to this
+% effect must be preserved when the files are distributed.
+
+% Peter Kabal
+% Department of Electrical Engineering
+% McGill University
+% 3480 University
+% Montreal, Quebec
+% Canada H3A 2A7
+
+% kabal@TSP.EE.McGill.CA
+\chardef\catamp=\the\catcode`\@
+\catcode`\@=11
+\def\PSsetlinecap #1 {\writeps{#1 setlinecap}}
+\def\PSsetlinejoin #1 {\writeps{#1 setlinejoin}}
+\def\PSstroke {\writeps{stroke}}
+\def\PSnewpath {\writeps{newpath}}
+\def\PSclosepath {\writeps{closepath}}
+\def\PSfill {\writeps{fill}}
+\def\PSlineto (#1 #2){\getpos (#1 #2)\a@rgx\a@rgy
+\s@etpospix \a@rgx \a@rgy
+\writeps {\the\x@pix\space \the\y@pix\space lineto}}
+\def\PSmoveto (#1 #2){\getpos (#1 #2)\a@rgx\a@rgy
+\s@etpospix \a@rgx \a@rgy
+\writeps {\the\x@pix\space \the\y@pix\space moveto}}
+\def\PSarc r:#1 sd:#2 ed:#3 (#4 #5){\getpos (#4 #5)\a@rgx\a@rgy
+\s@etpospix \a@rgx \a@rgy
+\coordtopix {#1}\t@pixa
+\writeps{\the\x@pix\space \the\y@pix\space
+\the\t@pixa\space #2 #3 arc}}
+\def\PSarcn r:#1 sd:#2 ed:#3 (#4 #5){\getpos (#4 #5)\a@rgx\a@rgy
+\s@etpospix \a@rgx \a@rgy
+\coordtopix {#1}\t@pixa
+\writeps{\the\x@pix\space \the\y@pix\space
+\the\t@pixa\space #2 #3 arcn}}
+\catcode`\@=\catamp
diff --git a/Master/texmf-dist/tex/generic/texdraw/txdtools.tex b/Master/texmf-dist/tex/generic/texdraw/txdtools.tex
new file mode 100644
index 00000000000..c3d5ee1aa01
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/texdraw/txdtools.tex
@@ -0,0 +1,80 @@
+% TeXdraw toolbox macros, useful for extended TeXdraw commands
+
+% $Id: txdtools.tex,v 1.8 1993/04/10 texdraw-V2R0 $
+
+% Copyright (C) 1991,1992 Peter Kabal
+
+% The routines in this file are provided free of charge without
+% warranty of any kind. Note that the TeXdraw routines are copyrighted.
+% They may be distributed freely provided that the recipients also
+% acquire the right to distribute them freely. The notices to this
+% effect must be preserved when the files are distributed.
+
+% Peter Kabal
+% Department of Electrical Engineering
+% McGill University
+% 3480 University
+% Montreal, Quebec
+% Canada H3A 2A7
+
+% kabal@TSP.EE.McGill.CA
+\chardef\catamp=\the\catcode`\@
+\catcode`\@=11
+\def\realadd #1#2#3{\dimen0=#1pt
+\dimen2=#2pt
+\advance \dimen0 by \dimen2
+\edef #3{\expandafter\c@lean\the\dimen0}}
+\def\realdiv #1#2#3{\dimen0=#1pt
+\t@counta=\dimen0
+\dimen0=#2pt
+\t@countb=\dimen0
+\intdiv \t@counta \t@countb #3}
+\def\lenhyp #1#2#3{\t@counta=#1%
+\multiply \t@counta by \t@counta
+\t@countb=#2%
+\multiply \t@countb by \t@countb
+\advance \t@counta by \t@countb
+\sqrtnum \t@counta #3}
+\let\bk=\t@counta
+\let\bn=\t@countb
+\let\xval=\t@countc
+\def\sqrtnum #1#2{\xval=#1%
+\bk=\xval
+\loop
+\bn=\xval
+\divide \bn by \bk
+\advance \bn by \bk
+\advance \bn by 1
+\divide \bn by 2
+\ifnum \bn < \bk
+\bk=\bn
+\repeat
+#2=\bn}
+\def\currentpos #1#2{\t@pixa=\x@pix
+\advance \t@pixa by -\x@segoffpix
+\pixtocoord \t@pixa #1
+\t@pixa=\y@pix
+\advance \t@pixa by -\y@segoffpix
+\pixtocoord \t@pixa #2}
+\def\vectlen (#1 #2)(#3 #4)#5{\getpos (#1 #2)\x@arga\y@arga
+\getpos (#3 #4)\x@argb\y@argb
+\coordtopix \x@arga \t@pixa
+\coordtopix \x@argb \t@pixb
+\advance \t@pixb by -\t@pixa
+\coordtopix \y@arga \t@pixc
+\coordtopix \y@argb \t@pixd
+\advance \t@pixd by -\t@pixc
+\lenhyp \t@pixb \t@pixd \t@pixc
+\pixtocoord \t@pixc #5}
+\def\cossin (#1 #2)(#3 #4)#5#6{\getpos (#1 #2)\x@arga\y@arga
+\getpos (#3 #4)\x@argb\y@argb
+\coordtopix \x@arga \t@pixa
+\coordtopix \x@argb \t@pixb
+\advance \t@pixb by -\t@pixa
+\coordtopix \y@arga \t@pixc
+\coordtopix \y@argb \t@pixd
+\advance \t@pixd by -\t@pixc
+\lenhyp \t@pixb \t@pixd \t@pixc
+\intdiv \t@pixb\t@pixc #5%
+\intdiv \t@pixd\t@pixc #6}
+\catcode`\@=\catamp