home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Computer Club Elmshorn Atari PD
/
CCE_PD.iso
/
pc
/
0600
/
CCE_0657.ZIP
/
CCE_0657.PD
/
EPICE.STY
< prev
next >
Wrap
Text File
|
1994-03-29
|
9KB
|
224 lines
\makeatletter
\typeout{%
Enhancements to Picture Environment. Version 1.2 - Released June 1, 1986}
\def\lop#1\to#2{\expandafter\lopoff#1\lopoff#1#2}
\long\def\lopoff,#1,#2\lopoff#3#4{\def#4{#1}\def#3{,#2}}
\def\@@mlistempty{,}
\newif\iflistnonempty
\def\multiputlist(#1,#2)(#3,#4){\@ifnextchar
[{\@imultiputlist(#1,#2)(#3,#4)}{\@imultiputlist(#1,#2)(#3,#4)[]}}
\long\def\@imultiputlist(#1,#2)(#3,#4)[#5]#6{{%
\@xdim=#1\unitlength \@ydim=#2\unitlength
\listnonemptytrue \def\@@mlist{,#6,} % need this for end condition
\loop
\lop\@@mlist\to\@@firstoflist
\@killglue\raise\@ydim\hbox to\z@{\hskip
\@xdim\@imakepicbox(0,0)[#5]{\@@firstoflist}\hss}
\advance\@xdim #3\unitlength\advance\@ydim #4\unitlength
\ifx\@@mlist\@@mlistempty \listnonemptyfalse\fi
\iflistnonempty
\repeat\relax
\ignorespaces}}
\newcount\@@multicnt
\def\matrixput(#1,#2)(#3,#4)#5(#6,#7)#8#9{%
\ifnum#5>#8\@matrixput(#1,#2)(#3,#4){#5}(#6,#7){#8}{#9}%
\else\@matrixput(#1,#2)(#6,#7){#8}(#3,#4){#5}{#9}\fi}
%% here #5 >= #8
\long\def\@matrixput(#1,#2)(#3,#4)#5(#6,#7)#8#9{{\@killglue%
\@multicnt=#5\relax\@@multicnt=#8\relax%
\@xdim=0pt%
\@ydim=0pt%
\setbox\@tempboxa\hbox{\@whilenum \@multicnt > 0\do {%
%%\typeout{\the\@multicnt, \the\@@multicnt}%
\raise\@ydim\hbox to \z@{\hskip\@xdim #9\hss}%
\advance\@multicnt \m@ne%
\advance\@xdim #3\unitlength\advance\@ydim #4\unitlength}}%
\@xdim=#1\unitlength%
\@ydim=#2\unitlength%
\@whilenum \@@multicnt > 0\do {%
\raise\@ydim\hbox to \z@{\hskip\@xdim \copy\@tempboxa\hss}%
\advance\@@multicnt \m@ne%
\advance\@xdim #6\unitlength\advance\@ydim #7\unitlength}%
\ignorespaces}}
\newcount\d@lta
\newdimen\@delta
\newdimen\@@delta
\newcount\@gridcnt
\def\grid(#1,#2)(#3,#4){\@ifnextchar [{\@igrid(#1,#2)(#3,#4)}%
{\@igrid(#1,#2)(#3,#4)[@,@]}}
\long\def\@igrid(#1,#2)(#3,#4)[#5,#6]{%
\makebox(#1,#2){%
\@delta=#1pt\@@delta=#3pt\divide\@delta \@@delta\d@lta=\@delta%
\advance\d@lta \@ne\relax\message{grid=\the\d@lta\space x}%
%% copied the definition of \line(0,1){#2} for some efficiency!.
\multiput(0,0)(#3,0){\d@lta}{\hbox to\z@{\hskip -\@halfwidth \vrule
\@width \@wholewidth \@height #2\unitlength \@depth \z@\hss}}%
\ifx#5@\relax\else%
\global\@gridcnt=#5%
\multiput(0,0)(#3,0){\d@lta}{%
\makebox(0,-2)[t]{\number\@gridcnt\global\advance\@gridcnt by #3}}%
\global\@gridcnt=#5%
\multiput(0,#2)(#3,0){\d@lta}{%
\makebox(0,0)[b]{\number\@gridcnt\vspace{2mm}\global\advance\@gridcnt by #3}}%
\fi%
\@delta=#2pt\@@delta=#4pt\divide\@delta \@@delta\d@lta=\@delta%
\advance\d@lta \@ne\relax\message{\the\d@lta . }%
%% copied the definition of \line(1,0){#1} for some efficiency!.
\multiput(0,0)(0,#4){\d@lta}{\vrule \@height \@halfwidth \@depth \@halfwidth
\@width #1\unitlength}%
\ifx#6@\relax\else
\global\@gridcnt=#6%
\multiput(0,0)(0,#4){\d@lta}{%
\makebox(0,0)[r]{\number\@gridcnt\ \global\advance\@gridcnt by #4}}%
\global\@gridcnt=#6%
\multiput(#1,0)(0,#4){\d@lta}{%
\makebox(0,0)[l]{\ \number\@gridcnt\global\advance\@gridcnt by #4}}%
\fi}}
\def\picsquare@bl{\vrule height \@wholewidth depth \z@ width \@wholewidth}
\newif\if@jointhem \global\@jointhemfalse
\newif\if@firstpoint \global\@firstpointtrue
\newcount\@joinkind
%%%\def\dottedjoin
\def\@idottedjoin[#1]#2{\gdef\dotchar@join{#1}\gdef\dotgap@join{#2}}
\def\enddottedjoin{\global\@jointhemfalse \global\@firstpointtrue\egroup}
\def\dashjoin{\global\@jointhemtrue \global\@joinkind=1\relax
\bgroup\@ifnextchar[{\@idashjoin}{\@idashjoin[\dashlinestretch]}}
\def\@idashjoin[#1]#2{\edef\dashlinestretch{#1}\gdef\dashlen@join{#2}%
\@ifnextchar[{\@iidashjoin}{\gdef\dotgap@join{}}}
\def\@iidashjoin[#1]{\gdef\dotgap@join{#1}}
\let\enddashjoin\enddottedjoin
\def\drawjoin{\global\@jointhemtrue \global\@joinkind=2\relax
\bgroup\@ifnextchar[{\@idrawjoin}{}}
\def\@idrawjoin[#1]{\def\drawlinestretch{#1}}
\let\enddrawjoin\enddottedjoin
%%% \jput-def.
\newdimen\@dotgap
\newdimen\@ddotgap
\newcount\@x@diff
\newcount\@y@diff
\newdimen\x@diff
\newdimen\y@diff
\newbox\@dotbox
\newcount\num@segments
\newcount\num@segmentsi
\newif\ifsqrt@done
\def\sqrtandstuff#1#2#3{
\ifdim #1 <0pt \@x@diff= -#1 \else\@x@diff=#1\fi
\ifdim #2 <0pt \@y@diff= -#2 \else\@y@diff=#2\fi
%% @diff's will be positive and diff's will retain their sign.
\@dotgap=#3 \divide\@dotgap \tw@
\advance\@x@diff \@dotgap \advance\@y@diff \@dotgap% for round-off errors
\@dotgap=#3
\divide\@x@diff \@dotgap \divide\@y@diff \@dotgap
\sqrt@donefalse
\ifnum\@x@diff < 2
\ifnum\@y@diff < 2 \num@segments=\@x@diff \advance\num@segments \@y@diff
\sqrt@donetrue
\else\num@segments=\@y@diff \sqrt@donetrue\fi
\else\ifnum\@y@diff < 2 \num@segments=\@x@diff \sqrt@donetrue\fi
\fi
\ifsqrt@done \ifnum\num@segments=\z@ \num@segments=\@ne\fi\relax
\else \ifnum\@y@diff >\@x@diff
\@tempcnta=\@x@diff \@x@diff=\@y@diff \@y@diff=\@tempcnta
\fi %exchange @x@diff & @y@diff, so now @x@diff > @y@diff
\num@segments=\@y@diff
\multiply\num@segments \num@segments
\multiply\num@segments by 457
\divide\num@segments \@x@diff
\advance\num@segments by 750 % for round-off, going to divide by 1000.
\divide\num@segments \@m
\advance\num@segments \@x@diff
%num@segments = @x@diff + (0.457*sqr(@y@diff)/@x@diff)
\fi}
%%%\def\dottedline
%%%\def\@idottedline
%%%\def\@iidottedline
%%%\long\def\@dottedline[#1]#2(#3,#4)(#5,#6){{%
%%%\x@diff=#5\relax\advance\x@diff by -#3\relax
%%%\y@diff=#6\relax\advance\y@diff by -#4\relax
%%%\sqrtandstuff{\x@diff}{\y@diff}{#2}
%%%\divide\x@diff \num@segments
%%%\divide\y@diff \num@segments
%%%\advance\num@segments \@ne % to put the last point at destination.
%%%\setbox\@dotbox\hbox{#1}% just to get the dimensions of the character.
%%%\@xdim=#3 \@ydim=#4
%%%\ifdim\ht\@dotbox >\z@% otherwise its a circle.
%%% \advance\@xdim -0.5\wd\@dotbox
%%% \advance\@ydim -0.5\ht\@dotbox
%%% \advance\@ydim .5\dp\@dotbox\fi
%%%\@killglue
%%%\loop \ifnum\num@segments > 0
%%%\unskip\raise\@ydim\hbox to\z@{\hskip\@xdim #1\hss}%
%%%\advance\num@segments \m@ne\advance\@xdim\x@diff\advance\@ydim\y@diff%
%%%\repeat
%%%\ignorespaces}}
\def\dashlinestretch{0} %well, could have used a counter.
\def\dashline{\@ifnextchar [{\@idashline}{\@idashline[\dashlinestretch]}}
\def\@idashline[#1]#2{\@ifnextchar [{\@iidashline[#1]{#2}}%
{\@iidashline[#1]{#2}[\@empty]}} %\@empty needed-- later checked with \ifx
\def\@iidashline[#1]#2[#3](#4,#5){\@ifnextchar (%
{\@iiidashline[#1]{#2}[#3](#4,#5)}{\relax}}
%%%\def\@iiidashline
%%%\def\@dashline
\newif\if@flippedargs
\def\lineslope(#1,#2){%
\ifdim #1 <0pt \@xdim= -#1 \else\@xdim=#1\fi
\ifdim #2 <0pt \@ydim= -#2 \else\@ydim=#2\fi
\ifdim\@xdim >\@ydim \@tempdima=\@xdim \@xdim=\@ydim \@ydim=\@tempdima
\@flippedargstrue\else\@flippedargsfalse\fi% x < y
\ifdim\@ydim >1pt \@tempcnta=\@ydim
\divide\@tempcnta by 65536% now \@tempcnta=integral part of #1.
\divide\@xdim \@tempcnta\fi
\ifdim\@xdim <.083333pt \@xarg=1 \@yarg=0
\else\ifdim\@xdim <.183333pt \@xarg=6 \@yarg=1
\else\ifdim\@xdim <.225pt \@xarg=5 \@yarg=1
\else\ifdim\@xdim <.291666pt \@xarg=4 \@yarg=1
\else\ifdim\@xdim <.366666pt \@xarg=3 \@yarg=1
\else\ifdim\@xdim <.45pt \@xarg=5 \@yarg=2
\else\ifdim\@xdim <.55pt \@xarg=2 \@yarg=1
\else\ifdim\@xdim <.633333pt \@xarg=5 \@yarg=3
\else\ifdim\@xdim <.708333pt \@xarg=3 \@yarg=2
\else\ifdim\@xdim <.775pt \@xarg=4 \@yarg=3
\else\ifdim\@xdim <.816666pt \@xarg=5 \@yarg=4
\else\ifdim\@xdim <.916666pt \@xarg=6 \@yarg=5
\else \@xarg=1 \@yarg=1%
\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
\if@flippedargs\relax\else\@tempcnta=\@xarg \@xarg=\@yarg \@yarg=\@tempcnta\fi
\ifdim #1 <0pt \@xarg= -\@xarg\fi
\ifdim #2 <0pt \@yarg= -\@yarg\fi
}
\newif\if@toosmall
\newif\if@drawit
\newif\if@horvline
\def\drawlinestretch{0} %well, could have used a counter.
\def\drawline{\@ifnextchar [{\@idrawline}{\@idrawline[\drawlinestretch]}}
\def\@idrawline[#1](#2,#3){\@ifnextchar ({\@iidrawline[#1](#2,#3)}{\relax}}
\def\@iidrawline[#1](#2,#3)(#4,#5){\@drawline[#1](#2,#3)(#4,#5)
\@idrawline[#1](#4,#5)}
%
%%%\def\@drawline
\long\def\splittwoargs#1 #2 {(#1,#2)}
\newif\if@stillmore
\newread\@datafile
\long\def\putfile#1#2{\openin\@datafile = #1
\@stillmoretrue
\loop
\ifeof\@datafile\relax\else\read\@datafile to\@dataline\fi
%if file nonexistent, do nothing.
\ifeof\@datafile\@stillmorefalse
\else\ifx\@dataline\@empty \relax
\else
\expandafter\expandafter\expandafter\put\expandafter\splittwoargs%
\@dataline{#2}
\fi
\fi
\if@stillmore
\repeat
\closein\@datafile
}
\input{eepic.sty}
\makeatother