[comp.text] EEPIC 1.0

kwok@iris (Conrad Kwok) (08/23/88)

#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create the files:
#	README
#	eepic.tex
#	epic-eg3.tex
#	epic-eg4.tex
#	eepicemu.sty
# This archive created: Sun Aug 21 00:03:56 1988
export PATH; PATH=/bin:$PATH
if test -f 'README'
then
	echo shar: will not over-write existing file "'README'"
else
sed 's/^X//' << \SHAR_EOF > 'README'
XEEPIC is a set of TeX macros for LaTeX. It includes several extensions to EPIC 
Xand LaTeX picture drawing environement and provides several new commands.
X
X------------------------------
XAdditions to Version 1.00
Xo new commands to draw filled cirlces and ellipsis.
Xo new command to set line thickness to any width.
Xo bugs in EEPICEMU.sty are fixed.
X------------------------------
X
XExtensions to LaTeX and EPIC include:
Xo drawing of lines in any slopes
Xo drawing of circles in any radii
Xo drawing of dotted lines and dash lines in a much faster way and much less 
X  TeX memory
X
XIt also provides new commands for:
Xo drawing ellipsis
Xo drawing arcs
Xo drawing of splines
X
XPlease read the manual for details. 
X
X************IMPORTANT**************
X
XThe standard EEPIC style file generates tpic \special. If your printer does not 
Xsupport those specials, you have to either change "eepic" in the 
X\documentstyle command to "eepicemu" or rename "eepicemu.sty" to "eepic.sty" 
Xbefore formating the manual. "eepicemu.sty" is the emulation package of EEPIC 
Xusing EPIC and it does not generate any \special command. However, \arc 
Xcommand is not supported in the emulation package. Hence, you will get 3 error 
Xmessages if you use "eepicemu" to format the manual. Furthermore, the 
Xemulation package uses a lot more TeX memory. If your TeX run out of memory 
Xduring the formating of the manual, you can insert \clearpage between example 
X3 and example 4 to put them on different pages.
X
XEPIC is an TeX macro package for use with LaTeX. It is written by 
XSunil Podar, Dept of Computer Science, SUNY at Stony Brook, NY 11794.
XThe "epic.sty" file is include in the distribution so that you can format the 
Xmanual. I strongly recommend everyone using EEPIC should get a full package of 
XEPIC. Information on getting EPIC and printer drivers that support tpic 
Xspecials are given at the end of this file.
X
X[ I tried to contact the author to get permission to include "epic.sty"  ] 
X[ in EEPIC distribution but I did not get any reply. I hope this is okay ]
X
X********MISC***********
Xo Any line beginning with "%%" in eepic.sty may be removed for efficiency
X
X
X*******E-MAIL Address*******
X% Internet : kwok@iris
X% csnet    : kwok@ucd.csnet
X% csnet    : kwok%iris.ucdavis.edu@csnet.relay
X% UUCP	   : ...!ucbvax!ucdavis!iris!kwok
X
X
X--Conrad Kwok
X
X----------------------------------------------------------------------
XFirst, thanks to all who have responsed to my question. It seems
Xto me that not many DVI drivers currently support tpic
Xspecials but a number of people are planning to support tpic
Xspecials in their new DVI drivers. Here is the summary.
X
X1) "iptex" written by Chris Torek --- This is for imagen printer. 
XIt is included in the UNIX TeX distribution.  It is also
Xavailable for anonymous ftp from a.cs.uiuc.edu in the file
Xiptex.tar
X
X2) "texx" written by Dirk Grunwald --- DVI previewers for X11. 
XIt supports most of the tpic specials but not all. It is part of
Xthe iptex package. See 1) above.
X
X3) "texsun" written by Dirk Grunwald --- DVI previewers for
XSunview window system. It supports most of the tpic specials. It
Xis also part of the iptex package. See 1) above.
X
X4) "dvips" written by Tomas Rokicki and tpic special codes are
Xadded by Dorab Patel --- A DVI to Postscript translator. It is
Xavailable for anonymous ftp from labrea.stanford.edu.
X
X5) L. Michael Gray in the University of New Hamsphire said he has
Xmodified dln01 (for DEC LN01S), dvi2ps and xdvi (for X10.4) to
Xhandle tpic specials. He may be reached at lmg%unhcs@RELAY.CS.NET.
X
X6) "dviis" previewers for Integrated Solutions. I think it is
Xavailable on june.cs.washington.edu.
X
X7) DVI previewers written by Randy Buckland for VMS vaxstations.
XThe program is written in Ada. The executable is available for
Xanonymous ftp from argon.rti.org [128.109.139.64].
X
X8) There are a number of DVI drivers in science.utah.edu but I
Xdon't know which one support tpic specials and who one don't.
X
XSome of the information here come at second hand. Correct me if
Xany of these are wrong. If you know any DVI drivers that support
Xtpic specials but they are not list here. Please send me a
Xmessage so that I can keep this list up-to-date.
X
XThanks.
X
X--Conrad
SHAR_EOF
fi # end of overwriting check
if test -f 'eepic.tex'
then
	echo shar: will not over-write existing file "'eepic.tex'"
else
sed 's/^X//' << \SHAR_EOF > 'eepic.tex'
X\documentstyle[11pt,epic,eepic]{article}
X% ALLTT DOCUMENT-STYLE OPTION - released 17 December 1987
X%    for LaTeX version 2.09
X% Copyright (C) 1987 by Leslie Lamport
X
X% Defines the `alltt' environment, which is like the `verbatim'
X% environment except that `\', `\{', and `\}' have their usual meanings.
X% Thus, other commands and environments can appear within an `alltt'
X% environment.  Here are some things you may want to do in an `alltt'
X% environment:
X% 
X% * Change fonts--e.g., by typing `{\em emphasized text\/}'.
X% 
X% * Insert text from a file foo.tex by typing `input{foo}'.  Beware that
X%   each <return> stars a new line, so if foo.tex ends with a <return>
X%   you can wind up with an extra blank line if you're not careful.
X% 
X% * Insert a math formula.  Note that `$' just produces a dollar sign,
X%   so you'll have to type `\(...\)' or `\[...\]'.  Also, `^' and `_'
X%   just produce their characters; use `\sp' or `\sb' for super- and
X%   subscripts, as in `\(x\sp{2}\)'.
X\makeatletter
X\def\docspecials{\do\ \do\$\do\&%
X  \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~}
X%
X\def\alltt{\trivlist \item[]\if@minipage\else\vskip\parskip\fi
X\leftskip\@totalleftmargin\rightskip\z@
X\parindent\z@\parfillskip\@flushglue\parskip\z@
X\@tempswafalse \def\par{\if@tempswa\hbox{}\fi\@tempswatrue\@@par}
X\obeylines \tt \catcode``=13 \@noligs \let\do\@makeother \docspecials
X \frenchspacing\@vobeyspaces}
X%
X\let\endalltt=\endtrivlist
X\makeatother
X
X\topmargin=-37pt\oddsidemargin=0pt\evensidemargin=0pt
X\marginparsep 10pt\marginparwidth 60pt
X\textheight 9truein\textwidth 6.5truein
X
X\chardef\BS=`\\ % It only works in \tt font
X\newcommand{\PiCTeX}{PiC\TeX}
X\newcommand{\epic}{{\sc epic}}
X\newcommand{\eepic}{{\sc eepic}}
X\newcommand{\plotchar}{\makebox(0,0){\large $\otimes$}}
X\parskip=4pt plus 2pt minus 1pt
X\title{EEPIC\\Extensions to epic\ and \LaTeX \\ Picture
XEnvironment}
X\author{Conrad Kwok\\
X  Department of Electrical Engineering and Computer Science\\
X  University of California, Davis}
X\date{August 14, 1988}
X\begin{document}
X\maketitle
X
X
X\section{Introduction}
X\LaTeX\ provides a basic but limited picture drawing capability.
X\epic\footnote{\epic\ is a \LaTeX\ macro package written by Sunil
XPodar at S.U.N.Y at Stony Brook. Please read the section on
Xinstallation for more information} is an enhancement to the
Xpicture environment of \LaTeX\ which provides a simpler and more
Xpowerful interface. It introduces new commands for drawing solid
Xlines, dotted lines, dash lines and new environments suitable for
Xplotting graphs.
X
XHowever, \epic\ still inherits many of the limitations of
X\LaTeX\ in picture drawing and hence some of the functions either
Xtake a long time to accomplish or the output is not very nice
Xlooking.
X
Xtpic is preprocessor program for use with \TeX. It uses a set of
X\verb|\special|s graphics commands for drawing pictures. More and
Xmore DVI driver programs supports those specials. They are
Xbecoming a standard set of \verb|\special|s for DVI files.
XHowever, the major disadvantage of tpic is that the tpic
Xpreprocessor itself is not readily available on most machines. It
Xis written in yacc and C language. It is mainly for UNIX or
Xsimilar system.
X
X\eepic, as an extension to both \LaTeX\ and \epic, tries to
Xalleviate some of the limitations in \LaTeX, \epic\ and tpic by
Xgenerating tpic \verb|special|s using \TeX\ commands instead of
Xany preprocessor program, but at the same time provides
Xcompatibility with the original commands such that when a DVI
Xdriver which understands tpic \verb|special|s are not available,
Xthe documents can still be formatted using standard \LaTeX\ and
X\epic. However, the output probably will not be as good as
Xoriginally intended.
X
XCurrently, \eepic\ extends \LaTeX\ and \epic\ in the following
Xways:
X\begin{itemize}\parskip=0pt
X\item Draws lines in any slopes.
X\item Draws circles and discs (filled circle) in any radii.
X\item Draws dotted lines and dash lines in a much faster way and
Xrequires much less \TeX\ internal memory.
X\item Provides more line thickness options.
X\end{itemize}
X
XFurthermore, \eepic\ introduces several new commands for:
X\begin{itemize}\parskip=0pt
X\item drawing of ellipsis and filled ellipsis
X\item drawing of arcs
X\item drawing of splines (cubic splines using control points)
X\item drawing of polylines
X\end{itemize}
X
XAll the affected commands in \LaTeX\ and \epic\ will be discussed
Xin the subsequent sections. The compatibility issues will be
Xdescribed in the section~\ref{compat}.
X\clearpage
X
X
X\section{Extension to \LaTeX}
X
XIn \LaTeX, drawing of lines and circles are done using special
Xfonts. Therefore only limited functions are provided. The
Xextensions in \eepic\ allow users to draw lines in any slope and
Xto draw circles in any sizes. However, the limitation of slopes
Xfor vectors remains the same in the mean time. That is the slope
Xthat can be handled is $\frac{x}{y}$ where $x$ and $y$ are
Xintegers in the range $[-4,4]$. Please read \LaTeX\ manual for
Xdetails.
X
X
X\subsection{\tt \BS line}
XThe syntax of \verb|\line| is the same as that in \LaTeX:
X\begin{quote}
X\verb|\line(|$x$,$y$\verb|){|{\em length}\verb|}|
X\end{quote}
XBut now $x$ and $y$ can be any integer values within the limit of
X\TeX. Furthermore, there is no more lower limit for {\em length}
Xparameter.
X
X
X\subsection{\tt \BS circle}
XThe syntax of \verb|\circle| is the same as that in \LaTeX:
X\begin{quote}
X\verb|\circle{|{\em diameter}\verb|}|
X\end{quote}
Xor
X\begin{quote}
X\verb|\circle*{|{\em diameter}\verb|}|
X\end{quote}
XBut now the {\em diameter} parameter can be any number acceptable
Xby \TeX\ and a circle with the specified diameter (exactly) will
Xbe drawn.
X
X
X\subsection{\tt \BS oval}
XThe \verb|\oval| command is changed such that the maximum
Xdiameter of the quarter circles at the corners can be set to any
Xvalues. This is done by setting the variable \verb|\maxovaldiam|
Xto the desire \TeX{} dimension. The default is 40pt.
X
X
X\clearpage
X
X
X\section{Extension to EPIC}
X\epic\ is an enhancement to the Picture Environment of \LaTeX.
X\epic\ generates standard DVI files and requires only standard
X\LaTeX\ fonts. Some of the functions it provides are:
X\begin{center}
X\begin{tabular}{lll}
X\verb|\multiputlist| & \verb|\dottedline| & \verb|\putfile| \\
X\verb|\matrixput| & \verb|\dashline| \\
X\verb|\grid| & \verb|\drawline| \\
X\end{tabular}
X\end{center}
XDetails can be found in the \epic\ manual. 
X
XExtensions to \epic\ in \eepic\ include better line drawing
Xoutput, faster operation and less memory requirement. The
Xcommands affected are:
X\begin{enumerate}\parskip=0pt
X\item \verb|\drawline|
X\item \verb|\dashline|
X\item \verb|\dottedline|
X\end{enumerate}
XAnd the three ``\verb|*join|'' environments are indirectly
Xaffected also.
X
X
X\subsection{\tt \BS drawline}
XThe syntax of \verb|\drawline| is:
X\begin{quote}
X\begin{alltt}
X\BS{}drawline[{\em{}stretch}](\(x\sb{1}\),\(y\sb{1}\))(\(x\sb{2}\),\(y\sb{2}\))\ldots(\(x\sb{n}\),\(y\sb{n}\))
X\end{alltt}
X\end{quote}
Xwhere {\em stretch} is an integer between $-100$ and infinity.
XHowever any number greater than 0 are the same. An negative {\em
Xstretch} in \verb|\drawline| will call \verb|\dashline|.
X
XThe thickness of the line is affected by \verb|\thinlines|,
X\verb|\thicklines| and \verb|\Thicklines| declarations.
XHorizontal and vertical lines are drawn using rules.
X
X
X\subsection{\tt \BS dottedline}
XThe syntax of \verb|\dottedline| is:
X\begin{quote}
X\begin{alltt}
X\BS{}dottedline[{\em{}dot character\/}]\{{\em{}dotgap\/}\}(\(x\sb{1}\),\(y\sb{1}\))(\(x\sb{2}\),\(y\sb{2}\))\ldots(\(x\sb{n}\),\(y\sb{n}\))
X\end{alltt}
X\end{quote}
Xwhere {\em dot character} is the character used in drawing the
X``dotted'' line. {\em dotgap} is the interdot gap in terms of
X\verb|\unitlength|. \verb|\special|s will only be generated if no
Xoptional dot character is specified.
X
XThe size of the dots are affected by \verb|\thinlines|,
X\verb|\thicklines| and \verb|\Thicklines| declarations.
X
X
X\subsection{\tt \BS dashline}
XThe syntax of \verb|\dashline| is:
X\begin{quote}
X\begin{alltt}
X\BS{}dashline[{\em{}stretch}]\{{\em{}dash-length}\}[{\em{}inter-dot-gap}](\(x\sb{1}\),\(y\sb{1}\))(\(x\sb{2}\),\(y\sb{2}\))\ldots(\(x\sb{n}\),\(y\sb{n}\))
X\end{alltt}
X\end{quote}
Xwhere {\em stretch} is an integer between $-100$ and infinity. If
X{\em inter-dot-gap} is not specified, dashes are drawn in solid
Xlines, otherwise, dashes are drawn using dotted lines.
X
XThe thickness of the line is affected by \verb|\thinlines|,
X\verb|\thicklines| and \verb|\Thicklines| declarations.
X
X
X\clearpage
X
X
X\section{New Commands}
X\eepic\ introduces a number of new commands. Except the
X\verb|\path| commands, all other new commands do not have any
Xequivalents in \LaTeX\ and \epic. Please read
Xsection~\ref{compat} about the compatibility issues.
X
X
X\subsection{\tt \BS allinethickness}
XSet the line thickness of all line drawing commands including
Xlines in any slopes, circles, ellipsis, arcs, ovals and splines.
XNote there are only two `l' in the command. The syntax is:
X\begin{quote}
X\verb|\allinethickness{|{\em dimension}\verb|}|.
X\end{quote}
X
X
X\subsection{\tt \BS Thicklines}
XThe syntax is:
X\begin{quote}
X\verb|\Thicklines|
X\end{quote}
XWith the \verb|\Thicklines| declaration, thickness of lines drawn
Xwill be about 1.5 times of \verb|\thicklines|.
X
X
X\subsection{\tt \BS path}
X\verb|\path| is a fast version of \verb|\drawline|. Optional {\em
Xstretch\/} argument is not allowed and so it always draw solid
Xlines. The syntax is:
X\begin{quote}
X\begin{alltt}
X\BS{}path(\(x\sb{1}\),\(y\sb{1}\))(\(x\sb{2}\),\(y\sb{2}\))\ldots(\(x\sb{n}\),\(y\sb{n}\))
X\end{alltt}
X\end{quote}
X\verb|\path| is mainly used in drawing complex paths.
X
X
X\subsection{\tt \BS spline}
XSyntax of \verb|\spline| is the same as \verb|\path|.
X\begin{quote}
X\begin{alltt}
X\BS{}spline(\(x\sb{1}\),\(y\sb{1}\))(\(x\sb{2}\),\(y\sb{2}\))\ldots(\(x\sb{n}\),\(y\sb{n}\))
X\end{alltt}
X\end{quote}
X\verb|\spline| draws an Chaikin's curve which passes through only
Xthe first and last point. All other points are control points
Xonly.
X
X
X\subsection{\tt \BS ellipse}
XThe command \verb|\ellipse| draws an ellipse by specifying the
Xx-diameter and y-diameter.
X\begin{quote}
X\begin{alltt}
X\BS{}ellipse\{{\em{}x-diameter}\}\{{\em{}y-diameter}\}
X\end{alltt}
X\end{quote}
Xor
X\begin{quote}
X\begin{alltt}
X\BS{}ellipse*\{{\em{}x-diameter}\}\{{\em{}y-diameter}\}
X\end{alltt}
X\end{quote}
XWhen {\em x-diameter} is equal to {\em y-diameter}, the command
Xis equivalent to \verb|\circle| or \verb|\circle*|.
X
X
X\subsection{\tt \BS arc}
X\verb|\arc| draws an circular arc. The syntax is
X\begin{quote}
X\begin{alltt}
X\BS{}arc\{{\em{}diameter}\}\{{\em{}start-angle}\}\{{\em{}end-angle}\}
X\end{alltt}
X\end{quote}
X{\em diameter} is specified in \verb|\unitlength| and both {\em
Xstart-angle} and {\em end-angle} are in radian. {\em start-angle}
Xmust be within 0 and $2\pi$ and {\em end-angle} can be any value
Xbetween {\em start-angle} and {\em start-angle} + $2\pi$. Arcs
Xare drawn in clockwise direction with angle 0 pointing to the
Xright on the paper.
X
X
X\clearpage
X
X
X\section{Examples}
XI shamelessly stole two examples from the \epic\ manual so that
Xyou can compare the results. The third and fourth examples are
Xcreated by FIG and then converted to \eepic\ using
X\verb|fig2epic| which is also written by me.
X
X\unitlength=1mm
X
X
X\subsection{Example 1}
X\begin{figure}[h]
X\begin{center}
X%\newcommand{\plotchar}{\makebox(0,0){\large $\otimes$}}
X\begin{picture}(100,100)(0,0)
X\put(0,0){\tiny \grid(100,100)(5,5)[0,0]}
X\drawline(10,5)(60,10)(85,20)(90,60)(100,95)
X\drawline[-50](10,0)(65,5)(90,15)(95,55)
X\thicklines
X\dottedline{1.4}(10,10)(60,20)(75,35)(95,95)
X\dashline{2}(80,90)(50,80)(30,50)(10,40)
X\dashline{2}[0.5](80,80)(50,70)(30,40)(10,30)
X\dashline[-30]{2}[0.5](80,70)(50,60)(30,30)(10,20)
X\end{picture}
X\end{center}
X\caption[]{\normalsize An example of Various Line Drawing Commands}
X\end{figure}
X\clearpage
X
X
X\subsection{Example 2}
X\newcount\xjunk
X\newcount\yjunk
X\begin{figure}[h]
X\begin{center}
X\begin{tiny}
X\begin{picture}(140,140)(-70,-70)
X\thinlines
X\xjunk=60 \yjunk=3
X\loop
X\drawline(0,0)(\xjunk,\yjunk)
X\drawline(0,0)(-\xjunk,\yjunk)
X\drawline(0,0)(\xjunk,-\yjunk)
X\drawline(0,0)(-\xjunk,-\yjunk)
X\put(\xjunk,\yjunk){\plotchar}
X\put(-\xjunk,\yjunk){\plotchar}
X\put(\xjunk,-\yjunk){\plotchar}
X\put(-\xjunk,-\yjunk){\plotchar}
X\put(\xjunk,\yjunk){\makebox(8,0)[l]{\ \ (\number\xjunk,\number\yjunk)}}
X\put(-\xjunk,\yjunk){\makebox(-4,0)[r]{(\number-\xjunk,\number\yjunk)}}
X\put(\xjunk,-\yjunk){\makebox(8,0)[l]{\ \ (\number\xjunk,\number-\yjunk)}}
X\put(-\xjunk,-\yjunk){\makebox(-4,0)[r]{(\number-\xjunk,\number-\yjunk)}}
X\ifnum\yjunk < 53 \advance\yjunk by 10 %will go till 53.
X\repeat
X\xjunk=3 \yjunk=60
X\loop
X\drawline(0,0)(\xjunk,\yjunk)
X\drawline(0,0)(-\xjunk,\yjunk)
X\drawline(0,0)(\xjunk,-\yjunk)
X\drawline(0,0)(-\xjunk,-\yjunk)
X\put(\xjunk,\yjunk){\plotchar}
X\put(-\xjunk,\yjunk){\plotchar}
X\put(\xjunk,-\yjunk){\plotchar}
X\put(-\xjunk,-\yjunk){\plotchar}
X\put(\xjunk,\yjunk){\makebox(0,7)[t]{(\number\xjunk,\number\yjunk)}}
X\put(-\xjunk,\yjunk){\makebox(0,5)[t]{(\number-\xjunk,\number\yjunk)}}
X\put(\xjunk,-\yjunk){\makebox(0,-4)[t]{(\number\xjunk,\number-\yjunk)}}
X\put(-\xjunk,-\yjunk){\makebox(0,-6)[t]{(\number-\xjunk,\number-\yjunk)}}
X\ifnum\xjunk < 53 \advance\xjunk by 10
X\repeat
X\end{picture}
X\end{tiny}
X\end{center}
X\caption[]{\normalsize Test Sample: Lines of various slopes with
X\verb|thinlines|}
X\end{figure}
X\clearpage
X
X
X\subsection{Example 3}
X\begin{figure}[htbp]
X\hrule
X\begin{center}
X\input{epic-eg3}
X\end{center}
X\caption{The finite automaton to detect occurrences of $P$=`$AABC$'.}
X\medskip
X\hrule
X\end{figure}
X
X
X\subsection{Example 4}
X\begin{figure}[htbp]
X\hrule
X\begin{center}
X\input{epic-eg4}
X\end{center}
X\caption{Breath-first search beginning at A}
X\medskip
X\hrule
X\end{figure}
X
X
X\clearpage
X
X
X\section{Bugs}
X\begin{itemize}
X\item The \verb|\circle*| and \verb|\ellipse*| may not work on
Xall DVI drivers especially some previewers. If you have any
Xproblem, you should remove the related code in eepic.sty and use
Xthe \LaTeX{} \verb|\cirlce*| commands. To find the related codes,
Xsearch for \verb|\special{bk}| in the file.
X\item The alignment of the quarter circles and the lines in
X\verb|\oval| command may not be correct on all printers because
Xthe command relies on the precise interpretation of the tpic
Xspecials which are not defined clearly. If you have any problem,
Xyou should either fixed that by changing the position of the
Xquarter circles or remove the whole extended \verb|\oval| command
Xfrom \verb|eepic.sty|.
X\end{itemize}
X
X
X\section{Compatibility}\label{compat}
XIf you want your \TeX\ file to be compatible with \LaTeX\ and
X\epic\ but at the same time you want a better print out by using
X\eepic, you must avoid several features in \eepic.
X\begin{itemize}
X\item Try not to use \verb|\line| commands and use
X\verb|\drawline| instead because \verb|\line| in \LaTeX\ only
Xsupports a limited set of slope.
X\item Do not use \verb|\arc| command. Use \verb|\spline| if a
Xcurve is really necessary.
X\item Avoid using solid or small inter-dot gap in drawing long
Xdash lines. They used up a lot of \TeX\ memory in original \epic.
XYou should use \verb|\drawline| with negative stretch to draw the
Xdash lines.
X\end{itemize}
X
XIf you want to use any of the extended commands in \eepic, you
Xmust include the \eepic\ emulation macros (\verb|eepicemu|) in
Xthe file. The extended commands are emulated in the following
Xways.
X\begin{itemize}
X\item Circles larger than 40pt will be drawn using \verb|\oval|.
X\item Ellipsis will be drawn using \verb|\oval|.
X\item Spline will be approximated by \verb|\drawline|.
X\item \verb|\path| will be substituted by \verb|\drawline|.
X\item \verb|\Thicklines| will be substituted by
X\verb|\thicklines|.
X\item \verb|\allinethickness| will be substituted by
X\verb|\thicklines| and \verb|\linethickness|.
X\end{itemize}
X
X\clearpage
X
X
X\section{Installation}
XThere are two possible ways of installing \eepic. If your DVI
Xprinter driver program supports the tpic specials, you should use
Xthe standard \verb|eepic.sty| file. If your DVI printer driver
Xdoes not supports the tpic specials or you want to generate a
Xstandard DVI file without any special commands, you should use
Xthe file \verb|eepicemu.sty|.
X
XTo get a copy of \epic, you can {\sc ftp} \verb|epic.shar1| and
X\verb|epic.shar2| from \verb|cs.rochester.edu| in the directory
X\verb|public/latex-style|.
X
X\subsection{Use tpic Specials}
XFirst of all, you have to put a copy of \verb|epic.sty| and
X\verb|eepic.sty| in a place where \LaTeX\ can find it. See
Xsection 4 of \epic\ manual for more information.
X
XBoth \epic\ and \eepic\ have been implemented as document style
Xoptions \verb|epic| and \verb|eepic|. To include \epic\ and
X\eepic\ commands, \verb|epic| and \verb|eepic| must be added in
Xthe \verb|\documentstyle| command and \verb|eepic| must come
Xafter \verb|epic|. For example:
X\begin{quote}
X\begin{verbatim}
X\documentstyle[epic,eepic]{article}
X\end{verbatim}
X\end{quote}
X
XIf you only need the extended \LaTeX\ commands and the new
X\eepic\ commands, you may include only \verb|eepic| in the
X\verb|\documentstyle| command. But then the \eepic\ emulation
Xpackage will not work. I strongly recommend you to use
X\eepic\ with \epic\ all the time.
X
X\subsection{No tpic Specials}
XIf you want to get a standard DVI file but you need the extended
X\eepic\ commands, you should rename \verb|eepicemu.sty| to
X\verb|eepic.sty| and put that in a place where \LaTeX\ can find
Xit. Remember \verb|\arc| command is not supported and the output
Xwill not be as good as standard \eepic. Furthermore, you cannot
Xuse the emulation package with \LaTeX\ alone. You have to include
X\verb|epic| also.
X
X\subsection{Remarks}
XMore and more DVI driver programs support the tpic
X\verb|\special|s. The iptex program and screen previewers that
Xcome with the standard UNIX \TeX\ distribution supports all the
X\verb|\special| commands used by \eepic. In other words, you can
Xprint as well as preview the output. You may also get the latest
Xversion of iptex, texx and texsun from \verb|a.cs.uiuc.edu|.
X
X
X\end{document}
SHAR_EOF
fi # end of overwriting check
if test -f 'epic-eg3.tex'
then
	echo shar: will not over-write existing file "'epic-eg3.tex'"
else
sed 's/^X//' << \SHAR_EOF > 'epic-eg3.tex'
X\setlength{\unitlength}{0.0125in}
X\begin{picture}(444,125)(0,-10)
X\thicklines
X\drawline(304.318,26.338)(303.000,31.000)(301.969,26.267)
X\put(311.808,31.269){\arc{17.624}{4.8481}{9.3942}}
X\drawline(158.742,66.792)(161.000,63.000)(160.792,67.408)
X\put(168.688,65.312){\arc{16.054}{2.8495}{7.4287}}
X\drawline(143.367,53.233)(147.000,54.000)(143.433,55.033)
X\put(147.250,60.750){\arc{13.509}{1.6078}{6.2462}}
X\put(34,46){\oval(68,26)}
X\put(163,46){\ellipse{22}{22}}
X\put(231,46){\ellipse{22}{22}}
X\put(299,46){\ellipse{22}{22}}
X\put(366,46){\ellipse{22}{22}}
X\put(433,46){\ellipse{22}{22}}
X\drawline(73,46)(146,46)
X\drawline(138.000,44.000)(146.000,46.000)(138.000,48.000)
X\drawline(181,46)(214,46)
X\drawline(206.000,44.000)(214.000,46.000)(206.000,48.000)
X\drawline(247,46)(282,46)
X\drawline(274.000,44.000)(282.000,46.000)(274.000,48.000)
X\drawline(315,46)(349,46)
X\drawline(341.000,44.000)(349.000,46.000)(341.000,48.000)
X\drawline(383,46)(416,46)
X\drawline(408.000,44.000)(416.000,46.000)(408.000,48.000)
X\spline(294,34)
X(254,4)(194,-1)(164,14)(159,29)
X\drawline(163.427,22.043)(159.000,29.000)(159.632,20.778)
X\spline(229,34)
X(209,19)(184,19)(169,34)
X\drawline(176.071,29.757)(169.000,34.000)(173.243,26.929)
X\spline(221,35)
X(199,29)(175,35)
X\drawline(183.246,35.000)(175.000,35.000)(182.276,31.119)
X\spline(354,59)
X(294,79)(244,59)
X\drawline(250.685,63.828)(244.000,59.000)(252.171,60.114)
X\spline(359,64)
X(318,92)(224,84)(179,55)
X\drawline(184.641,61.015)(179.000,55.000)(186.808,57.652)
X\put(390,52){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt C}}}
X\put(323,50){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt B}}}
X\put(298,94){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt B}}}
X\put(270,74){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt A}}}
X\put(321,16){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt A}}}
X\put(260,18){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt C}}}
X\put(258,51){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt A}}}
X\put(221,16){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt C}}}
X\put(196,35){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt B}}}
X\put(192,50){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt A}}}
X\put(167,77){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt C}}}
X\put(129,64){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt B}}}
X\put(19,42){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt Start}}}
X\put(162,42){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt 1}}}
X\put(228,42){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt 2}}}
X\put(298,42){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt 3}}}
X\put(363,42){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt 4}}}
X\put(432,42){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt *}}}
X\end{picture}
SHAR_EOF
fi # end of overwriting check
if test -f 'epic-eg4.tex'
then
	echo shar: will not over-write existing file "'epic-eg4.tex'"
else
sed 's/^X//' << \SHAR_EOF > 'epic-eg4.tex'
X\setlength{\unitlength}{0.0125in}
X\begin{picture}(264,218)(0,-10)
X\thinlines
X\put(125,137){\ellipse{10}{10}}
X\put(160,92){\ellipse{10}{10}}
X\put(20,112){\ellipse{10}{10}}
X\put(80,20){\ellipse{10}{10}}
X\put(90,92){\ellipse{10}{10}}
X\put(174,20){\ellipse{10}{10}}
X\put(245,117){\ellipse{10}{10}}
X\put(170,177){\ellipse{10}{10}}
X\put(80,177){\ellipse{10}{10}}
X\dashline{4.000}(173,31)(163,82)
X\drawline(166.502,74.534)(163.000,82.000)(162.577,73.765)
X\dashline{4.000}(88,85)(81,28)
X\drawline(79.990,36.184)(81.000,28.000)(83.960,35.697)
X\dashline{4.000}(164,20)(89,20)
X\drawline(97.000,22.000)(89.000,20.000)(97.000,18.000)
X\dashline{4.000}(180,27)(239,107)
X\drawline(235.861,99.374)(239.000,107.000)(232.642,101.749)
X\dashline{4.000}(151,90)(101,90)
X\drawline(109.000,92.000)(101.000,90.000)(109.000,88.000)
X\dashline{4.000}(95,99)(118,128)
X\drawline(114.596,120.489)(118.000,128.000)(111.462,122.975)
X\dashline{4.000}(154,100)(130,128)
X\drawline(136.725,123.228)(130.000,128.000)(133.688,120.624)
X\dashline{4.000}(119,143)(87,171)
X\drawline(94.338,167.237)(87.000,171.000)(91.704,164.227)
X\drawline(24,104)(73,28)
X\drawline(66.984,33.640)(73.000,28.000)(70.346,35.807)
X\drawline(166,168)(134,143)
X\drawline(139.073,149.501)(134.000,143.000)(141.535,146.349)
X\drawline(29,110)(80,95)
X\drawline(71.761,95.339)(80.000,95.000)(72.889,99.176)
X\drawline(237,112)(171,93)
X\drawline(178.134,97.135)(171.000,93.000)(179.241,93.291)
X\drawline(178,173)(239,124)
X\drawline(231.511,127.451)(239.000,124.000)(234.016,130.569)
X\drawline(88,177)(160,177)
X\drawline(152.000,175.000)(160.000,177.000)(152.000,179.000)
X\drawline(75,171)(27,119)
X\drawline(30.957,126.235)(27.000,119.000)(33.896,123.522)
X\put(194,107){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt 7}}}
X\put(47,109){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt 6}}}
X\put(33,61){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt 5}}}
X\put(156,149){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt 4}}}
X\put(207,156){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt 3}}}
X\put(39,151){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt 2}}}
X\put(121,180){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt 1}}}
X\put(85,102){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt I}}}
X\put(159,102){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt H}}}
X\put(122,148){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt G}}}
X\put(0,105){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt F}}}
X\put(76,0){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt E}}}
X\put(171,1){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt D}}}
X\put(256,115){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt C}}}
X\put(168,187){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt B}}}
X\put(74,186){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt A}}}
X\end{picture}
SHAR_EOF
fi # end of overwriting check
if test -f 'eepicemu.sty'
then
	echo shar: will not over-write existing file "'eepicemu.sty'"
else
sed 's/^X//' << \SHAR_EOF > 'eepicemu.sty'
X% eepicemy Version 1.0 < August 14, 1988 >
X%	Written by Conrad Kwok
X%
X% Internet : kwok@iris.ucdavis.edu
X% csnet    : kwok@ucd.csnet
X% csnet    : kwok%iris.ucdavis.edu@csnet.relay
X% UUCP	   : ...!ucbvax!ucdavis!iris!kwok
X%
X% The macros are in public domain.
X% You may distribute or modify it in any ways you like.
X% Please report any bugs, enhancements, comments, suggestions, etc.
X\makeatletter
X\typeout{Emulation of EEPIC using EPIC. Version 1.0 - Release August 14, 1988}
X\let\path\drawline
X\def\ellipse{%
X    \@ifstar{\@ellipse}{\@ellipse}}
X\def\@ellipse#1#2{%
X    \ifnum #1=#2%
X	\circle{#1}%
X    \else
X	\oval(#1,#2)
X    \fi\relax}
X\let\Thicklines\thicklines
X\def\circle{%
X    \@ifstar
X	{\@emudot}%
X	{\@emucirc}%
X}
X\def\@emudot#1{%
X    \@tempdimb #1\unitlength
X    \ifdim \@tempdimb > 15pt
X        \oval(#1,#1)%
X    \else
X        \@dot{#1}%
X    \fi
X}
X\def\@emucirc#1{%
X     \@tempdimb #1\unitlength
X     \ifdim \@tempdimb > 40pt
X	\oval(#1,#1)%
X     \else
X	\@circle{#1}%
X     \fi
X}
X\def\arc#1#2#3{\typeout{arc function is not supported in emulation package}}
X\newcount\@spxcnt
X\newcount\@spycnt
X\newcount\@ispxcnt
X\newcount\@ispycnt
X\newcount\@cmidxcnt
X\newcount\@cmidycnt
X
X\def\spline(#1,#2){%
X    \@ifnextchar ({\@ispline(#1,#2)}%
X		  {\ignorespaces}}
X\def\@ispline(#1,#2)(#3,#4){%
X    \@ifnextchar ({\@iispline(#1,#2)(#3,#4)}%
X	          {\@drawline[0](#1,#2)(#3,#4)\ignorespaces}}
X\def\@iispline(#1,#2)(#3,#4)(#5,#6){%
X    \@ifnextchar ({%
X        \@spxcnt=#3 \advance\@spxcnt by #5 \divide\@spxcnt by 2\relax
X        \@spycnt=#4 \advance\@spycnt by #6 \divide\@spycnt by 2\relax
X        \@chaikin{#1}{#2}{#3}{#4}{\@spxcnt}{\@spycnt}%
X        \@ispxcnt=\@spxcnt\relax \@ispycnt=\@spycnt\relax
X        \@iispline(\@ispxcnt,\@ispycnt)(#5,#6)}%
X%   else
X       {\@chaikin{#1}{#2}{#3}{#4}{#5}{#6}}}
X\def\@chaikin#1#2#3#4#5#6{%
X    \@cmidxcnt=#1 \advance\@cmidxcnt by #3
X    \advance\@cmidxcnt by #3 \advance\@cmidxcnt by #5
X    \divide\@cmidxcnt by 4
X    \@cmidycnt=#2 \advance\@cmidycnt by #4
X    \advance\@cmidycnt by #4 \advance\@cmidycnt by #6
X    \divide\@cmidycnt by 4
X    \@drawline[0](#1,#2)(\@cmidxcnt,\@cmidycnt)%
X    \@drawline[0](\@cmidxcnt,\@cmidycnt)(#5,#6)%
X}
X\def\allinethickness#1{\thicklines\linethickness{#1}}
X\makeatother
SHAR_EOF
fi # end of overwriting check
#	End of shell archive
exit 0

kwok@iris (Conrad Kwok) (08/23/88)

#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create the files:
#	eepic.sty
#	epic.sty
# This archive created: Sun Aug 21 00:04:25 1988
export PATH; PATH=/bin:$PATH
if test -f 'eepic.sty'
then
	echo shar: will not over-write existing file "'eepic.sty'"
else
sed 's/^X//' << \SHAR_EOF > 'eepic.sty'
X% eepic Version 1.0 < August 14, 1988 >
X%	Written by Conrad Kwok
X%
X% Internet : kwok@iris.ucdavis.edu
X% csnet    : kwok@ucd.csnet
X% csnet    : kwok%iris.ucdavis.edu@csnet.relay
X% UUCP	   : ...!ucbvax!ucdavis!iris!kwok
X%
X% The macros are in public domain.
X% You may distribute or modify it in any ways you like.
X% Please report any bugs, enhancements, comments, suggestions, etc.
X%
X% This style file modify some of the commands in epic[1] and LaTeX[2] such
X% that \special commands will be generated in drawing lines if approriate.
X% The \special commands generated is the subset of the \specials used
X% by tpic[3].
X%
X% [1] epic is written by Sunil Podar. Please read epic.sty for the
X%     copyright notice.
X% [2] LaTeX is written by Leslie Lamport. Please read the book LaTeX
X% [3] tpic is modified from pic by Tim Morgan
X%
X%% This file contains extensions of the following epic commands:
X%%	\dottedline	\dashline	\drawline
X%%	\jput
X%%
X%% It also contains extensions of the following LaTeX commands:
X%%	\circle		\line
X%%
X%% New commands include:
X%%	\Thicklines	\arc		\ellipse
X%%	\path		\spline
X%%
X%% For documentation, please see the accompanying manual
X%%
X\makeatletter
X\typeout{%
XExtension to Epic and LaTeX. Version 1.0 - Release August 14, 1988}
X%
X\newcount\@gphlinewidth
X\newcount\@eepictcnt
X\newdimen\@tempdimc
X\@gphlinewidth\@wholewidth \divide\@gphlinewidth 4736
X
X%% Redefine \thinlines, \thicklines
X%% See also latex.tex
X\def\thinlines{\let\@linefnt\tenln \let\@circlefnt\tencirc
X    \@wholewidth\fontdimen8\tenln \@halfwidth .5\@wholewidth
X    \@gphlinewidth\@wholewidth \divide\@gphlinewidth 4736\relax}
X\def\thicklines{\let\@linefnt\tenlnw \let\@circlefnt\tencircw
X    \@wholewidth\fontdimen8\tenlnw \@halfwidth .5\@wholewidth
X    \@gphlinewidth\@wholewidth \divide\@gphlinewidth 4736
X    \advance\@gphlinewidth\@ne   % Make the output looks better
X    \relax}
X%%
X%% To indicate whether the dot character is defined in the dotted join
X%%     environment or not (\@ifnodotdef)
X\newif\if@nodotdef \global\@nodotdeftrue
X%%
X%% Redefine \dottedjoin
X\def\dottedjoin{\global\@jointhemtrue \global\@joinkind=0\relax
X  \bgroup\@ifnextchar[{\global\@nodotdeffalse\@idottedjoin}%
X                      {\global\@nodotdeftrue\@idottedjoin[\@empty]}}
X%%----------------------------------------------------------------------
X%% Redefine \jput
X\long\def\jput(#1,#2)#3{\@killglue\raise#2\unitlength\hbox to \z@{\hskip
X#1\unitlength #3\hss}%
X\if@jointhem \if@firstpoint \gdef\x@one{#1} \gdef\y@one{#2} \global\@firstpointfalse
X \else\ifcase\@joinkind
X    \if@nodotdef
X        \@spdottedline{\dotgap@join\unitlength}%
X(\x@one\unitlength ,\y@one\unitlength)(#1\unitlength,#2\unitlength)
X    \else
X	\@dottedline[\dotchar@join]{\dotgap@join\unitlength}%
X(\x@one\unitlength,\y@one\unitlength)(#1\unitlength,#2\unitlength)
X    \fi
X	\or\@dashline[\dashlinestretch]{\dashlen@join\unitlength}[\dotgap@join]%
X(\x@one,\y@one)(#1,#2)
X	\else\@drawline[\drawlinestretch](\x@one,\y@one)(#1,#2)\fi
X    \gdef\x@one{#1}\gdef\y@one{#2}%
X \fi
X\fi\ignorespaces}
X%%
X%% Redefine \dottedline to generate special whenever possible.
X\def\dottedline{\@ifnextchar [{\@idottedline}{\@ispdottedline}}
X%% Similar to \@idottedline but it generate \special
X\def\@ispdottedline#1(#2,#3){\@ifnextchar (%
X{\@iispdottedline{#1}(#2,#3)}{\relax}}
X\def\@iispdottedline#1(#2,#3)(#4,#5){\@spdottedline{#1\unitlength}%
X(#2\unitlength,#3\unitlength)(#4\unitlength,#5\unitlength)%
X\@ispdottedline{#1}(#4,#5)}
X%
X\def\@spdottedline#1(#2,#3)(#4,#5){%
X    \@tempcnta \@gphlinewidth\relax
X    \advance\@tempcnta by 2     % solely for better output
X    \special{pn \the\@tempcnta}%
X    \@tempdimc=#2\relax
X    \@tempcnta \@tempdimc\relax \advance\@tempcnta 2368 \divide\@tempcnta 4736
X    \@tempdimc=#3\relax
X    \@tempcntb -\@tempdimc\relax\advance\@tempcntb -2368 \divide\@tempcntb 4736
X    \@paspecial{\the\@tempcnta}{\the\@tempcntb}%
X    \@tempdimc=#4\relax
X    \@tempcnta \@tempdimc\relax \advance\@tempcnta 2368 \divide\@tempcnta 4736
X    \@tempdimc=#5\relax
X    \@tempcntb -\@tempdimc\relax\advance\@tempcntb -2368 \divide\@tempcntb 4736
X    \@paspecial{\the\@tempcnta}{\the\@tempcntb}%
X    \@tempdimc=#1\relax
X%%
X%% Generate the pen width in terms of inch with 3 decimal digit.
X    \@tempcnta \@tempdimc\relax \advance\@tempcnta 2368 \divide\@tempcnta 4736
X%% \@tempcnta contain the pen width in terms of thousandth of a inch
X%% Then it is converted back to inch. I know the way I use is dumb but
X%% I cannot think of any better method
X    \@tempcntb \@tempcnta\relax \divide\@tempcntb 1000
X    \multiply \@tempcntb 1000 \advance\@tempcnta -\@tempcntb
X    \divide\@tempcntb 1000
X    \ifnum\@tempcnta < 10
X        \special{dt \the\@tempcntb.00\the\@tempcnta}%
X    \else\ifnum\@tempcnta < 100
X        \special{dt \the\@tempcntb.0\the\@tempcnta}%
X    \else
X        \special{dt \the\@tempcntb.\the\@tempcnta}%
X    \fi\fi
X    \ignorespaces
X}
X%
X\def\@iiidashline[#1]#2[#3](#4,#5)(#6,#7){%
X\@dashline[#1]{#2\unitlength}[#3](#4,#5)(#6,#7)%
X\@iidashline[#1]{#2}[#3](#6,#7)}
X%
X%% Redefine \@dashline
X\long\def\@dashline[#1]#2[#3](#4,#5)(#6,#7){{%
X\x@diff=#6\unitlength \advance\x@diff by -#4\unitlength
X\y@diff=#7\unitlength \advance\y@diff by -#5\unitlength
X%% correction to get actual width since the dash-length as taken in arguement
X%% is the center-to-center of the end-points.
X\@tempdima=#2\relax \advance\@tempdima -\@wholewidth
X\sqrtandstuff{\x@diff}{\y@diff}{\@tempdima}%
X\ifnum\num@segments <3 \num@segments=3\fi% min number of dashes I can plot
X% is 2, 1 at either end, thus min num@segments is 3 (including 'empty dash').
X\@tempdima=\x@diff \@tempdimb=\y@diff
X\divide\@tempdimb by\num@segments
X\divide\@tempdima by\num@segments
X%% ugly if-then-else. If optional dotgap specified, then use it otherwise
X%% make a solid dash.
X{\ifx#3\@empty \relax
X    \ifdim\@tempdima < 0pt \x@diff=-\@tempdima\else\x@diff=\@tempdima\fi
X    \ifdim\@tempdimb < 0pt \y@diff=-\@tempdimb\else\y@diff=\@tempdimb\fi
X    \global\setbox\@dotbox\hbox{%
X                \@absspdrawline(0pt,0pt)(\@tempdima,\@tempdimb)}%
X    \else\global\setbox\@dotbox\hbox{%
X        \@spdottedline{#3\unitlength}(0pt,0pt)(\@tempdima,\@tempdimb)}%
X    \fi}%
X\advance\x@diff by -\@tempdima % both have same sign
X\advance\y@diff by -\@tempdimb
X%
X%%here we correct the number of dashes to be put by reducing them
X%%appropriately. (num@segments*\@wholewidth) is in some way the slack we
X%%have,and division by dash-length gives the reduction. reduction =
X%%(2*num@segments*\@wholewidth)/dash-length
X%% (num@segments includes empty ones)
X\@tempdima=\num@segments\@wholewidth \@tempdima=2\@tempdima
X\@tempcnta\@tempdima\relax \@tempdima=#2\relax \@tempdimb=0.5\@tempdima
X\@tempcntb\@tempdimb\relax \advance\@tempcnta by \@tempcntb % round-off error
X\divide\@tempcnta by\@tempdima \advance\num@segments by -\@tempcnta
X%
X\ifnum #1=0 \relax\else\ifnum #1 < -100
X  \typeout{***dashline: reduction > -100 percent implies blankness!***}
X\else\num@segmentsi=#1 \advance\num@segmentsi by 100
X     \multiply\num@segments by\num@segmentsi \divide\num@segments by 100
X\fi\fi
X%
X\divide\num@segments by 2 % earlier num@segments included 'empty dashes' too.
X\ifnum\num@segments >0 % if =0 then don't divide => \x@diff & \y@diff
X \divide\x@diff by\num@segments%   remain same.
X \divide\y@diff by\num@segments
X \advance\num@segments by\@ne %for the last segment for which I subtracted
X	 		     %\@tempdima & \@tempdimb from \x@diff & \y@diff
X \else\num@segments=2 % one at each end.
X\fi
X%%\typeout{num@segments finally = \the\num@segments}
X%% equiv to \multiput(#4,#5)(\x@diff,\y@diff){\num@segments}{\copy\@dotbox}
X%% with arguements in absolute dimensions.
X\@xdim=#4\unitlength \@ydim=#5\unitlength
X\@killglue
X\loop \ifnum\num@segments > 0
X\unskip\raise\@ydim\hbox to\z@{\hskip\@xdim \copy\@dotbox\hss}%
X\advance\num@segments \m@ne\advance\@xdim\x@diff\advance\@ydim\y@diff%
X\repeat}%
X\ignorespaces}
X%% redefine \@drawline
X%
X\def\@drawline[#1](#2,#3)(#4,#5){{%
X\@drawitfalse\@horvlinefalse
X\ifnum#1 <0 \relax\else\@horvlinetrue\fi
X\if@horvline
X \@spdrawline(#2,#3)(#4,#5)
X\else\@drawittrue\fi
X%%-------------------------------
X\if@drawit
X\ifnum #1=0 \relax \else\ifnum #1 < -99
X  \typeout{***drawline: reduction <= -100 percent implies blankness!***}%
X\else\num@segmentsi=#1 \advance\num@segmentsi by 50
X     \multiply\num@segmentsi 2
X\fi\fi
X\@dashline[\num@segmentsi]{10pt}[\@empty](#2,#3)(#4,#5)
X\fi}\ignorespaces}% for \if@drawit
X%
X\def\@spdrawline(#1,#2)(#3,#4){%
X   \@absspdrawline(#1\unitlength,#2\unitlength)(#3\unitlength,#4\unitlength)
X   \ignorespaces
X}
X\def\@absspdrawline(#1,#2)(#3,#4){%
X    \special{pn \the\@gphlinewidth}%
X    \@tempdimc=#1\relax
X    \@tempcnta \@tempdimc\relax \advance\@tempcnta 2368 \divide\@tempcnta 4736
X    \@tempdimc=#2\relax
X    \@tempcntb -\@tempdimc\relax \advance\@tempcntb -2368 \divide\@tempcntb 4736
X    \@paspecial{\the\@tempcnta}{\the\@tempcntb}%
X    \@tempdimc=#3\relax
X    \@tempcnta\@tempdimc\relax \advance\@tempcnta 2368 \divide\@tempcnta 4736
X    \@tempdimc=#4\relax
X    \@tempcntb -\@tempdimc\relax \advance\@tempcntb -2368 \divide\@tempcntb 4736
X    \@paspecial{\the\@tempcnta}{\the\@tempcntb}%
X    \special{fp}%
X    \ignorespaces
X}
X%%----------------------------------------------------------------------
X\def\@paspecial#1#2{%
X    \special{pa #1 #2}%
X}
X%%
X%% Functions below modify the LaTeX commands and some additional commands
X%% are not supported by LaTeX nor epic such as ThickLines and arc.
X%%
X%% The macros are for use with LaTeX picture environment
X%% By including the macro file, you can draw
X%%   1) \line in any slope
X%%   2) \circle with any radius
X%%   3) \ellipse with any x-axis and y-axis length
X%%   4) Circular \arc by giving starting and ending angle (in radius)
X%%
X%% Furthermore you may draw lines in any thickness.
X%%
X%%
X%% Redefine \thinlines, \thicklines and define \Thickline
X%% See also latex.tex
X\def\Thicklines{\let\@linefnt\tenlnw \let\@circlefnt\tencircw
X    \@wholewidth\fontdimen8\tenlnw \@wholewidth 1.5\@wholewidth
X    \@halfwidth .5\@wholewidth
X    \@gphlinewidth\@wholewidth \divide\@gphlinewidth 4736\relax}
X%%
X%% Generate the \special command for drawing arc
X\def\@circlespecial#1#2#3#4{%
X	      \special{pn \the\@gphlinewidth}%
X	      \special{ar 0 0 #1 #2 #3 #4}
X}
X%%
X%% Command for drawing an arc. Elliptical arc command can be generated
X%% but all iptex program I saw so far does not support that.
X\def\@arc#1#2#3#4{%
X%% convert TeX dimension to length in terms thousandth of an inch
X	\@tempdima #1\unitlength
X	\@tempdimb #2\unitlength
X        \@tempcnta\@tempdima \advance\@tempcnta 4736 \divide\@tempcnta 9473
X	\@tempcntb\@tempdimb \advance\@tempcntb 4736 \divide\@tempcntb 9473
X	\setbox\@tempboxa\hbox{%
X	    \@circlespecial{\the\@tempcnta}{\the\@tempcntb}{#3}{#4}}%
X        \wd\@tempboxa\z@ \box\@tempboxa}
X%%
X%% Command for drawing Circle and Ellipse in terms of \@arc
X%% replace original \circle
X\def\circle{%
X    \@ifstar{\special{bk}\@circle}{\@circle}}
X\def\@circle#1{\@arc{#1}{#1}{0}{6.2832}}
X\def\ellipse{%
X    \@ifstar{\special{bk}\@ellipse}{\@ellipse}}
X\def\@ellipse#1#2{{\@arc{#1}{#2}{0}{6.2832}}}
X\def\arc#1#2#3{\@arc{#1}{#1}{#2}{#3}}
X%%
X%% Generate \special commands for drawing line
X\def\@linespecial#1#2{%
X	      \special{pn \the\@gphlinewidth}%
X	      \special{pa 0 0}%
X	      \special{pa #1 #2}%
X	      \special{fp}%
X}
X%%
X%% Replace original \@sline
X%% For description, see latex.tex
X\def\@sline{%
X	\ifnum\@xarg< 0
X	  \@negargtrue \@xarg -\@xarg \@tempdima -\@linelen
X	\else
X	  \@negargfalse \@tempdima\@linelen
X	\fi
X%% truncation is used in arithmetic
X	\@tempcnta\@linelen \divide\@tempcnta 4736
X        \@yyarg -\@yarg \multiply\@yyarg \@tempcnta \divide\@yyarg\@xarg
X 	\if@negarg
X	    \@tempcnta -\@tempcnta
X	\fi
X	\setbox\@linechar\hbox{\@linespecial{\the\@tempcnta}{\the\@yyarg}}%
X	\wd\@linechar\@tempdima
X	\@clnht\@linelen
X        \multiply\@clnht\@yarg
X        \divide\@clnht\@xarg
X	\ifnum\@yarg< 0
X	  \@clnht -\@clnht
X	  \ht\@linechar\z@ \dp\@linechar\@clnht
X	\else
X	  \ht\@linechar\@clnht \dp\@linechar\z@
X	\fi
X	\box\@linechar
X%% Codes below (till end of the command) is only necessary
X%% when used with \@svector
X	\if@negarg
X	  \@yyarg -\@yarg
X	\else
X	  \@yyarg \@yarg
X	\fi
X	\setbox\@linechar\hbox{\@linefnt\@getlinechar(\@xarg,\@yyarg)}%
X	\ifnum\@yarg> 0
X	  \let\@upordown\raise
X	  \advance\@clnht -\ht\@linechar
X	\else
X	  \let\@upordown\lower
X	\fi
X	\if@negarg \kern\wd\@linechar \fi
X}
X%%
X\def\spline(#1,#2){%
X    \special{pn \the\@gphlinewidth}%
X    \@spline(#1,#2)%
X}
X\def\@spline(#1,#2){%
X    \@tempdima #1\unitlength
X    \@tempdimb #2\unitlength
X    \@tempcnta \@tempdima \advance\@tempcnta 2368 \divide\@tempcnta 4736
X    \@tempcntb -\@tempdimb \advance\@tempcntb -2368 \divide\@tempcntb 4736
X    \@paspecial{\the\@tempcnta}{\the\@tempcntb}%
X    \@ifnextchar ({\@spline}{\special{sp}}%
X}
X\def\path(#1,#2){%
X    \special{pn \the\@gphlinewidth}%
X    \@path(#1,#2)%
X}
X\def\@path(#1,#2){%
X    \@tempdima #1\unitlength
X    \@tempdimb #2\unitlength
X    \@tempcnta \@tempdima \advance\@tempcnta 2368 \divide\@tempcnta 4736
X    \@tempcntb -\@tempdimb \advance\@tempcntb -2368 \divide\@tempcntb 4736
X    \@paspecial{\the\@tempcnta}{\the\@tempcntb}%
X    \@ifnextchar ({\@path}{\special{fp}}%
X}
X
X%%%%%%%%%% Beginning of \oval %%%%%%%%%%%%%%%
X\newdimen\maxovaldiam \maxovaldiam 40pt\relax
X
X\def\@oval(#1,#2)[#3]{\begingroup\boxmaxdepth \maxdimen
X  \@ovttrue \@ovbtrue \@ovltrue \@ovrtrue
X  \@tfor\@tempa :=#3\do{\csname @ov\@tempa false\endcsname}\@ovxx
X  #1\unitlength \@ovyy #2\unitlength
X  \@tempdimb \ifdim \@ovyy >\@ovxx \@ovxx\else \@ovyy \fi
X  \@ovro \ifdim \@tempdimb>\maxovaldiam \maxovaldiam\else\@tempdimb\fi\relax
X  \divide \@ovro \tw@
X  \@ovdx\@ovxx \divide\@ovdx \tw@
X  \@ovdy\@ovyy \divide\@ovdy \tw@
X  \setbox\@tempboxa \hbox{%
X  \if@ovr \@ovverta\fi
X  \if@ovl \kern \@ovxx \@ovvertb\kern -\@ovxx \fi
X  \if@ovt \@ovhorz \kern -\@ovxx \fi
X  \if@ovb \raise \@ovyy \@ovhorz \fi}
X  \ht\@tempboxa\z@ \dp\@tempboxa\z@
X  \@put{-\@ovdx}{-\@ovdy}{\box\@tempboxa}%
X  \endgroup}
X
X\def\@qcirc#1#2#3#4{%
X    \special{pn \the\@gphlinewidth}%
X    \@eepictcnt \@gphlinewidth \divide\@eepictcnt 2
X    \@tempcnta #1 
X      \advance\@tempcnta 2368 \divide\@tempcnta 4736
X      \advance\@tempcnta\@eepictcnt
X    \@tempcntb #2 \divide\@tempcntb 4736 \advance\@tempcntb 2
X    \hbox{%
X        \@qcircspecial{\the\@tempcnta}{-\the\@eepictcnt}{\the\@tempcntb}{#3}{#4}}%
X}
X\def\@qcircspecial#1#2#3#4#5{\special{ar #1 #2 #3 #3 #4 #5}}
X
X\def\@ovverta{\vbox to \@ovyy{%
X    \if@ovb
X        \kern \@ovro
X        \@qcirc{\@ovro}{\@ovro}{3.1416}{4.7124}\nointerlineskip
X    \else
X        \kern \@ovdy
X    \fi
X    \leaders\vrule width \@wholewidth\vfil \nointerlineskip
X    \if@ovt
X        \@qcirc{\@ovro}{\@ovro}{1.5708}{3.1416}\nointerlineskip
X        \kern \@ovro
X    \else
X        \kern \@ovdy
X    \fi
X}\kern -\@wholewidth}
X
X\def\@ovvertb{\vbox to \@ovyy{%
X    \if@ovb
X        \kern \@ovro
X        \@qcirc{-\@ovro}{\@ovro}{4.6124}{6.2832}\nointerlineskip
X    \else
X        \kern \@ovdy
X    \fi
X    \leaders\vrule width \@wholewidth\vfil \nointerlineskip
X    \if@ovt
X        \@qcirc{-\@ovro}{\@ovro}{0}{1.6708}\nointerlineskip
X        \kern \@ovro
X    \else
X        \kern \@ovdy
X    \fi
X}\kern -\@wholewidth}
X
X\def\@ovhorz{\hbox to \@ovxx{%
X    \if@ovr \kern \@ovro\else \kern \@ovdx \fi
X    \leaders \hrule height \@wholewidth \hfil
X    \if@ovl \kern \@ovro\else \kern \@ovdx \fi
X    }}
X%%%%%%%%% End of \oval %%%%%%%%%%%%%%
X
X\def\allinethickness#1{\let\@linefnt\tenlnw \let\@circlefnt\tencircw
X    \@wholewidth #1 \@halfwidth .5\@wholewidth
X    \@gphlinewidth\@wholewidth \divide\@gphlinewidth 4736\relax}
X\makeatother
X
SHAR_EOF
fi # end of overwriting check
if test -f 'epic.sty'
then
	echo shar: will not over-write existing file "'epic.sty'"
else
sed 's/^X//' << \SHAR_EOF > 'epic.sty'
X\makeatletter
X\typeout{%
XEnhancements to Picture Environment. Version 1.2 - Released June 1, 1986}
X%----------------------------------------------------------------------
X% Copyright (C) podar@sbcs (Sunil Podar) July 14,1986.
X% You may use this file in whatever way you wish. You are requested to 
X% leave this notice intact, and report any bugs, enhancements, comments,
X% suggestions, etc. to:
X% USmail: Sunil Podar,Dept. of Computer Science,SUNY at Stony Brook,NY 11794.
X%  CSNET: podar@sbcs.csnet
X%   ARPA: podar%suny-sb.csnet@csnet-relay.arpa
X%   UUCP: {allegra, hocsd, philabs, ogcvax}!sbcs!podar
X%----------------------------------------------------------------------
X% This file contains implementation of:
X% \multiputlist	\matrixput	\grid		\picsquare
X% \dottedline	\dashline	\drawline	\jput
X% \putfile
X% Environments: dottedjoin, dashjoin and drawjoin
X%
X% For documentation, see the accompanying manual.
X%----------------------------------------------------------------------
X% usage: \multiputlist(x,y)(delta-x,delta-y)[tbrl]{item1,item2,item3,.....}
X% \lop and \lopoff taken from TeXbook.
X%----------------------------------------------------------------------
X\def\lop#1\to#2{\expandafter\lopoff#1\lopoff#1#2}
X\long\def\lopoff,#1,#2\lopoff#3#4{\def#4{#1}\def#3{,#2}}
X\def\@@mlistempty{,}
X\newif\iflistnonempty
X\def\multiputlist(#1,#2)(#3,#4){\@ifnextchar
X[{\@imultiputlist(#1,#2)(#3,#4)}{\@imultiputlist(#1,#2)(#3,#4)[]}}
X
X\long\def\@imultiputlist(#1,#2)(#3,#4)[#5]#6{{%
X\@xdim=#1\unitlength \@ydim=#2\unitlength
X\listnonemptytrue \def\@@mlist{,#6,} % need this for end condition
X\loop
X\lop\@@mlist\to\@@firstoflist
X\@killglue\raise\@ydim\hbox to\z@{\hskip
X\@xdim\@imakepicbox(0,0)[#5]{\@@firstoflist}\hss}
X\advance\@xdim #3\unitlength\advance\@ydim #4\unitlength
X\ifx\@@mlist\@@mlistempty \listnonemptyfalse\fi
X\iflistnonempty
X\repeat\relax
X\ignorespaces}}
X%----------------------------------------------------------------------
X% two-dimensional version of \multiput
X% \matrixput(0,0)(20,0){5}(0,20){3}{\circle{2}}
X%----------------------------------------------------------------------
X\newcount\@@multicnt
X\def\matrixput(#1,#2)(#3,#4)#5(#6,#7)#8#9{%
X\ifnum#5>#8\@matrixput(#1,#2)(#3,#4){#5}(#6,#7){#8}{#9}%
X\else\@matrixput(#1,#2)(#6,#7){#8}(#3,#4){#5}{#9}\fi}
X
X%% here #5 >= #8
X\long\def\@matrixput(#1,#2)(#3,#4)#5(#6,#7)#8#9{{\@killglue%
X\@multicnt=#5\relax\@@multicnt=#8\relax%
X\@xdim=0pt%
X\@ydim=0pt%
X\setbox\@tempboxa\hbox{\@whilenum \@multicnt > 0\do {%
X%%\typeout{\the\@multicnt, \the\@@multicnt}%
X\raise\@ydim\hbox to \z@{\hskip\@xdim #9\hss}%
X\advance\@multicnt \m@ne%
X\advance\@xdim #3\unitlength\advance\@ydim #4\unitlength}}%
X\@xdim=#1\unitlength%
X\@ydim=#2\unitlength%
X\@whilenum \@@multicnt > 0\do {%
X\raise\@ydim\hbox to \z@{\hskip\@xdim \copy\@tempboxa\hss}%
X\advance\@@multicnt \m@ne%
X\advance\@xdim #6\unitlength\advance\@ydim #7\unitlength}%
X\ignorespaces}}
X%----------------------------------------------------------------------
X%\grid(wd,ht)(delta-wd,delta-ht)[initial-X-integer,initial-Y-integer]
X% example: 1. \put(0,0){\grid(95,100)(9.5,10)}
X%          2. \put(0,0){\grid(100,100)(10,5)[-10,0]}
X%          or \put(0,0){\tiny \grid(100,100)(5,5)[0,0]}%numbers in \tiny font
X%----------------------------------------------------------------------
X\newcount\d@lta
X\newdimen\@delta
X\newdimen\@@delta
X\newcount\@gridcnt
X\def\grid(#1,#2)(#3,#4){\@ifnextchar [{\@igrid(#1,#2)(#3,#4)}%
X{\@igrid(#1,#2)(#3,#4)[@,@]}}
X
X\long\def\@igrid(#1,#2)(#3,#4)[#5,#6]{%
X\makebox(#1,#2){%
X\@delta=#1pt\@@delta=#3pt\divide\@delta \@@delta\d@lta=\@delta%
X\advance\d@lta \@ne\relax\message{grid=\the\d@lta\space x}%
X%% copied the definition of \line(0,1){#2} for some efficiency!.
X\multiput(0,0)(#3,0){\d@lta}{\hbox to\z@{\hskip -\@halfwidth \vrule
X	 \@width \@wholewidth \@height #2\unitlength \@depth \z@\hss}}%
X\ifx#5@\relax\else%
X\global\@gridcnt=#5%
X\multiput(0,0)(#3,0){\d@lta}{%
X\makebox(0,-2)[t]{\number\@gridcnt\global\advance\@gridcnt by #3}}%
X\global\@gridcnt=#5%
X\multiput(0,#2)(#3,0){\d@lta}{\makebox(0,0)[b]{\number\@gridcnt\vspace{2mm}%
X\global\advance\@gridcnt by #3}}%
X\fi%
X\@delta=#2pt\@@delta=#4pt\divide\@delta \@@delta\d@lta=\@delta%
X\advance\d@lta \@ne\relax\message{\the\d@lta . }%
X%% copied the definition of \line(1,0){#1} for some efficiency!.
X\multiput(0,0)(0,#4){\d@lta}{\vrule \@height \@halfwidth \@depth \@halfwidth
X	 \@width #1\unitlength}%
X\ifx#6@\relax\else
X\global\@gridcnt=#6%
X\multiput(0,0)(0,#4){\d@lta}{%
X\makebox(0,0)[r]{\number\@gridcnt\ \global\advance\@gridcnt by #4}}%
X\global\@gridcnt=#6%
X\multiput(#1,0)(0,#4){\d@lta}{%
X\makebox(0,0)[l]{\ \number\@gridcnt\global\advance\@gridcnt by #4}}%
X\fi}}
X%----------------------------------------------------------------------
X% \picsquare is a centered square of dimensions governed by \thinlines,
X% \thicklines or \linethickness declarations.
X\def\picsquare{\hskip -0.5\@wholewidth%
X\vrule height \@halfwidth depth \@halfwidth width \@wholewidth}
X%
X% just a square dot with reference point at bottom-left
X\def\picsquare@bl{\vrule height \@wholewidth depth \z@  width \@wholewidth}
X%----------------------------------------------------------------------
X% \begin{dottedjoin}{interdot-gap in units}
X% .....			
X% \end{dottedjoin}
X% \begin{dashjoin}{dash-length in units}{interdotgap in each dash}
X% .....			
X% \end{dashjoin}
X% \begin{drawjoin}
X% .....
X% \end{drawjoin}
X% \jput(x,y){character}
X% \dottedline[opt. dotcharacter]{dotgap in units}(x1,y1)(x2,y2)...(xN,yN)
X% \dashline[#]{dash-length}[opt. dotgap](x1,y1)(x2,y2)...(xN,yN)
X% \drawline[#](x1,y1)(x2,y2)...(xN,yN)
X%----------------------------------------------------------------------
X% definitions for *join environment. had to do all this mess because of
X% optional arguments.
X%----------------------------------------------------------------------
X\newif\if@jointhem \global\@jointhemfalse
X\newif\if@firstpoint \global\@firstpointtrue
X\newcount\@joinkind
X%\newenvironment{dottedjoin}[1]%[opt char]{dotgap}
X%{\global\@jointhemtrue \gdef\dotgap@join{#1}\global\@joinkind=0\relax}%
X%{\global\@jointhemfalse \global\@firstpointtrue}
X%----------------------------------------------------------------------
X\def\dottedjoin{\global\@jointhemtrue \global\@joinkind=0\relax
X  \bgroup\@ifnextchar[{\@idottedjoin}{\@idottedjoin[\picsquare@bl]}}
X\def\@idottedjoin[#1]#2{\gdef\dotchar@join{#1}\gdef\dotgap@join{#2}}
X\def\enddottedjoin{\global\@jointhemfalse \global\@firstpointtrue\egroup}
X%----------------------------------------------------------------------
X\def\dashjoin{\global\@jointhemtrue \global\@joinkind=1\relax
X  \bgroup\@ifnextchar[{\@idashjoin}{\@idashjoin[\dashlinestretch]}}
X\def\@idashjoin[#1]#2{\edef\dashlinestretch{#1}\gdef\dashlen@join{#2}%
X\@ifnextchar[{\@iidashjoin}{\gdef\dotgap@join{}}}
X\def\@iidashjoin[#1]{\gdef\dotgap@join{#1}}
X\let\enddashjoin\enddottedjoin
X%----------------------------------------------------------------------
X\def\drawjoin{\global\@jointhemtrue \global\@joinkind=2\relax
X  \bgroup\@ifnextchar[{\@idrawjoin}{}}
X\def\@idrawjoin[#1]{\def\drawlinestretch{#1}}
X\let\enddrawjoin\enddottedjoin
X%----------------------------------------------------------------------
X%% this is equiv to \put(x,y){#1} when not in {dot*join} environment.
X\long\def\jput(#1,#2)#3{{\@killglue\raise#2\unitlength\hbox to \z@{\hskip
X#1\unitlength #3\hss}\ignorespaces}
X\if@jointhem
X \if@firstpoint \gdef\x@one{#1} \gdef\y@one{#2} \global\@firstpointfalse
X \else\ifcase\@joinkind
X	\@dottedline[\dotchar@join]{\dotgap@join\unitlength}%
X(\x@one\unitlength,\y@one\unitlength)(#1\unitlength,#2\unitlength)
X	\or\@dashline[\dashlinestretch]{\dashlen@join}[\dotgap@join]%
X(\x@one,\y@one)(#1,#2)
X	\else\@drawline[\drawlinestretch](\x@one,\y@one)(#1,#2)\fi
X    \gdef\x@one{#1} \gdef\y@one{#2}
X \fi
X\fi}
X%----------------------------------------------------------------------
X\newdimen\@dotgap
X\newdimen\@ddotgap
X\newcount\@x@diff
X\newcount\@y@diff
X\newdimen\x@diff
X\newdimen\y@diff
X\newbox\@dotbox
X\newcount\num@segments
X\newcount\num@segmentsi
X\newif\ifsqrt@done
X%% from sqrtandstuff func basically need \num@segments.
X%% given a deltax, deltay and dotgap, it calculates \num@segments = number of
X%% segments along the hypotenuse. used by \dottedline & \dashline.
X%% It finishes quickly if any of deltax or deltay are zero or close to zero.
X\def\sqrtandstuff#1#2#3{
X\ifdim #1 <0pt \@x@diff= -#1 \else\@x@diff=#1\fi
X\ifdim #2 <0pt \@y@diff= -#2 \else\@y@diff=#2\fi
X%% @diff's will be positive and diff's will retain their sign.
X\@dotgap=#3 \divide\@dotgap \tw@
X\advance\@x@diff \@dotgap \advance\@y@diff \@dotgap% for round-off errors
X\@dotgap=#3
X\divide\@x@diff \@dotgap \divide\@y@diff \@dotgap
X\sqrt@donefalse
X\ifnum\@x@diff < 2
X   \ifnum\@y@diff < 2 \num@segments=\@x@diff \advance\num@segments \@y@diff
X		      \sqrt@donetrue
X        \else\num@segments=\@y@diff \sqrt@donetrue\fi
X   \else\ifnum\@y@diff < 2 \num@segments=\@x@diff \sqrt@donetrue\fi
X\fi
X\ifsqrt@done \ifnum\num@segments=\z@ \num@segments=\@ne\fi\relax
X \else \ifnum\@y@diff >\@x@diff
X		 \@tempcnta=\@x@diff \@x@diff=\@y@diff \@y@diff=\@tempcnta
X       \fi    		%exchange @x@diff & @y@diff, so now @x@diff > @y@diff
X  \num@segments=\@y@diff
X  \multiply\num@segments \num@segments
X  \multiply\num@segments by 457
X  \divide\num@segments \@x@diff
X  \advance\num@segments by 750 % for round-off, going to divide by 1000.
X  \divide\num@segments \@m
X  \advance\num@segments \@x@diff
X		%num@segments = @x@diff + (0.457*sqr(@y@diff)/@x@diff)
X\fi}
X%----------------------------------------------------------------------
X% \dottedline[opt. char]{interdot gap in units}(x1,y1)(x2,y2)....(xN,yN)
X%----------------------------------------------------------------------
X%% Used the following construction earlier but that results in box memory
X%% full much too soon although it works perfectly.
X%% \setbox\@dotbox\vbox to\z@{\vss \hbox to\z@{\hss #1\hss}\vss}\relax}
X%% The cenetering of characters is achieved by substracting half the ht, wd
X%% of character from the (x,y) coordinates where they are to be put. We
X%% chose to use a macro for the ``dot'' instead of \copy\box to save memory
X%% at the expense of extra cpu, since memory becomes an issue very soon.
X%% \picsquare is already centered, whereas other characters, except \circle,
X%% will not be cenetered, hence to handle them all in a similar fashion,
X%% used \picsquare@bl.
X%
X% kind of tail recursion.
X\def\dottedline{\@ifnextchar [{\@idottedline}{\@idottedline[\picsquare@bl]}}
X\def\@idottedline[#1]#2(#3,#4){\@ifnextchar (%
X{\@iidottedline[#1]{#2}(#3,#4)}{\relax}}
X\def\@iidottedline[#1]#2(#3,#4)(#5,#6){\@dottedline[#1]{#2\unitlength}%
X(#3\unitlength,#4\unitlength)(#5\unitlength,#6\unitlength)%
X\@idottedline[#1]{#2}(#5,#6)}
X%
X%% user not supposed to use this directly. arguments in absolute dimensions.
X%% need to pass absolute dimens here because dashline calls dottedline and
X%% can supply only absolute dimensions.
X\long\def\@dottedline[#1]#2(#3,#4)(#5,#6){{%
X\x@diff=#5\relax\advance\x@diff by -#3\relax
X\y@diff=#6\relax\advance\y@diff by -#4\relax
X\sqrtandstuff{\x@diff}{\y@diff}{#2}
X\divide\x@diff \num@segments
X\divide\y@diff \num@segments
X\advance\num@segments \@ne     % to put the last point at destination.
X%%\typeout{num@segments= \the\num@segments}
X\setbox\@dotbox\hbox{#1}% just to get the dimensions of the character.
X\@xdim=#3 \@ydim=#4
X\ifdim\ht\@dotbox >\z@% otherwise its a circle.
X  \advance\@xdim -0.5\wd\@dotbox
X  \advance\@ydim -0.5\ht\@dotbox
X  \advance\@ydim .5\dp\@dotbox\fi
X%%circle's have a ht=0, this is one way I could think of to catch circles.
X%%following loop is equiv to
X%%\multiput(\@xdim,\@ydim)(\x@diff,\y@diff){\num@segments}{#1}
X%%with arguments in absolute dimensions.
X\@killglue
X\loop \ifnum\num@segments > 0
X\unskip\raise\@ydim\hbox to\z@{\hskip\@xdim #1\hss}%
X\advance\num@segments \m@ne\advance\@xdim\x@diff\advance\@ydim\y@diff%
X\repeat
X\ignorespaces}}
X%----------------------------------------------------------------------
X% \dashline[#]{dash-length}[optional dotgap](x1,y1)(x2,y2)...(xN,yN)
X% The minimum # of dashes put is 2, one at either end point; dash-length is
X% reduced accordingly if necessary. Also have to some dirty work to account
X% for stretch & shrink.
X% \renewcommand{\dashlinestretch}{-50}  %ONLY INTEGERS PERMITTED.
X%----------------------------------------------------------------------
X\def\dashlinestretch{0} %well, could have used a counter.
X\def\dashline{\@ifnextchar [{\@idashline}{\@idashline[\dashlinestretch]}}
X\def\@idashline[#1]#2{\@ifnextchar [{\@iidashline[#1]{#2}}%
X{\@iidashline[#1]{#2}[\@empty]}} %\@empty needed-- later checked with \ifx 
X\def\@iidashline[#1]#2[#3](#4,#5){\@ifnextchar (%
X{\@iiidashline[#1]{#2}[#3](#4,#5)}{\relax}}
X%
X\def\@iiidashline[#1]#2[#3](#4,#5)(#6,#7){%
X\@dashline[#1]{#2}[#3](#4,#5)(#6,#7)%
X\@iidashline[#1]{#2}[#3](#6,#7)}
X%
X\long\def\@dashline[#1]#2[#3](#4,#5)(#6,#7){{%
X\x@diff=#6\unitlength \advance\x@diff by -#4\unitlength
X\y@diff=#7\unitlength \advance\y@diff by -#5\unitlength
X%% correction to get actual width since the dash-length as taken in arguement
X%% is the center-to-center of the end-points.
X\@tempdima=#2\unitlength \advance\@tempdima -\@wholewidth
X\sqrtandstuff{\x@diff}{\y@diff}{\@tempdima}
X\ifnum\num@segments <3 \num@segments=3\fi% min number of dashes I can plot
X% is 2, 1 at either end, thus min num@segments is 3 (including 'empty dash').
X\@tempdima=\x@diff \@tempdimb=\y@diff
X\divide\@tempdimb by\num@segments
X\divide\@tempdima by\num@segments
X%% ugly if-then-else. If optional dotgap specified, then use it otherwise
X%% make a solid looking dash.
X{\ifx#3\@empty \relax
X    \ifdim\@tempdima < 0pt \x@diff=-\@tempdima\else\x@diff=\@tempdima\fi
X    \ifdim\@tempdimb < 0pt \y@diff=-\@tempdimb\else\y@diff=\@tempdimb\fi
X    \ifdim\x@diff < 0.3pt %it's a vertical dashline
X           \ifdim\@tempdimb > 0pt
X	        \global\setbox\@dotbox\hbox{\hskip -\@halfwidth \vrule
X		 \@width \@wholewidth \@height \@tempdimb}
X	   \else\global\setbox\@dotbox\hbox{\hskip -\@halfwidth \vrule
X		 \@width \@wholewidth \@height\z@ \@depth -\@tempdimb}\fi
X       \else\ifdim\y@diff < 0.3pt %it's a horizontal dashline
X               \ifdim\@tempdima >0pt
X		  \global\setbox\@dotbox\hbox{\vrule \@height \@halfwidth
X		 		\@depth \@halfwidth \@width \@tempdima}
X		\else\global\setbox\@dotbox\hbox{\hskip \@tempdima
X			 \vrule \@height \@halfwidth \@depth \@halfwidth
X				 \@width -\@tempdima \hskip \@tempdima}\fi
X	    \else\global\setbox\@dotbox\hbox{%
X\@dottedline[\picsquare]{0.98\@wholewidth}(0pt,0pt)(\@tempdima,\@tempdimb)}
X\fi\fi
X\else\global\setbox\@dotbox\hbox{%
X\@dottedline[\picsquare]{#3\unitlength}(0pt,0pt)(\@tempdima,\@tempdimb)}
X\fi}
X\advance\x@diff by -\@tempdima % both have same sign
X\advance\y@diff by -\@tempdimb
X%
X%%here we correct the number of dashes to be put by reducing them
X%%appropriately. (num@segments*\@wholewidth) is in some way the slack we
X%%have,and division by dash-length gives the reduction. reduction =
X%%(2*num@segments*\@wholewidth)/dash-length
X%% (num@segments includes empty ones)
X\@tempdima=\num@segments\@wholewidth \@tempdima=2\@tempdima 
X\@tempcnta=\@tempdima \@tempdima=#2\unitlength \@tempdimb=0.5\@tempdima
X\@tempcntb=\@tempdimb \advance\@tempcnta by \@tempcntb % round-off error
X\divide\@tempcnta by\@tempdima \advance\num@segments by -\@tempcnta
X%
X\ifnum #1=0 \relax\else\ifnum #1 < -100
X  \typeout{***dashline: reduction > -100 percent implies blankness!***}
X\else\num@segmentsi=#1 \advance\num@segmentsi by 100
X     \multiply\num@segments by\num@segmentsi \divide\num@segments by 100
X\fi\fi
X%
X\divide\num@segments by 2 % earlier num@segments included 'empty dashes' too.
X\ifnum\num@segments >0 % if =0 then don't divide => \x@diff & \y@diff
X \divide\x@diff by\num@segments%   remain same.
X \divide\y@diff by\num@segments
X \advance\num@segments by\@ne %for the last segment for which I subtracted
X	 		     %\@tempdima & \@tempdimb from \x@diff & \y@diff
X \else\num@segments=2 % one at each end.
X\fi
X%%\typeout{num@segments finally = \the\num@segments}
X%% equiv to \multiput(#4,#5)(\x@diff,\y@diff){\num@segments}{\copy\@dotbox}
X%% with arguements in absolute dimensions.
X\@xdim=#4\unitlength \@ydim=#5\unitlength
X\@killglue
X\loop \ifnum\num@segments > 0
X\unskip\raise\@ydim\hbox to\z@{\hskip\@xdim \copy\@dotbox\hss}%
X\advance\num@segments \m@ne\advance\@xdim\x@diff\advance\@ydim\y@diff%
X\repeat
X\ignorespaces}}
X%----------------------------------------------------------------------
X%%1.00   .833333  .80  .75  .66666   .60  .50  .40  .33333    .25 .20  .16666
X%% .916666 .816666 .775 .708333 .633333 .55 .45 .366666 .291666 .225 .183333
X%% 0.0
X%%0.083333
X%% the first line has absolute slopes corresponding to various permissible
X%% integer combinations representing slopes. The second line is the midpoint
X%% of all those slopes (attempted to show them in the middle of two entries).
X%%
X%% \lineslope(x@diff dimen, y@diff dimen)
X%% Given base (x@diff) and height (y@diff) in dimensions, determines the
X%% closest available slope and returns the two required integers in \@xarg
X%% and \@yarg. The given base and height can be ANYTHING, -ve or +ve, or
X%% even 0pt. \lineslope knows about (0,1) and (1,0) slopes too and returns
X%% correct values if the conditions regarding x@diff & y@diff are obeyed
X%% (see NOTE). Used by \drawline. This is the simplest and only way I could
X%% figure out to accomplish it!.
X%% NOTE: both the dimensions (x@diff & y@diff) must be in SAME units and the
X%% larger of the two dimensions must be atleast 1pt (i.e. 65536sp). To avoid
X%% dividing by 0, I make the larger dimension = 1pt if it is < 1pt.
X%% will need a similar one for vectors, or maybe this can be used. For
X%% vectors the range is -4, 4 unlike lines where it is -6, 6.
X\newif\if@flippedargs
X\def\lineslope(#1,#2){%
X\ifdim #1 <0pt \@xdim= -#1 \else\@xdim=#1\fi
X\ifdim #2 <0pt \@ydim= -#2 \else\@ydim=#2\fi
X%%\typeout{xdim,ydim= \the\@xdim, \the\@ydim}
X\ifdim\@xdim >\@ydim \@tempdima=\@xdim \@xdim=\@ydim \@ydim=\@tempdima
X\@flippedargstrue\else\@flippedargsfalse\fi% x < y
X\ifdim\@ydim >1pt \@tempcnta=\@ydim
X            \divide\@tempcnta by 65536% now \@tempcnta=integral part of #1.
X            \divide\@xdim \@tempcnta\fi
X\ifdim\@xdim <.083333pt \@xarg=1 \@yarg=0
X \else\ifdim\@xdim <.183333pt	\@xarg=6 \@yarg=1
X \else\ifdim\@xdim <.225pt 	\@xarg=5 \@yarg=1
X \else\ifdim\@xdim <.291666pt 	\@xarg=4 \@yarg=1
X \else\ifdim\@xdim <.366666pt 	\@xarg=3 \@yarg=1
X \else\ifdim\@xdim <.45pt 	\@xarg=5 \@yarg=2
X \else\ifdim\@xdim <.55pt 	\@xarg=2 \@yarg=1
X \else\ifdim\@xdim <.633333pt 	\@xarg=5 \@yarg=3
X \else\ifdim\@xdim <.708333pt 	\@xarg=3 \@yarg=2
X \else\ifdim\@xdim <.775pt 	\@xarg=4 \@yarg=3
X \else\ifdim\@xdim <.816666pt 	\@xarg=5 \@yarg=4
X \else\ifdim\@xdim <.916666pt 	\@xarg=6 \@yarg=5
X       \else			\@xarg=1 \@yarg=1%
X\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
X\if@flippedargs\relax\else\@tempcnta=\@xarg \@xarg=\@yarg
X			  \@yarg=\@tempcnta\fi
X\ifdim #1 <0pt \@xarg= -\@xarg\fi
X\ifdim #2 <0pt \@yarg= -\@yarg\fi
X%%\typeout{closest slope integers = \the\@xarg, \the\@yarg}
X}
X%----------------------------------------------------------------------
X% usage: \drawline[#](x1,y1)(x2,y2)....(xN,yN)
X%       		 % # is an optional integer between -100 & infinity.
X% \renewcommand{\drawlinestretch}{-50}  %ONLY INTEGERS PERMITTED.
X%----------------------------------------------------------------------
X\newif\if@toosmall
X\newif\if@drawit
X\newif\if@horvline
X\def\drawlinestretch{0} %well, could have used a counter.
X% kind of tail recursion.
X\def\drawline{\@ifnextchar [{\@idrawline}{\@idrawline[\drawlinestretch]}}
X\def\@idrawline[#1](#2,#3){\@ifnextchar ({\@iidrawline[#1](#2,#3)}{\relax}}
X\def\@iidrawline[#1](#2,#3)(#4,#5){\@drawline[#1](#2,#3)(#4,#5)
X\@idrawline[#1](#4,#5)}
X%
X\def\@drawline[#1](#2,#3)(#4,#5){{%
X\x@diff=#4\unitlength \advance\x@diff by -#2\unitlength
X\y@diff=#5\unitlength \advance\y@diff by -#3\unitlength
X%% override any linethickness declarations, and since horiz & vertical lines
X%% come out thinner than the slanted ones, assign slightly larger values.
X%% default values are: thinlines=0.4pt, thicklines=0.8pt
X\ifx\@linefnt\tenln \linethickness{0.5pt} \else \linethickness{0.9pt}\fi
X\lineslope(\x@diff,\y@diff)% returns the two integers in \@xarg & \@yarg.
X%------
X\@toosmalltrue
X{\ifdim\x@diff <\z@ \x@diff=-\x@diff\fi
X \ifdim\y@diff <\z@ \y@diff=-\y@diff\fi
X \ifdim\x@diff >10pt \global\@toosmallfalse\fi
X \ifdim\y@diff >10pt \global\@toosmallfalse\fi}
X%------
X%% For efficiency, if the line is horiz or vertical then we draw it in one
X%% shot, only if the stretch is not -ve and the line is not too small.
X\@drawitfalse\@horvlinefalse
X\ifnum#1 <0 \relax\else\@horvlinetrue\fi
X\if@toosmall\@horvlinetrue\fi% to get 'or' condition. We necessarily draw a 
X% solid line if the line is too small ignoring any -ve stretch.
X\if@horvline
X \ifdim\x@diff =0pt \put(#2,#3){\ifdim\y@diff >0pt \@linelen=\y@diff \@upline
X 				\else\@linelen=-\y@diff \@downline\fi}%
X \else\ifdim\y@diff =0pt
X          \ifdim\x@diff >0pt \put(#2,#3){\vrule \@height \@halfwidth \@depth
X				\@halfwidth \@width \x@diff}
X		\else \put(#4,#5){\vrule \@height \@halfwidth \@depth
X				\@halfwidth \@width -\x@diff}\fi
X       \else\@drawittrue\fi\fi % construct the line explicitly
X\else\@drawittrue\fi
X%-------------------------------
X\if@drawit
X\ifnum\@xarg< 0 \@negargtrue\else\@negargfalse\fi
X\ifnum\@xarg =0 \setbox\@linechar%
X\hbox{\hskip -\@halfwidth \vrule \@width \@wholewidth \@height 10.2pt
X \@depth \z@}
X\else \ifnum\@yarg =0 \setbox\@linechar%
X\hbox{\vrule \@height \@halfwidth \@depth \@halfwidth \@width 10.2pt}
X\else \if@negarg \@xarg -\@xarg \@yyarg -\@yarg
X        \else \@yyarg \@yarg\fi
X\ifnum\@yyarg >0 \@tempcnta\@yyarg \else \@tempcnta -\@yyarg\fi
X\setbox\@linechar\hbox{\@linefnt\@getlinechar(\@xarg,\@yyarg)}%
X\fi\fi
X%------
X\if@toosmall% => it isn't a horiz or vert line and is toosmall.
X  \@dottedline[\picsquare]{.98\@wholewidth}%
X(#2\unitlength,#3\unitlength)(#4\unitlength,#5\unitlength)%
X\else
X%% following is neat. The last segment takes \wd\@linechar & \ht\@linechar
X%% so plot the line as though it were from (#2,#3) to
X%% (#4-\wd\@linechar,#5-\ht\@linechar) (i.e. for positive slope; of course,
X%% signs are reversed for other slopes). For horizontal & vertical dashes we
X%% don't have to subtract the ht & wd resp. since they are already centered.
X\ifnum\@xarg=0\relax\else\ifdim\x@diff >\z@ \advance\x@diff -\wd\@linechar
X  \else\advance\x@diff \wd\@linechar\fi\fi
X\ifnum\@yarg=0\relax\else\ifdim\y@diff >\z@\advance\y@diff -\ht\@linechar
X  \else\advance\y@diff \ht\@linechar\fi\fi
X\ifdim\x@diff <\z@ \@x@diff=-\x@diff \else\@x@diff=\x@diff\fi
X\ifdim\y@diff <\z@ \@y@diff=-\y@diff \else\@y@diff=\y@diff\fi
X%%\typeout{x@diff,y@diff=\the\x@diff , \the\y@diff}
X\num@segments=0 \num@segmentsi=0
X\ifdim\wd\@linechar >1pt
X \num@segmentsi=\@x@diff \divide\num@segmentsi \wd\@linechar\fi
X\ifdim\ht\@linechar >1pt
X \num@segments=\@y@diff \divide\num@segments \ht\@linechar\fi
X\ifnum\num@segmentsi >\num@segments \num@segments=\num@segmentsi\fi
X\advance\num@segments \@ne %to account for round-off error
X%
X\ifnum #1=0 \relax \else\ifnum #1 < -99
X  \typeout{***drawline: reduction <= -100 percent implies blankness!***}
X\else\num@segmentsi=#1 \advance\num@segmentsi by 100
X     \multiply\num@segments \num@segmentsi
X     \divide\num@segments by 100
X\fi\fi
X%%\typeout{num@segments after = \the\num@segments}
X%
X\divide\x@diff \num@segments
X\divide\y@diff \num@segments
X\advance\num@segments \@ne %for the last segment for which I subtracted
X			  %\wd & \ht of \@linechar from \@x@diff & \@y@diff.
X%%\typeout{numseg,x@diff,y@diff= \the\num@segments, \the\x@diff, \the\y@diff}
X%
X\@xdim=#2\unitlength \@ydim=#3\unitlength
X\if@negarg \advance\@xdim -\wd\@linechar\fi
X\ifnum\@yarg <0 \advance\@ydim -\ht\@linechar\fi
X%%following loop equiv to \multiput@abs(\@xdim,\@ydim)%
X%%(\x@diff,\y@diff){\num@segments}{\copy\@linechar}
X%%with arguements in absolute dimensions.
X\@killglue
X\loop \ifnum\num@segments > 0
X\unskip\raise\@ydim\hbox to\z@{\hskip\@xdim \copy\@linechar\hss}%
X\advance\num@segments \m@ne\advance\@xdim\x@diff\advance\@ydim\y@diff%
X\repeat
X\ignorespaces
X\fi%the if of @toosmall
X\fi}}% for \if@drawit
X%----------------------------------------------------------------------
X%usage: \putfile{datafile}{OBJECT}
X% The OBJECT is plotted at EACH of the coordinates read from the datafile.
X% The idea of these macros is to generate (x,y) pairs using some program
X% and then directly use those coordinates. Since TeX doesn't have real
X% floating point calculations, it is much more efficient and accurate to do
X% things this way. One can also use the unix facility 'spline' now to
X% generate smooth curves with equidistant ``dots''.
X% NOTE: the external file of coordinates must have x y pairs with a space
X% between them. Also it is suggested that some extension such as '.put'
X% be used for such datafiles to distinguish them in which case it must
X% be explicitely specified in the 1st argument so that TeX doesn't look
X% for a .tex extension.
X% The % char remains valid as a comment char and such lines are ignored;
X% however, there should be atleast one space after the second entry if a
X% comment is on the same line as data since % eats up the newline.
X%-----------------------------------------------------------------------
X\long\def\splittwoargs#1 #2 {(#1,#2)}
X%
X\newif\if@stillmore
X\newread\@datafile
X\long\def\putfile#1#2{\openin\@datafile = #1
X\@stillmoretrue
X\loop
X\ifeof\@datafile\relax\else\read\@datafile to\@dataline\fi
X%if file nonexistent, do nothing.
X\ifeof\@datafile\@stillmorefalse
X\else\ifx\@dataline\@empty \relax
X     \else
X\expandafter\expandafter\expandafter\put\expandafter\splittwoargs%
X\@dataline{#2}
X     \fi
X\fi
X\if@stillmore
X\repeat
X\closein\@datafile
X}
X%----------------------------------------------------------------------
X\makeatother
SHAR_EOF
fi # end of overwriting check
#	End of shell archive
exit 0

isaac@goanna.oz (Isaac Balbin) (08/26/88)

[I have tried sending mail to kwoc@iris.ucdavis.edu but get user unknown ...]

Anyway, I would like a beta of fig2epic if possible. Difficult to ftp from
down under you see ... I can redistribute in Australia if you like ...
			Thanks. Isaac Balbin.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Isaac Balbin			  
Department of Computer Science,	  ACSnet: isaac@goanna.cs.rmit.oz.au
RMIT,
GPO BOX 2476 V,                   ARPA:isaac%goanna.cs.rmit.oz.au@uunet.uu.net
Melbourne, 3001 		  CSNET: isaac%goanna.cs.rmit.oz.au@australia
AUSTRALIA                         UUCP: ...!uunet!goanna.cs.rmit.oz.au!isaac