diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/eepic |
Initial commit
Diffstat (limited to 'macros/latex/contrib/eepic')
-rw-r--r-- | macros/latex/contrib/eepic/README | 119 | ||||
-rw-r--r-- | macros/latex/contrib/eepic/eepic.pdf | bin | 0 -> 97460 bytes | |||
-rw-r--r-- | macros/latex/contrib/eepic/eepic.sty | 477 | ||||
-rw-r--r-- | macros/latex/contrib/eepic/eepic.tex | 605 | ||||
-rw-r--r-- | macros/latex/contrib/eepic/eepicemu.sty | 94 | ||||
-rw-r--r-- | macros/latex/contrib/eepic/epic-eg3.fig | 62 | ||||
-rw-r--r-- | macros/latex/contrib/eepic/epic-eg3.tex | 59 | ||||
-rw-r--r-- | macros/latex/contrib/eepic/epic-eg4.fig | 72 | ||||
-rw-r--r-- | macros/latex/contrib/eepic/epic-eg4.tex | 59 | ||||
-rw-r--r-- | macros/latex/contrib/eepic/epic.sty | 561 | ||||
-rw-r--r-- | macros/latex/contrib/eepic/fig2eepic/epic-eg3.fig | 62 | ||||
-rw-r--r-- | macros/latex/contrib/eepic/fig2eepic/epic-eg4.fig | 72 | ||||
-rw-r--r-- | macros/latex/contrib/eepic/fig2eepic/fig2epic.1 | 205 | ||||
-rw-r--r-- | macros/latex/contrib/eepic/fig2eepic/makefile | 35 | ||||
-rw-r--r-- | macros/latex/contrib/eepic/fig2eepic/readme | 28 | ||||
-rw-r--r-- | macros/latex/contrib/eepic/grafig.shar | 535 |
16 files changed, 3045 insertions, 0 deletions
diff --git a/macros/latex/contrib/eepic/README b/macros/latex/contrib/eepic/README new file mode 100644 index 0000000000..2d6c613792 --- /dev/null +++ b/macros/latex/contrib/eepic/README @@ -0,0 +1,119 @@ +EEPIC is a set of TeX macros for LaTeX. It includes several extensions to EPIC +and LaTeX picture drawing environement and provides several new commands. + +------------------------------ +Additions to Version 1.00 +o new commands to draw filled cirlces and ellipsis. +o new command to set line thickness to any width. +o bugs in EEPICEMU.sty are fixed. +------------------------------ + +Extensions to LaTeX and EPIC include: +o drawing of lines in any slopes +o drawing of circles in any radii +o drawing of dotted lines and dash lines in a much faster way and much less + TeX memory + +It also provides new commands for: +o drawing ellipsis +o drawing arcs +o drawing of splines + +Please read the manual for details. + +************IMPORTANT************** + +The standard EEPIC style file generates tpic \special. If your printer does not +support those specials, you have to either change "eepic" in the +\documentstyle command to "eepicemu" or rename "eepicemu.sty" to "eepic.sty" +before formating the manual. "eepicemu.sty" is the emulation package of EEPIC +using EPIC and it does not generate any \special command. However, \arc +command is not supported in the emulation package. Hence, you will get 3 error +messages if you use "eepicemu" to format the manual. Furthermore, the +emulation package uses a lot more TeX memory. If your TeX run out of memory +during the formating of the manual, you can insert \clearpage between example +3 and example 4 to put them on different pages. + +EPIC is an TeX macro package for use with LaTeX. It is written by +Sunil Podar, Dept of Computer Science, SUNY at Stony Brook, NY 11794. +The "epic.sty" file is include in the distribution so that you can format the +manual. I strongly recommend everyone using EEPIC should get a full package of +EPIC. Information on getting EPIC and printer drivers that support tpic +specials are given at the end of this file. + +[ I tried to contact the author to get permission to include "epic.sty" ] +[ in EEPIC distribution but I did not get any reply. I hope this is okay ] + +********MISC*********** +o Any line beginning with "%%" in eepic.sty may be removed for efficiency + + +*******E-MAIL Address******* +% Internet : kwok@iris +% csnet : kwok@ucd.csnet +% csnet : kwok%iris.ucdavis.edu@csnet.relay +% UUCP : ...!ucbvax!ucdavis!iris!kwok + + +--Conrad Kwok + +---------------------------------------------------------------------- +First, thanks to all who have responsed to my question. It seems +to me that not many DVI drivers currently support tpic +specials but a number of people are planning to support tpic +specials in their new DVI drivers. Here is the summary. + +1) "iptex" written by Chris Torek --- This is for imagen printer. +It is included in the UNIX TeX distribution. It is also +available for anonymous ftp from a.cs.uiuc.edu in +pub/TeX/iptex.tar + +2) "texx" written by Dirk Grunwald --- DVI previewers for X11. +It supports most of the tpic specials but not all. It is part of +the iptex package. See 1) above. + +3) "texsun" written by Dirk Grunwald --- DVI previewers for +Sunview window system. It supports most of the tpic specials. It +is also part of the iptex package. See 1) above. + +4) "dvips" written by Tomas Rokicki and tpic special codes are +added by Dorab Patel --- A DVI to Postscript translator. It is +available for anonymous ftp from labrea.stanford.edu. + +5) L. Michael Gray in the University of New Hamsphire said he has +modified dln01 (for DEC LN01S), dvi2ps and xdvi (for X10.4) to +handle tpic specials. He may be reached at lmg%unhcs@RELAY.CS.NET. + +6) "dviis" previewers for Integrated Solutions. I think it is +available on june.cs.washington.edu. + +7) DVI previewers written by Randy Buckland for VMS vaxstations. +The program is written in Ada. The executable is available for +anonymous ftp from argon.rti.org [128.109.139.64]. + +8) There are a number of DVI drivers in science.utah.edu but I +don't know which one support tpic specials and who one don't. + +9) Another "dvips" is available from a.cs.uiuc.edu in +pub/TeX/dvips.tar.Z + +10) quicspool that come with the distribution also supports tpic +specials. + + +Some of the information here come at second hand. Correct me if +any of these are wrong. If you know any DVI drivers that support +tpic specials but they are not list here. Please send me a +message so that I can keep this list up-to-date. + +================================================ +Additions to Version 1.1 +o new commands to do area fill for circles, ellipses, paths and + arcs. +o allows user to define the area fill pattern. It may not work on + all dvi drivers but it is known to work using iptex. +================================================ + +Thanks. + +--Conrad diff --git a/macros/latex/contrib/eepic/eepic.pdf b/macros/latex/contrib/eepic/eepic.pdf Binary files differnew file mode 100644 index 0000000000..da1123cd22 --- /dev/null +++ b/macros/latex/contrib/eepic/eepic.pdf diff --git a/macros/latex/contrib/eepic/eepic.sty b/macros/latex/contrib/eepic/eepic.sty new file mode 100644 index 0000000000..29446873f0 --- /dev/null +++ b/macros/latex/contrib/eepic/eepic.sty @@ -0,0 +1,477 @@ +% eepic Version 1.1e < Dec 21, 1999 > +% Updated by Piet van Oostrum <piet@cs.uu.nl> +% eepic Version 1.1c < Nov 25, 1998 > +% Updated by Piet van Oostrum <piet@cs.uu.nl> +% eepic Version 1.1b < Febrary 7, 1988 > +% Written by Conrad Kwok +% +% Internet : kwok@iris.ucdavis.edu +% csnet : kwok@ucd.csnet +% csnet : kwok%iris.ucdavis.edu@csnet.relay +% UUCP : ...!ucbvax!ucdavis!iris!kwok +% +% The macros are in public domain. +% You may distribute or modify it in any ways you like. +% Please report any bugs, enhancements, comments, suggestions, etc. +% +% This style file modify some of the commands in epic[1] and LaTeX[2] such +% that \special commands will be generated in drawing lines if approriate. +% The \special commands generated is the subset of the \specials used +% by tpic[3]. +% +% [1] epic is written by Sunil Podar. Please read epic.sty for the +% copyright notice. +% [2] LaTeX is written by Leslie Lamport. Please read the book LaTeX +% [3] tpic is modified from pic by Tim Morgan +% +%% This file contains extensions of the following epic commands: +%% \dottedline \dashline \drawline +%% \jput +%% +%% It also contains extensions of the following LaTeX commands: +%% \circle \line \oval +%% +%% New commands include: +%% \Thicklines \arc \ellipse +%% \path \spline \allinethickness +%% +%% New commands for eepic 1.1 +%% \blacken \whiten \shade +%% \texture \filltype{type} type=black|white|shade +%% +%% For documentation, please see the accompanying manual +%% +%% Change Log; +%% o (October 2, 88) +%% Fixed the problem of \line (\@sline). When both x and y are +%% large, it produced 'bad character code' error. +%% +%% o (January 17, 89) +%% Add commands \blacken, \whiten, \shade, \texture +%% +%% o (January 17, 89) +%% Add \filltype{xxxxx} +%% xxxxx - black, white, shade +%% +\typeout{% +Extension to Epic and LaTeX. Version 1.1e - Released Dec 21, 1999} +% +\newcount\@gphlinewidth +\newcount\@eepictcnt +\newdimen\@tempdimc +\@gphlinewidth\@wholewidth \divide\@gphlinewidth 4736 + +%% Redefine \thinlines, \thicklines +%% See also latex.tex +\def\thinlines{\let\@linefnt\tenln \let\@circlefnt\tencirc + \@wholewidth\fontdimen8\tenln \@halfwidth .5\@wholewidth + \@gphlinewidth\@wholewidth \divide\@gphlinewidth 4736\relax} +\def\thicklines{\let\@linefnt\tenlnw \let\@circlefnt\tencircw + \@wholewidth\fontdimen8\tenlnw \@halfwidth .5\@wholewidth + \@gphlinewidth\@wholewidth \divide\@gphlinewidth 4736 + \advance\@gphlinewidth\@ne % Make the output looks better + \relax} +%% +%% To indicate whether the dot character is defined in the dotted join +%% environment or not (\@ifnodotdef) +\newif\if@nodotdef \global\@nodotdeftrue +%% +%% Redefine \dottedjoin +\def\dottedjoin{\global\@jointhemtrue \global\@joinkind=0\relax + \bgroup\@ifnextchar[{\global\@nodotdeffalse\@idottedjoin}% + {\global\@nodotdeftrue\@idottedjoin[\@empty]}} +%%---------------------------------------------------------------------- +%% Redefine \jput +\long\def\jput(#1,#2)#3{\@killglue\raise#2\unitlength\hbox to \z@{\hskip +#1\unitlength #3\hss}% +\if@jointhem \if@firstpoint \gdef\x@one{#1} \gdef\y@one{#2} \global\@firstpointfalse + \else\ifcase\@joinkind + \if@nodotdef + \@spdottedline{\dotgap@join\unitlength}% +(\x@one\unitlength ,\y@one\unitlength)(#1\unitlength,#2\unitlength) + \else + \@dottedline[\dotchar@join]{\dotgap@join\unitlength}% +(\x@one\unitlength,\y@one\unitlength)(#1\unitlength,#2\unitlength) + \fi + \or\@dashline[\dashlinestretch]{\dashlen@join\unitlength}[\dotgap@join]% +(\x@one,\y@one)(#1,#2) + \else\@drawline[\drawlinestretch](\x@one,\y@one)(#1,#2)\fi + \gdef\x@one{#1}\gdef\y@one{#2}% + \fi +\fi\ignorespaces} +%% +%% Redefine \dottedline to generate special whenever possible. +\def\dottedline{\@ifnextchar [{\@idottedline}{\@ispdottedline}} +%% Similar to \@idottedline but it generate \special +\def\@ispdottedline#1(#2,#3){\@ifnextchar (% +{\@iispdottedline{#1}(#2,#3)}{\relax}} +\def\@iispdottedline#1(#2,#3)(#4,#5){\@spdottedline{#1\unitlength}% +(#2\unitlength,#3\unitlength)(#4\unitlength,#5\unitlength)% +\@ispdottedline{#1}(#4,#5)} +% +\def\@spdottedline#1(#2,#3)(#4,#5){% + \@killglue % This line added by Piet van Oostrum, Dec 21, 1999. + \@tempcnta \@gphlinewidth\relax + \advance\@tempcnta by 2 % solely for better output + \special{pn \the\@tempcnta}% + \@tempdimc=#2\relax + \@tempcnta \@tempdimc\relax \advance\@tempcnta 2368 \divide\@tempcnta 4736 + \@tempdimc=#3\relax + \@tempcntb -\@tempdimc\relax\advance\@tempcntb -2368 \divide\@tempcntb 4736 + \@paspecial{\the\@tempcnta}{\the\@tempcntb}% + \@tempdimc=#4\relax + \@tempcnta \@tempdimc\relax \advance\@tempcnta 2368 \divide\@tempcnta 4736 + \@tempdimc=#5\relax + \@tempcntb -\@tempdimc\relax\advance\@tempcntb -2368 \divide\@tempcntb 4736 + \@paspecial{\the\@tempcnta}{\the\@tempcntb}% + \@tempdimc=#1\relax +%% +%% Generate the pen width in terms of inch with 3 decimal digit. + \@tempcnta \@tempdimc\relax \advance\@tempcnta 2368 \divide\@tempcnta 4736 +%% \@tempcnta contain the pen width in terms of thousandth of a inch +%% Then it is converted back to inch. I know the way I use is dumb but +%% I cannot think of any better method + \@tempcntb \@tempcnta\relax \divide\@tempcntb 1000 + \multiply \@tempcntb 1000 \advance\@tempcnta -\@tempcntb + \divide\@tempcntb 1000 + \ifnum\@tempcnta < 10 + \special{dt \the\@tempcntb.00\the\@tempcnta}% + \else\ifnum\@tempcnta < 100 + \special{dt \the\@tempcntb.0\the\@tempcnta}% + \else + \special{dt \the\@tempcntb.\the\@tempcnta}% + \fi\fi + \ignorespaces +} +% +\def\@iiidashline[#1]#2[#3](#4,#5)(#6,#7){% +\@dashline[#1]{#2\unitlength}[#3](#4,#5)(#6,#7)% +\@iidashline[#1]{#2}[#3](#6,#7)} +% +%% Redefine \@dashline +\long\def\@dashline[#1]#2[#3](#4,#5)(#6,#7){{% +\x@diff=#6\unitlength \advance\x@diff by -#4\unitlength +\y@diff=#7\unitlength \advance\y@diff by -#5\unitlength +%% correction to get actual width since the dash-length as taken in arguement +%% is the center-to-center of the end-points. +\@tempdima=#2\relax \advance\@tempdima -\@wholewidth +\sqrtandstuff{\x@diff}{\y@diff}{\@tempdima}% +\ifnum\num@segments <3 \num@segments=3\fi% min number of dashes I can plot +% is 2, 1 at either end, thus min num@segments is 3 (including 'empty dash'). +\@tempdima=\x@diff \@tempdimb=\y@diff +\divide\@tempdimb by\num@segments +\divide\@tempdima by\num@segments +%% ugly if-then-else. If optional dotgap specified, then use it otherwise +%% make a solid dash. +{\ifx#3\@empty \relax + \ifdim\@tempdima < 0pt \x@diff=-\@tempdima\else\x@diff=\@tempdima\fi + \ifdim\@tempdimb < 0pt \y@diff=-\@tempdimb\else\y@diff=\@tempdimb\fi + \global\setbox\@dotbox\hbox{% + \@absspdrawline(0pt,0pt)(\@tempdima,\@tempdimb)}% + \else\global\setbox\@dotbox\hbox{% + \@spdottedline{#3\unitlength}(0pt,0pt)(\@tempdima,\@tempdimb)}% + \fi}% +\advance\x@diff by -\@tempdima % both have same sign +\advance\y@diff by -\@tempdimb +% +%%here we correct the number of dashes to be put by reducing them +%%appropriately. (num@segments*\@wholewidth) is in some way the slack we +%%have,and division by dash-length gives the reduction. reduction = +%%(2*num@segments*\@wholewidth)/dash-length +%% (num@segments includes empty ones) +\@tempdima=\num@segments\@wholewidth \@tempdima=2\@tempdima +\@tempcnta\@tempdima\relax \@tempdima=#2\relax \@tempdimb=0.5\@tempdima +\@tempcntb\@tempdimb\relax \advance\@tempcnta by \@tempcntb % round-off error +\divide\@tempcnta by\@tempdima \advance\num@segments by -\@tempcnta +% +\ifnum #1=0 \relax\else\ifnum #1 < -100 + \typeout{***dashline: reduction > -100 percent implies blankness!***} +\else\num@segmentsi=#1 \advance\num@segmentsi by 100 + \multiply\num@segments by\num@segmentsi \divide\num@segments by 100 +\fi\fi +% +\divide\num@segments by 2 % earlier num@segments included 'empty dashes' too. +\ifnum\num@segments >0 % if =0 then don't divide => \x@diff & \y@diff + \divide\x@diff by\num@segments% remain same. + \divide\y@diff by\num@segments + \advance\num@segments by\@ne %for the last segment for which I subtracted + %\@tempdima & \@tempdimb from \x@diff & \y@diff + \else\num@segments=2 % one at each end. +\fi +%%\typeout{num@segments finally = \the\num@segments} +%% equiv to \multiput(#4,#5)(\x@diff,\y@diff){\num@segments}{\copy\@dotbox} +%% with arguements in absolute dimensions. +\@xdim=#4\unitlength \@ydim=#5\unitlength +\@killglue +\loop \ifnum\num@segments > 0 +\unskip\raise\@ydim\hbox to\z@{\hskip\@xdim \copy\@dotbox\hss}% +\advance\num@segments \m@ne\advance\@xdim\x@diff\advance\@ydim\y@diff% +\repeat}% +\ignorespaces} +%% redefine \@drawline +% +\def\@drawline[#1](#2,#3)(#4,#5){{% +\@drawitfalse\@horvlinefalse +\ifnum#1 <0 \relax\else\@horvlinetrue\fi +\if@horvline + \@spdrawline(#2,#3)(#4,#5) +\else\@drawittrue\fi +%%------------------------------- +\if@drawit +\ifnum #1=0 \relax \else\ifnum #1 < -99 + \typeout{***drawline: reduction <= -100 percent implies blankness!***}% +\else\num@segmentsi=#1 \advance\num@segmentsi by 50 + \multiply\num@segmentsi 2 +\fi\fi +\@dashline[\num@segmentsi]{10pt}[\@empty](#2,#3)(#4,#5) +\fi}\ignorespaces}% for \if@drawit +% +\def\@spdrawline(#1,#2)(#3,#4){% + \@absspdrawline(#1\unitlength,#2\unitlength)(#3\unitlength,#4\unitlength) + \ignorespaces +} +\def\@absspdrawline(#1,#2)(#3,#4){% + \@killglue % This line added by Piet van Oostrum, Dec 21, 1999. + \special{pn \the\@gphlinewidth}% + \@tempdimc=#1\relax + \@tempcnta \@tempdimc\relax \advance\@tempcnta 2368 \divide\@tempcnta 4736 + \@tempdimc=#2\relax + \@tempcntb -\@tempdimc\relax \advance\@tempcntb -2368 \divide\@tempcntb 4736 + \@paspecial{\the\@tempcnta}{\the\@tempcntb}% + \@tempdimc=#3\relax + \@tempcnta\@tempdimc\relax \advance\@tempcnta 2368 \divide\@tempcnta 4736 + \@tempdimc=#4\relax + \@tempcntb -\@tempdimc\relax \advance\@tempcntb -2368 \divide\@tempcntb 4736 + \@paspecial{\the\@tempcnta}{\the\@tempcntb}% + \special{fp}% + \ignorespaces +} +%%---------------------------------------------------------------------- +\def\@paspecial#1#2{% + \special{pa #1 #2}% +} +%% +%% Functions below modify the LaTeX commands and some additional commands +%% are not supported by LaTeX nor epic such as ThickLines and arc. +%% +%% The macros are for use with LaTeX picture environment +%% By including the macro file, you can draw +%% 1) \line in any slope +%% 2) \circle with any radius +%% 3) \ellipse with any x-axis and y-axis length +%% 4) Circular \arc by giving starting and ending angle (in radius) +%% +%% Furthermore you may draw lines in any thickness. +%% +%% +%% Redefine \thinlines, \thicklines and define \Thickline +%% See also latex.tex +\def\Thicklines{\let\@linefnt\tenlnw \let\@circlefnt\tencircw + \@wholewidth\fontdimen8\tenlnw \@wholewidth 1.5\@wholewidth + \@halfwidth .5\@wholewidth + \@gphlinewidth\@wholewidth \divide\@gphlinewidth 4736\relax} +%% +%% Generate the \special command for drawing arc +\def\@circlespecial#1#2#3#4{% + \special{pn \the\@gphlinewidth}% + \special{ar 0 0 #1 #2 #3 #4} +} +%% +%% Command for drawing an arc. Elliptical arc command can be generated +%% but all iptex program I saw so far does not support that. +\def\@arc#1#2#3#4{% +%% convert TeX dimension to length in terms thousandth of an inch + \@tempdima #1\unitlength + \@tempdimb #2\unitlength + \@tempcnta\@tempdima \advance\@tempcnta 4736 \divide\@tempcnta 9473 + \@tempcntb\@tempdimb \advance\@tempcntb 4736 \divide\@tempcntb 9473 + \setbox\@tempboxa\hbox{% + \@circlespecial{\the\@tempcnta}{\the\@tempcntb}{#3}{#4}}% + \wd\@tempboxa\z@ \box\@tempboxa} +%% +%% Command for drawing Circle and Ellipse in terms of \@arc +%% replace original \circle +\def\circle{% + \@ifstar{\copy\@filltype\@circle}{\@circle}} +\def\@circle#1{\@arc{#1}{#1}{0}{6.2832}} +\def\ellipse{% + \@ifstar{\copy\@filltype\@ellipse}{\@ellipse}} +\def\@ellipse#1#2{{\@arc{#1}{#2}{0}{6.2832}}} +\def\arc#1#2#3{\@arc{#1}{#1}{#2}{#3}} +%% +%% Generate \special commands for drawing line +\def\@linespecial#1#2{% + \special{pn \the\@gphlinewidth}% + \special{pa 0 0}% + \special{pa #1 #2}% + \special{fp}% +} +%% Replace original \line. Only change is to call \@ssline instead +%% of \@sline. For description, see latex.tex +\def\line(#1,#2)#3{\@xarg #1\relax \@yarg #2\relax +\@linelen=#3\unitlength +\ifnum\@xarg =0 \@vline + \else \ifnum\@yarg =0 \@hline \else \@ssline\fi +\fi} +%% +\def\@ssline{% + \ifnum\@xarg< 0 + \@negargtrue \@xarg -\@xarg \@tempdima -\@linelen + \else + \@negargfalse \@tempdima\@linelen + \fi +%% truncation is used in arithmetic + \@tempcnta\@linelen \divide\@tempcnta 4736 + \@yyarg -\@yarg \multiply\@yyarg \@tempcnta \divide\@yyarg\@xarg + \if@negarg + \@tempcnta -\@tempcnta + \fi + \setbox\@linechar\hbox{\@linespecial{\the\@tempcnta}{\the\@yyarg}}% + \wd\@linechar\@tempdima + \@clnht\@linelen + \multiply\@clnht\@yarg + \divide\@clnht\@xarg + \ifnum\@yarg< 0 + \@clnht -\@clnht + \ht\@linechar\z@ \dp\@linechar\@clnht + \else + \ht\@linechar\@clnht \dp\@linechar\z@ + \fi + \box\@linechar +} +%% +%% Replace original \@sline +\def\@sline{% + \@ssline +%% Codes below (till end of the command) is only necessary +%% when used with \@svector + \if@negarg + \@yyarg -\@yarg + \else + \@yyarg \@yarg + \fi + \setbox\@linechar\hbox{\@linefnt\@getlinechar(\@xarg,\@yyarg)}% + \ifnum\@yarg> 0 + \let\@upordown\raise + \advance\@clnht -\ht\@linechar + \else + \let\@upordown\lower + \fi + \if@negarg \kern\wd\@linechar \fi +} +%% +\def\spline(#1,#2){% + \@killglue % This line added by Piet van Oostrum, Dec 21, 1999. + \special{pn \the\@gphlinewidth}% + \@spline(#1,#2)% +} +\def\@spline(#1,#2){% + \@tempdima #1\unitlength + \@tempdimb #2\unitlength + \@tempcnta \@tempdima \advance\@tempcnta 2368 \divide\@tempcnta 4736 + \@tempcntb -\@tempdimb \advance\@tempcntb -2368 \divide\@tempcntb 4736 + \@paspecial{\the\@tempcnta}{\the\@tempcntb}% + \@ifnextchar ({\@spline}{\special{sp}}% +} +\def\path(#1,#2){% + \@killglue % This line added by Piet van Oostrum, Dec 20, 1999. + \special{pn \the\@gphlinewidth}% + \@path(#1,#2)% +} +\def\@path(#1,#2){% + \@tempdima #1\unitlength + \@tempdimb #2\unitlength + \@tempcnta \@tempdima \advance\@tempcnta 2368 \divide\@tempcnta 4736 + \@tempcntb -\@tempdimb \advance\@tempcntb -2368 \divide\@tempcntb 4736 + \@paspecial{\the\@tempcnta}{\the\@tempcntb}% + \@ifnextchar ({\@path}{\special{fp}}% +} + +%%%%%%%%%% Beginning of \oval %%%%%%%%%%%%%%% +\newdimen\maxovaldiam \maxovaldiam 40pt\relax + +\def\@oval(#1,#2)[#3]{\begingroup\boxmaxdepth \maxdimen + \@ovttrue \@ovbtrue \@ovltrue \@ovrtrue + \@tfor\@tempa :=#3\do{\csname @ov\@tempa false\endcsname}\@ovxx + #1\unitlength \@ovyy #2\unitlength + \@tempdimb \ifdim \@ovyy >\@ovxx \@ovxx\else \@ovyy \fi + \@ovro \ifdim \@tempdimb>\maxovaldiam \maxovaldiam\else\@tempdimb\fi\relax + \divide \@ovro \tw@ + \@ovdx\@ovxx \divide\@ovdx \tw@ + \@ovdy\@ovyy \divide\@ovdy \tw@ + \setbox\@tempboxa \hbox{% + \if@ovr \@ovverta\fi + \if@ovl \kern \@ovxx \@ovvertb\kern -\@ovxx \fi + \if@ovt \@ovhorz \kern -\@ovxx \fi + \if@ovb \raise \@ovyy \@ovhorz \fi}% Update by Piet van Oostrum (% added) + \ht\@tempboxa\z@ \dp\@tempboxa\z@ + \@put{-\@ovdx}{-\@ovdy}{\box\@tempboxa}% + \endgroup} + +\def\@qcirc#1#2#3#4{% + \special{pn \the\@gphlinewidth}% + \@eepictcnt \@gphlinewidth \divide\@eepictcnt 2 + \@tempcnta #1 + \advance\@tempcnta 2368 \divide\@tempcnta 4736 + \advance\@tempcnta\@eepictcnt + \@tempcntb #2 \divide\@tempcntb 4736 \advance\@tempcntb 2 + \hbox{% + \@qcircspecial{\the\@tempcnta}{-\the\@eepictcnt}{\the\@tempcntb}{#3}{#4}}% +} +\def\@qcircspecial#1#2#3#4#5{\special{ar #1 #2 #3 #3 #4 #5}} + +\def\@ovverta{\vbox to \@ovyy{% + \if@ovb + \kern \@ovro + \@qcirc{\@ovro}{\@ovro}{3.1416}{4.7124}\nointerlineskip + \else + \kern \@ovdy + \fi + \leaders\vrule width \@wholewidth\vfil \nointerlineskip + \if@ovt + \@qcirc{\@ovro}{\@ovro}{1.5708}{3.1416}\nointerlineskip + \kern \@ovro + \else + \kern \@ovdy + \fi +}\kern -\@wholewidth} + +\def\@ovvertb{\vbox to \@ovyy{% + \if@ovb + \kern \@ovro + \@qcirc{-\@ovro}{\@ovro}{4.6124}{6.2832}\nointerlineskip + \else + \kern \@ovdy + \fi + \leaders\vrule width \@wholewidth\vfil \nointerlineskip + \if@ovt + \@qcirc{-\@ovro}{\@ovro}{0}{1.6708}\nointerlineskip + \kern \@ovro + \else + \kern \@ovdy + \fi +}\kern -\@wholewidth} + +\def\@ovhorz{\hbox to \@ovxx{% + \if@ovr \kern \@ovro\else \kern \@ovdx \fi + \leaders \hrule height \@wholewidth \hfil + \if@ovl \kern \@ovro\else \kern \@ovdx \fi + }} +%%%%%%%%% End of \oval %%%%%%%%%%%%%% + +\def\allinethickness#1{\let\@linefnt\tenlnw \let\@circlefnt\tencircw + \@wholewidth #1 \@halfwidth .5\@wholewidth + \@gphlinewidth\@wholewidth \divide\@gphlinewidth 4736\relax} + +\def\blacken{\special{bk}} +\def\whiten{\special{wh}} +\def\shade{\special{sh}} +\def\texture#1{\special{tx #1}\ignorespaces} +%% +\newbox\@filltype +\setbox\@filltype\hbox{\special{bk}} +\def\filltype#1{\@nameuse{ft@#1}} +\def\ft@black{\setbox\@filltype\hbox{\special{bk}}} +\def\ft@white{\setbox\@filltype\hbox{\special{wh}}} +\def\ft@shade{\setbox\@filltype\hbox{\special{sh}}} +%% diff --git a/macros/latex/contrib/eepic/eepic.tex b/macros/latex/contrib/eepic/eepic.tex new file mode 100644 index 0000000000..0fbdcb579d --- /dev/null +++ b/macros/latex/contrib/eepic/eepic.tex @@ -0,0 +1,605 @@ +\documentstyle[11pt,epic,eepic]{article} +% ALLTT DOCUMENT-STYLE OPTION - released 17 December 1987 +% for LaTeX version 2.09 +% Copyright (C) 1987 by Leslie Lamport + +% Defines the `alltt' environment, which is like the `verbatim' +% environment except that `\', `\{', and `\}' have their usual meanings. +% Thus, other commands and environments can appear within an `alltt' +% environment. Here are some things you may want to do in an `alltt' +% environment: +% +% * Change fonts--e.g., by typing `{\em emphasized text\/}'. +% +% * Insert text from a file foo.tex by typing `input{foo}'. Beware that +% each <return> stars a new line, so if foo.tex ends with a <return> +% you can wind up with an extra blank line if you're not careful. +% +% * Insert a math formula. Note that `$' just produces a dollar sign, +% so you'll have to type `\(...\)' or `\[...\]'. Also, `^' and `_' +% just produce their characters; use `\sp' or `\sb' for super- and +% subscripts, as in `\(x\sp{2}\)'. +\makeatletter +\def\docspecials{\do\ \do\$\do\&% + \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~} +% +\def\alltt{\trivlist \item[]\if@minipage\else\vskip\parskip\fi +\leftskip\@totalleftmargin\rightskip\z@ +\parindent\z@\parfillskip\@flushglue\parskip\z@ +\@tempswafalse \def\par{\if@tempswa\hbox{}\fi\@tempswatrue\@@par} +\obeylines \tt \catcode``=13 \@noligs \let\do\@makeother \docspecials + \frenchspacing\@vobeyspaces} +% +\let\endalltt=\endtrivlist +\makeatother +\ifx\twltt\undefined \font\twltt=cmtt10 scaled \magstep1\fi + +\topmargin=-37pt\oddsidemargin=0pt\evensidemargin=0pt +\marginparsep 10pt\marginparwidth 60pt +\textheight 9truein\textwidth 6.5truein + +\chardef\BS=`\\ % It only works in \tt font +\newcommand{\PiCTeX}{PiC\TeX} +\newcommand{\epic}{{\sc epic}} +\newcommand{\eepic}{{\sc eepic}} +\newcommand{\plotchar}{\makebox(0,0){\large $\otimes$}} +\parskip=4pt plus 2pt minus 1pt +\title{EEPIC\\Extensions to epic\ and \LaTeX \\ Picture +Environment Version 1.1} +\author{Conrad Kwok\\ + Department of Electrical Engineering and Computer Science\\ + University of California, Davis} +\date{Febrary 2, 1988} +\begin{document} +\maketitle + + +\section{Introduction} +\LaTeX\ provides a basic but limited picture drawing capability. +\epic\footnote{\epic\ is a \LaTeX\ macro package written by Sunil +Podar at S.U.N.Y at Stony Brook. Please read the section on +installation for more information} is an enhancement to the +picture environment of \LaTeX\ which provides a simpler and more +powerful interface. It introduces new commands for drawing solid +lines, dotted lines, dash lines and new environments suitable for +plotting graphs. + +However, \epic\ still inherits many of the limitations of +\LaTeX\ in picture drawing and hence some of the functions either +take a long time to accomplish or the output is not very nice +looking. + +tpic is preprocessor program for use with \TeX. It uses a set of +\verb|\special|s graphics commands for drawing pictures. More and +more DVI driver programs supports those specials. They are +becoming a standard set of \verb|\special|s for DVI files. +However, the major disadvantage of tpic is that the tpic +preprocessor itself is not readily available on most machines. It +is written in yacc and C language. It is mainly for UNIX or +similar system. + +\eepic, as an extension to both \LaTeX\ and \epic, tries to +alleviate some of the limitations in \LaTeX, \epic\ and tpic by +generating tpic \verb|special|s using \TeX\ commands instead of +any preprocessor program, but at the same time provides +compatibility with the original commands such that when a DVI +driver which understands tpic \verb|special|s are not available, +the documents can still be formatted using standard \LaTeX\ and +\epic. However, the output probably will not be as good as +originally intended. + +Currently, \eepic\ extends \LaTeX\ and \epic\ in the following +ways: +\begin{itemize}\parskip=0pt +\item Draws lines in any slopes. +\item Draws circles and discs (filled circle) in any radii. +\item Draws dotted lines and dash lines in a much faster way and +requires much less \TeX\ internal memory. +\item Provides more line thickness options. +\end{itemize} + +Furthermore, \eepic\ introduces several new commands for: +\begin{itemize}\parskip=0pt +\item drawing of ellipsis and filled ellipsis +\item drawing of arcs +\item drawing of splines (cubic splines using control points) +\item drawing of polylines +\end{itemize} + +All the affected commands in \LaTeX\ and \epic\ will be discussed +in the subsequent sections. The compatibility issues will be +described in the section~\ref{compat}. + +In version 1.1, several bugs are fixed, and several commands for +area filled are added. +\clearpage + + +\section{Extension to \LaTeX} + +In \LaTeX, drawing of lines and circles are done using special +fonts. Therefore only limited functions are provided. The +extensions in \eepic\ allow users to draw lines in any slope and +to draw circles in any sizes. However, the limitation of slopes +for vectors remains the same in the mean time. That is the slope +that can be handled is $\frac{x}{y}$ where $x$ and $y$ are +integers in the range $[-4,4]$. Please read \LaTeX\ manual for +details. + + +\subsection{\tt \BS line} +The syntax of \verb|\line| is the same as that in \LaTeX: +\begin{quote} +\verb|\line(|$x$,$y$\verb|){|{\em length}\verb|}| +\end{quote} +But now $x$ and $y$ can be any integer values within the limit of +\TeX. Furthermore, there is no more lower limit for {\em length} +parameter. + + +\subsection{\tt \BS circle} +The syntax of \verb|\circle| is the same as that in \LaTeX: +\begin{quote} +\verb|\circle{|{\em diameter}\verb|}| +\end{quote} +or +\begin{quote} +\verb|\circle*{|{\em diameter}\verb|}| +\end{quote} +But now the {\em diameter} parameter can be any number acceptable +by \TeX\ and a circle with the specified diameter (exactly) will +be drawn. + + +\subsection{\tt \BS oval} +The \verb|\oval| command is changed such that the maximum +diameter of the quarter circles at the corners can be set to any +values. This is done by setting the variable \verb|\maxovaldiam| +to the desire \TeX{} dimension. The default is 40pt. + + +\clearpage + + +\section{Extension to EPIC} +\epic\ is an enhancement to the Picture Environment of \LaTeX. +\epic\ generates standard DVI files and requires only standard +\LaTeX\ fonts. Some of the functions it provides are: +\begin{center} +\begin{tabular}{lll} +\verb|\multiputlist| & \verb|\dottedline| & \verb|\putfile| \\ +\verb|\matrixput| & \verb|\dashline| \\ +\verb|\grid| & \verb|\drawline| \\ +\end{tabular} +\end{center} +Details can be found in the \epic\ manual. + +Extensions to \epic\ in \eepic\ include better line drawing +output, faster operation and less memory requirement. The +commands affected are: +\begin{enumerate}\parskip=0pt +\item \verb|\drawline| +\item \verb|\dashline| +\item \verb|\dottedline| +\end{enumerate} +And the three ``\verb|*join|'' environments are indirectly +affected also. + + +\subsection{\tt \BS drawline} +The syntax of \verb|\drawline| is: +\begin{quote} +\begin{alltt} +\BS{}drawline[{\em{}stretch}](\(x\sb{1}\),\(y\sb{1}\))(\(x\sb{2}\),\(y\sb{2}\))\ldots(\(x\sb{n}\),\(y\sb{n}\)) +\end{alltt} +\end{quote} +where {\em stretch} is an integer between $-100$ and infinity. +However any number greater than 0 are the same. An negative {\em +stretch} in \verb|\drawline| will call \verb|\dashline|. + +The thickness of the line is affected by \verb|\thinlines|, +\verb|\thicklines| and \verb|\Thicklines| declarations. +Horizontal and vertical lines are drawn using rules. + + +\subsection{\tt \BS dottedline} +The syntax of \verb|\dottedline| is: +\begin{quote} +\begin{alltt} +\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}\)) +\end{alltt} +\end{quote} +where {\em dot character} is the character used in drawing the +``dotted'' line. {\em dotgap} is the interdot gap in terms of +\verb|\unitlength|. \verb|\special|s will only be generated if no +optional dot character is specified. + +The size of the dots are affected by \verb|\thinlines|, +\verb|\thicklines| and \verb|\Thicklines| declarations. + + +\subsection{\tt \BS dashline} +The syntax of \verb|\dashline| is: +\begin{quote} +\begin{alltt} +\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}\)) +\end{alltt} +\end{quote} +where {\em stretch} is an integer between $-100$ and infinity. If +{\em inter-dot-gap} is not specified, dashes are drawn in solid +lines, otherwise, dashes are drawn using dotted lines. + +The thickness of the line is affected by \verb|\thinlines|, +\verb|\thicklines| and \verb|\Thicklines| declarations. + + +\clearpage + + +\section{New Commands} +\eepic\ introduces a number of new commands. Except the +\verb|\path| commands, all other new commands do not have any +equivalents in \LaTeX\ and \epic. Please read +section~\ref{compat} about the compatibility issues. + + +\subsection{\tt \BS allinethickness} +Set the line thickness of all line drawing commands including +lines in any slopes, circles, ellipsis, arcs, ovals and splines. +Note there are only two `l' in the command. The syntax is: +\begin{quote} +\verb|\allinethickness{|{\em dimension}\verb|}|. +\end{quote} + + +\subsection{\tt \BS Thicklines} +The syntax is: +\begin{quote} +\verb|\Thicklines| +\end{quote} +With the \verb|\Thicklines| declaration, thickness of lines drawn +will be about 1.5 times of \verb|\thicklines|. + + +\subsection{\tt \BS path} +\verb|\path| is a fast version of \verb|\drawline|. Optional {\em +stretch\/} argument is not allowed and so it always draw solid +lines. The syntax is: +\begin{quote} +\begin{alltt} +\BS{}path(\(x\sb{1}\),\(y\sb{1}\))(\(x\sb{2}\),\(y\sb{2}\))\ldots(\(x\sb{n}\),\(y\sb{n}\)) +\end{alltt} +\end{quote} +\verb|\path| is mainly used in drawing complex paths. + + +\subsection{\tt \BS spline} +Syntax of \verb|\spline| is the same as \verb|\path|. +\begin{quote} +\begin{alltt} +\BS{}spline(\(x\sb{1}\),\(y\sb{1}\))(\(x\sb{2}\),\(y\sb{2}\))\ldots(\(x\sb{n}\),\(y\sb{n}\)) +\end{alltt} +\end{quote} +\verb|\spline| draws an Chaikin's curve which passes through only +the first and last point. All other points are control points +only. + + +\subsection{\tt \BS ellipse} +The command \verb|\ellipse| draws an ellipse by specifying the +x-diameter and y-diameter. +\begin{quote} +\begin{alltt} +\BS{}ellipse\{{\em{}x-diameter}\}\{{\em{}y-diameter}\} +\end{alltt} +\end{quote} +or +\begin{quote} +\begin{alltt} +\BS{}ellipse*\{{\em{}x-diameter}\}\{{\em{}y-diameter}\} +\end{alltt} +\end{quote} +When {\em x-diameter} is equal to {\em y-diameter}, the command +is equivalent to \verb|\circle| or \verb|\circle*|. + + +\subsection{\tt \BS arc} +\verb|\arc| draws an circular arc. The syntax is +\begin{quote} +\begin{alltt} +\BS{}arc\{{\em{}diameter}\}\{{\em{}start-angle}\}\{{\em{}end-angle}\} +\end{alltt} +\end{quote} +{\em diameter} is specified in \verb|\unitlength| and both {\em +start-angle} and {\em end-angle} are in radian. {\em start-angle} +must be within 0 and $2\pi$ and {\em end-angle} can be any value +between {\em start-angle} and {\em start-angle} + $2\pi$. Arcs +are drawn in clockwise direction with angle 0 pointing to the +right on the paper. + + +\subsection{\tt \BS filltype\{....\}} +The command specifies the type of area fill for \verb|\circle*| and +\verb|\ellipse*|. The command itself does not draw anything. +It only changes the interpretation of \verb|*| in the two commands +specified above. +The syntax of the command is: +\begin{quote} +\begin{alltt} +\BS{}filltype\{{\em{}area-fill-type}\} +\end{alltt} +\end{quote} +The legal area fill type are: +\begin{itemize} +\item black (default) +\item white +\item shade +\end{itemize} + +For example, to change area fill type to white fill, the +following command should be used. +\begin{verbatim} + \filltype{white} +\end{verbatim} + + +These commands are only intended for advance users (those who +know what they are doing). They are included mainly because +\verb|fig2epic|\footnote{Another program written by me to convert +Fig output file to eepic format.} generate these commands. The +commands are: +\begin{center} +\begin{tabular}{|l|p{4.4in}|}\hline +\multicolumn{1}{|c|}{commands} & \qquad Description \\ \hline +\verb|\blacken| & Black fill the next figure \\ +\verb|\whiten| & White fill the next figure \\ +\verb|\shade| & Shade the interior next figure \\ +\verb|\texture| & Specify the pattern used for the next +\verb|shade| command. The pattern will remain effective until it is +changed by another \verb|\texture| command. +The syntax is: +\begin{quote} +\begin{alltt} +\BS{}texture\{{\em 32 32-bit hexadecimal numbers}\} +\end{alltt} +\end{quote} +An example (the default) is: +\begin{quote} +\begin{verbatim} +\texture{cccccccc 0 0 0 cccccccc 0 0 0 + cccccccc 0 0 0 cccccccc 0 0 0 + cccccccc 0 0 0 cccccccc 0 0 0 + cccccccc 0 0 0 cccccccc 0 0 0} +\end{verbatim} +\end{quote} \\ +\hline +\end{tabular} +\end{center} +The exact interpretation of the above commands are probably +device driver dependent. I did most of tests using \verb|iptex| +(imagen1) and several tests using \verb|dvips|. +The description below may not apply to other +device drivers. + +The commands that can be specified after \verb|\blacken|, +\verb|\whiten| and \verb|\shade| include \verb|\path|, +\verb|\circle| (without \verb|*|), \verb|\ellipse| (again without +\verb|*|) and \verb|\arc|. The drawings do not have to be closed. +The imagen printer will automatically draw an imaginary line from +the starting point to the end point, and then fill the figure. +When using \verb|iptex|, the outline of the figures are drawn but not +in \verb|dvips|. In another words, when using \verb|iptex|, the command: +\begin{quote} +\begin{verbatim} +\shade\circle{10} +\end{verbatim} +\end{quote} +will draw a circle will the circumference in solid line and the +interior is filled in the pattern active at that time. However, when using +dvips, the circle will not have the circumference drawn in sold line. + +\clearpage + + +\section{Examples} +I shamelessly stole two examples from the \epic\ manual so that +you can compare the results. The third and fourth examples are +created by FIG and then converted to \eepic\ using +\verb|fig2epic| which is also written by me. + +\unitlength=1mm + + +\subsection{Example 1} +\begin{figure}[h] +\begin{center} +%\newcommand{\plotchar}{\makebox(0,0){\large $\otimes$}} +\begin{picture}(100,100)(0,0) +\put(0,0){\tiny \grid(100,100)(5,5)[0,0]} +\drawline(10,5)(60,10)(85,20)(90,60)(100,95) +\drawline[-50](10,0)(65,5)(90,15)(95,55) +\thicklines +\dottedline{1.4}(10,10)(60,20)(75,35)(95,95) +\dashline{2}(80,90)(50,80)(30,50)(10,40) +\dashline{2}[0.5](80,80)(50,70)(30,40)(10,30) +\dashline[-30]{2}[0.5](80,70)(50,60)(30,30)(10,20) +\end{picture} +\end{center} +\caption[]{\normalsize An example of Various Line Drawing Commands} +\end{figure} +\clearpage + + +\subsection{Example 2} +\newcount\xjunk +\newcount\yjunk +\begin{figure}[h] +\begin{center} +\begin{tiny} +\begin{picture}(140,140)(-70,-70) +\thinlines +\xjunk=60 \yjunk=3 +\loop +\drawline(0,0)(\xjunk,\yjunk) +\drawline(0,0)(-\xjunk,\yjunk) +\drawline(0,0)(\xjunk,-\yjunk) +\drawline(0,0)(-\xjunk,-\yjunk) +\put(\xjunk,\yjunk){\plotchar} +\put(-\xjunk,\yjunk){\plotchar} +\put(\xjunk,-\yjunk){\plotchar} +\put(-\xjunk,-\yjunk){\plotchar} +\put(\xjunk,\yjunk){\makebox(8,0)[l]{\ \ (\number\xjunk,\number\yjunk)}} +\put(-\xjunk,\yjunk){\makebox(-4,0)[r]{(\number-\xjunk,\number\yjunk)}} +\put(\xjunk,-\yjunk){\makebox(8,0)[l]{\ \ (\number\xjunk,\number-\yjunk)}} +\put(-\xjunk,-\yjunk){\makebox(-4,0)[r]{(\number-\xjunk,\number-\yjunk)}} +\ifnum\yjunk < 53 \advance\yjunk by 10 %will go till 53. +\repeat +\xjunk=3 \yjunk=60 +\loop +\drawline(0,0)(\xjunk,\yjunk) +\drawline(0,0)(-\xjunk,\yjunk) +\drawline(0,0)(\xjunk,-\yjunk) +\drawline(0,0)(-\xjunk,-\yjunk) +\put(\xjunk,\yjunk){\plotchar} +\put(-\xjunk,\yjunk){\plotchar} +\put(\xjunk,-\yjunk){\plotchar} +\put(-\xjunk,-\yjunk){\plotchar} +\put(\xjunk,\yjunk){\makebox(0,7)[t]{(\number\xjunk,\number\yjunk)}} +\put(-\xjunk,\yjunk){\makebox(0,5)[t]{(\number-\xjunk,\number\yjunk)}} +\put(\xjunk,-\yjunk){\makebox(0,-4)[t]{(\number\xjunk,\number-\yjunk)}} +\put(-\xjunk,-\yjunk){\makebox(0,-6)[t]{(\number-\xjunk,\number-\yjunk)}} +\ifnum\xjunk < 53 \advance\xjunk by 10 +\repeat +\end{picture} +\end{tiny} +\end{center} +\caption[]{\normalsize Test Sample: Lines of various slopes with +\verb|thinlines|} +\end{figure} +\clearpage + + +\subsection{Example 3} +\begin{figure}[htbp] +\hrule +\begin{center} +\input{epic-eg3} +\end{center} +\caption{The finite automaton to detect occurrences of $P$=`$AABC$'.} +\medskip +\hrule +\end{figure} + + +\subsection{Example 4} +\begin{figure}[htbp] +\hrule +\begin{center} +\input{epic-eg4} +\end{center} +\caption{Breath-first search beginning at A} +\medskip +\hrule +\end{figure} + + +\clearpage + + +\section{Bugs} +\begin{itemize} +\item The \verb|\circle*| and \verb|\ellipse*| may not work on +all DVI drivers especially some previewers. If you have any +problem, you should remove the related code in eepic.sty and use +the \LaTeX{} \verb|\cirlce*| commands. To find the related codes, +search for \verb|\special{bk}| in the file. +\item The alignment of the quarter circles and the lines in +\verb|\oval| command may not be correct on all printers because +the command relies on the precise interpretation of the tpic +specials which are not defined clearly. If you have any problem, +you should either fixed that by changing the position of the +quarter circles or remove the whole extended \verb|\oval| command +from \verb|eepic.sty|. +\item The area fill commands probably will not work on most +previewers, and different device drivers may produce slightly +different results. +\end{itemize} + + +\section{Compatibility}\label{compat} +If you want your \TeX\ file to be compatible with \LaTeX\ and +\epic\ but at the same time you want a better print out by using +\eepic, you must avoid several features in \eepic. +\begin{itemize} +\item Try not to use \verb|\line| commands and use +\verb|\drawline| instead because \verb|\line| in \LaTeX\ only +supports a limited set of slope. +\item Do not use \verb|\arc| command. Use \verb|\spline| if a +curve is really necessary. +\item Avoid using solid or small inter-dot gap in drawing long +dash lines. They used up a lot of \TeX\ memory in original \epic. +You should use \verb|\drawline| with negative stretch to draw the +dash lines. +\end{itemize} + +If you want to use any of the extended commands in \eepic, you +must include the \eepic\ emulation macros (\verb|eepicemu|) in +the file. The extended commands are emulated in the following +ways. +\begin{itemize} +\item Circles larger than 40pt will be drawn using \verb|\oval|. +\item Ellipsis will be drawn using \verb|\oval|. +\item Spline will be approximated by \verb|\drawline|. +\item \verb|\path| will be substituted by \verb|\drawline|. +\item \verb|\Thicklines| will be substituted by +\verb|\thicklines|. +\item \verb|\allinethickness| will be substituted by +\verb|\thicklines| and \verb|\linethickness|. +\end{itemize} + +\clearpage + + +\section{Installation} +There are two possible ways of installing \eepic. If your DVI +printer driver program supports the tpic specials, you should use +the standard \verb|eepic.sty| file. If your DVI printer driver +does not supports the tpic specials or you want to generate a +standard DVI file without any special commands, you should use +the file \verb|eepicemu.sty|. + +EPIC is available on \verb|cs.rochester.edu| and +\verb|sun.soe.clarkson.edu| for anonymous ftp and e-mail request. + +\subsection{Use tpic Specials} +First of all, you have to put a copy of \verb|epic.sty| and +\verb|eepic.sty| in a place where \LaTeX\ can find it. See +section 4 of \epic\ manual for more information. + +Both \epic\ and \eepic\ have been implemented as document style +options \verb|epic| and \verb|eepic|. When using +\verb|epic| and \verb|eepic|, \verb|eepic| must come +after \verb|epic| in the \verb|\documentstyle| command. For example: +\begin{quote} +\begin{verbatim} +\documentstyle[epic,eepic]{article} +\end{verbatim} +\end{quote} + +If you only need the extended \LaTeX\ commands and the new +\eepic\ commands, you may include only \verb|eepic| in the +\verb|\documentstyle| command. But then the \eepic\ emulation +package will not work. I strongly recommend you to use +\eepic\ with \epic\ all the time. + +\subsection{No tpic Specials} +If you want to get a standard DVI file but you need the extended +\eepic\ commands, you should rename \verb|eepicemu.sty| to +\verb|eepic.sty| and put that in a place where \LaTeX\ can find +it. Remember \verb|\arc| command is not supported and the output +will not be as good as standard \eepic. Furthermore, you cannot +use the emulation package with \LaTeX\ alone. You have to include +\verb|epic| also. + +\end{document} + diff --git a/macros/latex/contrib/eepic/eepicemu.sty b/macros/latex/contrib/eepic/eepicemu.sty new file mode 100644 index 0000000000..13e45ba29c --- /dev/null +++ b/macros/latex/contrib/eepic/eepicemu.sty @@ -0,0 +1,94 @@ +% eepicemu Version 1.1a < Febrary 1, 1988 > +% Written by Conrad Kwok +% +% Internet : kwok@iris.ucdavis.edu +% csnet : kwok@ucd.csnet +% csnet : kwok%iris.ucdavis.edu@csnet.relay +% UUCP : ...!ucbvax!ucdavis!iris!kwok +% +% The macros are in public domain. +% You may distribute or modify it in any ways you like. +% Please report any bugs, enhancements, comments, suggestions, etc. +% +% Change logs: +% o Febrary 1, 1989 +% Add \newdimen\maxovaldiam for compatility with eepic +% +% o Febrary 1, 1989 +% Enhanced to handle new commands in eepic 1.1 +% +\typeout{Emulation of EEPIC using EPIC. Version 1.1a - Released Febrary 1, 1988} +\let\path\drawline +\def\ellipse{% + \@ifstar{\@ellipse}{\@ellipse}} +\def\@ellipse#1#2{% + \ifnum #1=#2% + \circle{#1}% + \else + \oval(#1,#2) + \fi\relax} +\let\Thicklines\thicklines +\def\circle{% + \@ifstar + {\@emudot}% + {\@emucirc}% +} +\def\@emudot#1{% + \@tempdimb #1\unitlength + \ifdim \@tempdimb > 15pt + \oval(#1,#1)% + \else + \@dot{#1}% + \fi +} +\def\@emucirc#1{% + \@tempdimb #1\unitlength + \ifdim \@tempdimb > 40pt + \oval(#1,#1)% + \else + \@circle{#1}% + \fi +} +\def\arc#1#2#3{\typeout{arc function is not supported in emulation package}} +\newcount\@spxcnt +\newcount\@spycnt +\newcount\@ispxcnt +\newcount\@ispycnt +\newcount\@cmidxcnt +\newcount\@cmidycnt + +\def\spline(#1,#2){% + \@ifnextchar ({\@ispline(#1,#2)}% + {\ignorespaces}} +\def\@ispline(#1,#2)(#3,#4){% + \@ifnextchar ({\@iispline(#1,#2)(#3,#4)}% + {\@drawline[0](#1,#2)(#3,#4)\ignorespaces}} +\def\@iispline(#1,#2)(#3,#4)(#5,#6){% + \@ifnextchar ({% + \@spxcnt=#3 \advance\@spxcnt by #5 \divide\@spxcnt by 2\relax + \@spycnt=#4 \advance\@spycnt by #6 \divide\@spycnt by 2\relax + \@chaikin{#1}{#2}{#3}{#4}{\@spxcnt}{\@spycnt}% + \@ispxcnt=\@spxcnt\relax \@ispycnt=\@spycnt\relax + \@iispline(\@ispxcnt,\@ispycnt)(#5,#6)}% +% else + {\@chaikin{#1}{#2}{#3}{#4}{#5}{#6}}} +\def\@chaikin#1#2#3#4#5#6{% + \@cmidxcnt=#1 \advance\@cmidxcnt by #3 + \advance\@cmidxcnt by #3 \advance\@cmidxcnt by #5 + \divide\@cmidxcnt by 4 + \@cmidycnt=#2 \advance\@cmidycnt by #4 + \advance\@cmidycnt by #4 \advance\@cmidycnt by #6 + \divide\@cmidycnt by 4 + \@drawline[0](#1,#2)(\@cmidxcnt,\@cmidycnt)% + \@drawline[0](\@cmidxcnt,\@cmidycnt)(#5,#6)% +} +\def\allinethickness#1{\thicklines\linethickness{#1}} +% +\newdimen\maxovaldiam \maxovaldiam 40pt\relax +% +\def\filltype#1{} +\def\blacken{} +\def\whiten{} +\def\shade{} +\def\texture{} +\endinput diff --git a/macros/latex/contrib/eepic/epic-eg3.fig b/macros/latex/contrib/eepic/epic-eg3.fig new file mode 100644 index 0000000000..7652788af7 --- /dev/null +++ b/macros/latex/contrib/eepic/epic-eg3.fig @@ -0,0 +1,62 @@ +#FIG 1.4 +80 2 +5 1 0 1 0 0 0 0 0.000 0 1 0 346.808 76.731 348 68 353 83 338 77 + 0 0 1.000 4.000 8.000 +5 1 0 1 0 0 0 0 0.000 1 1 0 203.688 42.688 207 50 206 35 196 45 + 0 0 1.000 4.000 8.000 +5 1 0 1 0 0 0 0 0.000 1 1 0 182.250 47.250 189 47 177 43 182 54 + 0 0 1.000 4.000 8.000 +1 1 0 1 0 0 0 0 0.000 1 0.000 69 62 34 13 69 62 103 74 +1 3 0 1 0 0 0 0 0.000 1 0.000 198 62 11 11 198 62 198 74 +1 3 0 1 0 0 0 0 0.000 1 0.000 266 62 11 11 266 62 266 74 +1 3 0 1 0 0 0 0 0.000 1 0.000 334 62 11 11 334 62 334 74 +1 3 0 1 0 0 0 0 0.000 1 0.000 401 62 11 11 401 62 401 74 +1 3 0 1 0 0 0 0 0.000 1 0.000 468 62 11 11 468 62 468 74 +2 1 0 1 0 0 0 0 0.000 1 0 + 0 0 1.000 4.000 8.000 + 108 62 181 62 9999 9999 +2 1 0 1 0 0 0 0 0.000 1 0 + 0 0 1.000 4.000 8.000 + 216 62 249 62 9999 9999 +2 1 0 1 0 0 0 0 0.000 1 0 + 0 0 1.000 4.000 8.000 + 282 62 317 62 9999 9999 +2 1 0 1 0 0 0 0 0.000 1 0 + 0 0 1.000 4.000 8.000 + 350 62 384 62 9999 9999 +2 1 0 1 0 0 0 0 0.000 1 0 + 0 0 1.000 4.000 8.000 + 418 62 451 62 9999 9999 +3 0 0 1 0 0 0 0 0.000 1 0 + 0 0 1.000 4.000 8.000 + 329 74 289 104 229 109 199 94 194 79 9999 9999 +3 0 0 1 0 0 0 0 0.000 1 0 + 0 0 1.000 4.000 8.000 + 264 74 244 89 219 89 204 74 9999 9999 +3 0 0 1 0 0 0 0 0.000 1 0 + 0 0 1.000 4.000 8.000 + 256 73 234 79 210 73 9999 9999 +3 0 0 1 0 0 0 0 0.000 1 0 + 0 0 1.000 4.000 8.000 + 389 49 329 29 279 49 9999 9999 +3 0 0 1 0 0 0 0 0.000 1 0 + 0 0 1.000 4.000 8.000 + 394 44 353 16 259 24 214 53 9999 9999 +4 0 0 16 0 0 0 0.000 1 16 8 425 56 C +4 0 0 16 0 0 0 0.000 1 16 8 358 58 B +4 0 0 16 0 0 0 0.000 1 16 8 333 14 B +4 0 0 16 0 0 0 0.000 1 16 8 305 34 A +4 0 0 16 0 0 0 0.000 1 16 8 356 92 A +4 0 0 16 0 0 0 0.000 1 16 8 295 90 C +4 0 0 16 0 0 0 0.000 1 16 8 293 57 A +4 0 0 16 0 0 0 0.000 1 16 8 256 92 C +4 0 0 16 0 0 0 0.000 1 16 8 231 73 B +4 0 0 16 0 0 0 0.000 1 16 8 227 58 A +4 0 0 16 0 0 0 0.000 1 16 8 202 31 C +4 0 0 16 0 0 0 0.000 1 16 8 164 44 B +4 0 0 16 0 0 0 0.000 1 16 40 54 66 Start +4 0 0 16 0 0 0 0.000 1 16 8 197 66 1 +4 0 0 16 0 0 0 0.000 1 16 8 263 66 2 +4 0 0 16 0 0 0 0.000 1 16 8 333 66 3 +4 0 0 16 0 0 0 0.000 1 16 8 398 66 4 +4 0 0 16 0 0 0 0.000 1 16 8 467 66 * diff --git a/macros/latex/contrib/eepic/epic-eg3.tex b/macros/latex/contrib/eepic/epic-eg3.tex new file mode 100644 index 0000000000..e987d55bd2 --- /dev/null +++ b/macros/latex/contrib/eepic/epic-eg3.tex @@ -0,0 +1,59 @@ +\setlength{\unitlength}{0.0125in} +\begin{picture}(444,125)(0,-10) +\thicklines +\drawline(304.318,26.338)(303.000,31.000)(301.969,26.267) +\put(311.808,31.269){\arc{17.624}{4.8481}{9.3942}} +\drawline(158.742,66.792)(161.000,63.000)(160.792,67.408) +\put(168.688,65.312){\arc{16.054}{2.8495}{7.4287}} +\drawline(143.367,53.233)(147.000,54.000)(143.433,55.033) +\put(147.250,60.750){\arc{13.509}{1.6078}{6.2462}} +\put(34,46){\oval(68,26)} +\put(163,46){\ellipse{22}{22}} +\put(231,46){\ellipse{22}{22}} +\put(299,46){\ellipse{22}{22}} +\put(366,46){\ellipse{22}{22}} +\put(433,46){\ellipse{22}{22}} +\drawline(73,46)(146,46) +\drawline(138.000,44.000)(146.000,46.000)(138.000,48.000) +\drawline(181,46)(214,46) +\drawline(206.000,44.000)(214.000,46.000)(206.000,48.000) +\drawline(247,46)(282,46) +\drawline(274.000,44.000)(282.000,46.000)(274.000,48.000) +\drawline(315,46)(349,46) +\drawline(341.000,44.000)(349.000,46.000)(341.000,48.000) +\drawline(383,46)(416,46) +\drawline(408.000,44.000)(416.000,46.000)(408.000,48.000) +\spline(294,34) +(254,4)(194,-1)(164,14)(159,29) +\drawline(163.427,22.043)(159.000,29.000)(159.632,20.778) +\spline(229,34) +(209,19)(184,19)(169,34) +\drawline(176.071,29.757)(169.000,34.000)(173.243,26.929) +\spline(221,35) +(199,29)(175,35) +\drawline(183.246,35.000)(175.000,35.000)(182.276,31.119) +\spline(354,59) +(294,79)(244,59) +\drawline(250.685,63.828)(244.000,59.000)(252.171,60.114) +\spline(359,64) +(318,92)(224,84)(179,55) +\drawline(184.641,61.015)(179.000,55.000)(186.808,57.652) +\put(390,52){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt C}}} +\put(323,50){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt B}}} +\put(298,94){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt B}}} +\put(270,74){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt A}}} +\put(321,16){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt A}}} +\put(260,18){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt C}}} +\put(258,51){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt A}}} +\put(221,16){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt C}}} +\put(196,35){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt B}}} +\put(192,50){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt A}}} +\put(167,77){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt C}}} +\put(129,64){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt B}}} +\put(19,42){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt Start}}} +\put(162,42){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt 1}}} +\put(228,42){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt 2}}} +\put(298,42){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt 3}}} +\put(363,42){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt 4}}} +\put(432,42){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt *}}} +\end{picture} diff --git a/macros/latex/contrib/eepic/epic-eg4.fig b/macros/latex/contrib/eepic/epic-eg4.fig new file mode 100644 index 0000000000..cca46a6490 --- /dev/null +++ b/macros/latex/contrib/eepic/epic-eg4.fig @@ -0,0 +1,72 @@ +#FIG 1.4 +80 2 +1 3 0 1 0 0 0 0 0.000 1 0.000 174 124 5 5 174 124 174 129 +1 3 0 1 0 0 0 0 0.000 1 0.000 209 169 5 5 209 169 209 174 +1 3 0 1 0 0 0 0 0.000 1 0.000 69 149 5 5 69 149 69 154 +1 3 0 1 0 0 0 0 0.000 1 0.000 129 241 5 5 129 241 129 246 +1 3 0 1 0 0 0 0 0.000 1 0.000 139 169 5 5 139 169 139 174 +1 3 0 1 0 0 0 0 0.000 1 0.000 223 241 5 5 223 241 223 246 +1 3 0 1 0 0 0 0 0.000 1 0.000 294 144 5 5 294 144 294 149 +1 3 0 1 0 0 0 0 0.000 1 0.000 219 84 5 5 219 84 219 89 +1 3 0 1 0 0 0 0 0.000 1 0.000 129 84 5 5 129 84 129 89 +2 1 1 1 0 0 0 0 4.000 1 0 + 0 0 1.000 4.000 8.000 + 222 230 212 179 9999 9999 +2 1 1 1 0 0 0 0 4.000 1 0 + 0 0 1.000 4.000 8.000 + 137 176 130 233 9999 9999 +2 1 1 1 0 0 0 0 4.000 1 0 + 0 0 1.000 4.000 8.000 + 213 241 138 241 9999 9999 +2 1 1 1 0 0 0 0 4.000 1 0 + 0 0 1.000 4.000 8.000 + 229 234 288 154 9999 9999 +2 1 1 1 0 0 0 0 4.000 1 0 + 0 0 1.000 4.000 8.000 + 200 171 150 171 9999 9999 +2 1 1 1 0 0 0 0 4.000 1 0 + 0 0 1.000 4.000 8.000 + 144 162 167 133 9999 9999 +2 1 1 1 0 0 0 0 4.000 1 0 + 0 0 1.000 4.000 8.000 + 203 161 179 133 9999 9999 +2 1 1 1 0 0 0 0 4.000 1 0 + 0 0 1.000 4.000 8.000 + 168 118 136 90 9999 9999 +2 1 0 1 0 0 0 0 0.000 1 0 + 0 0 1.000 4.000 8.000 + 73 157 122 233 9999 9999 +2 1 0 1 0 0 0 0 0.000 1 0 + 0 0 1.000 4.000 8.000 + 215 93 183 118 9999 9999 +2 1 0 1 0 0 0 0 0.000 1 0 + 0 0 1.000 4.000 8.000 + 78 151 129 166 9999 9999 +2 1 0 1 0 0 0 0 0.000 1 0 + 0 0 1.000 4.000 8.000 + 286 149 220 168 9999 9999 +2 1 0 1 0 0 0 0 0.000 1 0 + 0 0 1.000 4.000 8.000 + 227 88 288 137 9999 9999 +2 1 0 1 0 0 0 0 0.000 1 0 + 0 0 1.000 4.000 8.000 + 137 84 209 84 9999 9999 +2 1 0 1 0 0 0 0 0.000 1 0 + 0 0 1.000 4.000 8.000 + 124 90 76 142 9999 9999 +4 0 0 16 0 0 0 0.000 1 16 8 243 154 7 +4 0 0 16 0 0 0 0.000 1 16 8 96 152 6 +4 0 0 16 0 0 0 0.000 1 16 8 82 200 5 +4 0 0 16 0 0 0 0.000 1 16 8 205 112 4 +4 0 0 16 0 0 0 0.000 1 16 8 256 105 3 +4 0 0 16 0 0 0 0.000 1 16 8 88 110 2 +4 0 0 16 0 0 0 0.000 1 16 8 170 81 1 +4 0 0 16 0 0 0 0.000 1 16 8 134 159 I +4 0 0 16 0 0 0 0.000 1 16 8 208 159 H +4 0 0 16 0 0 0 0.000 1 16 8 171 113 G +4 0 0 16 0 0 0 0.000 1 16 8 49 156 F +4 0 0 16 0 0 0 0.000 1 16 8 125 261 E +4 0 0 16 0 0 0 0.000 1 16 8 220 260 D +4 0 0 16 0 0 0 0.000 1 16 8 305 146 C +4 0 0 16 0 0 0 0.000 1 16 8 217 74 B +4 0 0 16 0 0 0 0.000 1 16 8 123 75 A diff --git a/macros/latex/contrib/eepic/epic-eg4.tex b/macros/latex/contrib/eepic/epic-eg4.tex new file mode 100644 index 0000000000..978e32b06b --- /dev/null +++ b/macros/latex/contrib/eepic/epic-eg4.tex @@ -0,0 +1,59 @@ +\setlength{\unitlength}{0.0125in} +\begin{picture}(264,218)(0,-10) +\thinlines +\put(125,137){\ellipse{10}{10}} +\put(160,92){\ellipse{10}{10}} +\put(20,112){\ellipse{10}{10}} +\put(80,20){\ellipse{10}{10}} +\put(90,92){\ellipse{10}{10}} +\put(174,20){\ellipse{10}{10}} +\put(245,117){\ellipse{10}{10}} +\put(170,177){\ellipse{10}{10}} +\put(80,177){\ellipse{10}{10}} +\dashline{4.000}(173,31)(163,82) +\drawline(166.502,74.534)(163.000,82.000)(162.577,73.765) +\dashline{4.000}(88,85)(81,28) +\drawline(79.990,36.184)(81.000,28.000)(83.960,35.697) +\dashline{4.000}(164,20)(89,20) +\drawline(97.000,22.000)(89.000,20.000)(97.000,18.000) +\dashline{4.000}(180,27)(239,107) +\drawline(235.861,99.374)(239.000,107.000)(232.642,101.749) +\dashline{4.000}(151,90)(101,90) +\drawline(109.000,92.000)(101.000,90.000)(109.000,88.000) +\dashline{4.000}(95,99)(118,128) +\drawline(114.596,120.489)(118.000,128.000)(111.462,122.975) +\dashline{4.000}(154,100)(130,128) +\drawline(136.725,123.228)(130.000,128.000)(133.688,120.624) +\dashline{4.000}(119,143)(87,171) +\drawline(94.338,167.237)(87.000,171.000)(91.704,164.227) +\drawline(24,104)(73,28) +\drawline(66.984,33.640)(73.000,28.000)(70.346,35.807) +\drawline(166,168)(134,143) +\drawline(139.073,149.501)(134.000,143.000)(141.535,146.349) +\drawline(29,110)(80,95) +\drawline(71.761,95.339)(80.000,95.000)(72.889,99.176) +\drawline(237,112)(171,93) +\drawline(178.134,97.135)(171.000,93.000)(179.241,93.291) +\drawline(178,173)(239,124) +\drawline(231.511,127.451)(239.000,124.000)(234.016,130.569) +\drawline(88,177)(160,177) +\drawline(152.000,175.000)(160.000,177.000)(152.000,179.000) +\drawline(75,171)(27,119) +\drawline(30.957,126.235)(27.000,119.000)(33.896,123.522) +\put(194,107){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt 7}}} +\put(47,109){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt 6}}} +\put(33,61){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt 5}}} +\put(156,149){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt 4}}} +\put(207,156){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt 3}}} +\put(39,151){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt 2}}} +\put(121,180){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt 1}}} +\put(85,102){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt I}}} +\put(159,102){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt H}}} +\put(122,148){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt G}}} +\put(0,105){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt F}}} +\put(76,0){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt E}}} +\put(171,1){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt D}}} +\put(256,115){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt C}}} +\put(168,187){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt B}}} +\put(74,186){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twltt A}}} +\end{picture} diff --git a/macros/latex/contrib/eepic/epic.sty b/macros/latex/contrib/eepic/epic.sty new file mode 100644 index 0000000000..cfebe7bc4e --- /dev/null +++ b/macros/latex/contrib/eepic/epic.sty @@ -0,0 +1,561 @@ +\makeatletter +\typeout{% +Enhancements to Picture Environment. Version 1.2 - Released June 1, 1986} +%---------------------------------------------------------------------- +% Copyright (C) podar@sbcs (Sunil Podar) July 14,1986. +% You may use this file in whatever way you wish. You are requested to +% leave this notice intact, and report any bugs, enhancements, comments, +% suggestions, etc. to: +% USmail: Sunil Podar,Dept. of Computer Science,SUNY at Stony Brook,NY 11794. +% CSNET: podar@sbcs.csnet +% ARPA: podar%suny-sb.csnet@csnet-relay.arpa +% UUCP: {allegra, hocsd, philabs, ogcvax}!sbcs!podar +%---------------------------------------------------------------------- +% This file contains implementation of: +% \multiputlist \matrixput \grid \picsquare +% \dottedline \dashline \drawline \jput +% \putfile +% Environments: dottedjoin, dashjoin and drawjoin +% +% For documentation, see the accompanying manual. +%---------------------------------------------------------------------- +% usage: \multiputlist(x,y)(delta-x,delta-y)[tbrl]{item1,item2,item3,.....} +% \lop and \lopoff taken from TeXbook. +%---------------------------------------------------------------------- +\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}} +%---------------------------------------------------------------------- +% two-dimensional version of \multiput +% \matrixput(0,0)(20,0){5}(0,20){3}{\circle{2}} +%---------------------------------------------------------------------- +\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}} +%---------------------------------------------------------------------- +%\grid(wd,ht)(delta-wd,delta-ht)[initial-X-integer,initial-Y-integer] +% example: 1. \put(0,0){\grid(95,100)(9.5,10)} +% 2. \put(0,0){\grid(100,100)(10,5)[-10,0]} +% or \put(0,0){\tiny \grid(100,100)(5,5)[0,0]}%numbers in \tiny font +%---------------------------------------------------------------------- +\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}} +%---------------------------------------------------------------------- +% \picsquare is a centered square of dimensions governed by \thinlines, +% \thicklines or \linethickness declarations. +\def\picsquare{\hskip -0.5\@wholewidth% +\vrule height \@halfwidth depth \@halfwidth width \@wholewidth} +% +% just a square dot with reference point at bottom-left +\def\picsquare@bl{\vrule height \@wholewidth depth \z@ width \@wholewidth} +%---------------------------------------------------------------------- +% \begin{dottedjoin}{interdot-gap in units} +% ..... +% \end{dottedjoin} +% \begin{dashjoin}{dash-length in units}{interdotgap in each dash} +% ..... +% \end{dashjoin} +% \begin{drawjoin} +% ..... +% \end{drawjoin} +% \jput(x,y){character} +% \dottedline[opt. dotcharacter]{dotgap in units}(x1,y1)(x2,y2)...(xN,yN) +% \dashline[#]{dash-length}[opt. dotgap](x1,y1)(x2,y2)...(xN,yN) +% \drawline[#](x1,y1)(x2,y2)...(xN,yN) +%---------------------------------------------------------------------- +% definitions for *join environment. had to do all this mess because of +% optional arguments. +%---------------------------------------------------------------------- +\newif\if@jointhem \global\@jointhemfalse +\newif\if@firstpoint \global\@firstpointtrue +\newcount\@joinkind +%\newenvironment{dottedjoin}[1]%[opt char]{dotgap} +%{\global\@jointhemtrue \gdef\dotgap@join{#1}\global\@joinkind=0\relax}% +%{\global\@jointhemfalse \global\@firstpointtrue} +%---------------------------------------------------------------------- +\def\dottedjoin{\global\@jointhemtrue \global\@joinkind=0\relax + \bgroup\@ifnextchar[{\@idottedjoin}{\@idottedjoin[\picsquare@bl]}} +\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 +%---------------------------------------------------------------------- +%% this is equiv to \put(x,y){#1} when not in {dot*join} environment. +\long\def\jput(#1,#2)#3{{\@killglue\raise#2\unitlength\hbox to \z@{\hskip +#1\unitlength #3\hss}\ignorespaces} +\if@jointhem + \if@firstpoint \gdef\x@one{#1} \gdef\y@one{#2} \global\@firstpointfalse + \else\ifcase\@joinkind + \@dottedline[\dotchar@join]{\dotgap@join\unitlength}% +(\x@one\unitlength,\y@one\unitlength)(#1\unitlength,#2\unitlength) + \or\@dashline[\dashlinestretch]{\dashlen@join}[\dotgap@join]% +(\x@one,\y@one)(#1,#2) + \else\@drawline[\drawlinestretch](\x@one,\y@one)(#1,#2)\fi + \gdef\x@one{#1} \gdef\y@one{#2} + \fi +\fi} +%---------------------------------------------------------------------- +\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 +%% from sqrtandstuff func basically need \num@segments. +%% given a deltax, deltay and dotgap, it calculates \num@segments = number of +%% segments along the hypotenuse. used by \dottedline & \dashline. +%% It finishes quickly if any of deltax or deltay are zero or close to zero. +\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} +%---------------------------------------------------------------------- +% \dottedline[opt. char]{interdot gap in units}(x1,y1)(x2,y2)....(xN,yN) +%---------------------------------------------------------------------- +%% Used the following construction earlier but that results in box memory +%% full much too soon although it works perfectly. +%% \setbox\@dotbox\vbox to\z@{\vss \hbox to\z@{\hss #1\hss}\vss}\relax} +%% The cenetering of characters is achieved by substracting half the ht, wd +%% of character from the (x,y) coordinates where they are to be put. We +%% chose to use a macro for the ``dot'' instead of \copy\box to save memory +%% at the expense of extra cpu, since memory becomes an issue very soon. +%% \picsquare is already centered, whereas other characters, except \circle, +%% will not be cenetered, hence to handle them all in a similar fashion, +%% used \picsquare@bl. +% +% kind of tail recursion. +\def\dottedline{\@ifnextchar [{\@idottedline}{\@idottedline[\picsquare@bl]}} +\def\@idottedline[#1]#2(#3,#4){\@ifnextchar (% +{\@iidottedline[#1]{#2}(#3,#4)}{\relax}} +\def\@iidottedline[#1]#2(#3,#4)(#5,#6){\@dottedline[#1]{#2\unitlength}% +(#3\unitlength,#4\unitlength)(#5\unitlength,#6\unitlength)% +\@idottedline[#1]{#2}(#5,#6)} +% +%% user not supposed to use this directly. arguments in absolute dimensions. +%% need to pass absolute dimens here because dashline calls dottedline and +%% can supply only absolute dimensions. +\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. +%%\typeout{num@segments= \the\num@segments} +\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 +%%circle's have a ht=0, this is one way I could think of to catch circles. +%%following loop is equiv to +%%\multiput(\@xdim,\@ydim)(\x@diff,\y@diff){\num@segments}{#1} +%%with arguments in absolute dimensions. +\@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}} +%---------------------------------------------------------------------- +% \dashline[#]{dash-length}[optional dotgap](x1,y1)(x2,y2)...(xN,yN) +% The minimum # of dashes put is 2, one at either end point; dash-length is +% reduced accordingly if necessary. Also have to some dirty work to account +% for stretch & shrink. +% \renewcommand{\dashlinestretch}{-50} %ONLY INTEGERS PERMITTED. +%---------------------------------------------------------------------- +\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[#1]#2[#3](#4,#5)(#6,#7){% +\@dashline[#1]{#2}[#3](#4,#5)(#6,#7)% +\@iidashline[#1]{#2}[#3](#6,#7)} +% +\long\def\@dashline[#1]#2[#3](#4,#5)(#6,#7){{% +\x@diff=#6\unitlength \advance\x@diff by -#4\unitlength +\y@diff=#7\unitlength \advance\y@diff by -#5\unitlength +%% correction to get actual width since the dash-length as taken in arguement +%% is the center-to-center of the end-points. +\@tempdima=#2\unitlength \advance\@tempdima -\@wholewidth +\sqrtandstuff{\x@diff}{\y@diff}{\@tempdima} +\ifnum\num@segments <3 \num@segments=3\fi% min number of dashes I can plot +% is 2, 1 at either end, thus min num@segments is 3 (including 'empty dash'). +\@tempdima=\x@diff \@tempdimb=\y@diff +\divide\@tempdimb by\num@segments +\divide\@tempdima by\num@segments +%% ugly if-then-else. If optional dotgap specified, then use it otherwise +%% make a solid looking dash. +{\ifx#3\@empty \relax + \ifdim\@tempdima < 0pt \x@diff=-\@tempdima\else\x@diff=\@tempdima\fi + \ifdim\@tempdimb < 0pt \y@diff=-\@tempdimb\else\y@diff=\@tempdimb\fi + \ifdim\x@diff < 0.3pt %it's a vertical dashline + \ifdim\@tempdimb > 0pt + \global\setbox\@dotbox\hbox{\hskip -\@halfwidth \vrule + \@width \@wholewidth \@height \@tempdimb} + \else\global\setbox\@dotbox\hbox{\hskip -\@halfwidth \vrule + \@width \@wholewidth \@height\z@ \@depth -\@tempdimb}\fi + \else\ifdim\y@diff < 0.3pt %it's a horizontal dashline + \ifdim\@tempdima >0pt + \global\setbox\@dotbox\hbox{\vrule \@height \@halfwidth + \@depth \@halfwidth \@width \@tempdima} + \else\global\setbox\@dotbox\hbox{\hskip \@tempdima + \vrule \@height \@halfwidth \@depth \@halfwidth + \@width -\@tempdima \hskip \@tempdima}\fi + \else\global\setbox\@dotbox\hbox{% +\@dottedline[\picsquare]{0.98\@wholewidth}(0pt,0pt)(\@tempdima,\@tempdimb)} +\fi\fi +\else\global\setbox\@dotbox\hbox{% +\@dottedline[\picsquare]{#3\unitlength}(0pt,0pt)(\@tempdima,\@tempdimb)} +\fi} +\advance\x@diff by -\@tempdima % both have same sign +\advance\y@diff by -\@tempdimb +% +%%here we correct the number of dashes to be put by reducing them +%%appropriately. (num@segments*\@wholewidth) is in some way the slack we +%%have,and division by dash-length gives the reduction. reduction = +%%(2*num@segments*\@wholewidth)/dash-length +%% (num@segments includes empty ones) +\@tempdima=\num@segments\@wholewidth \@tempdima=2\@tempdima +\@tempcnta=\@tempdima \@tempdima=#2\unitlength \@tempdimb=0.5\@tempdima +\@tempcntb=\@tempdimb \advance\@tempcnta by \@tempcntb % round-off error +\divide\@tempcnta by\@tempdima \advance\num@segments by -\@tempcnta +% +\ifnum #1=0 \relax\else\ifnum #1 < -100 + \typeout{***dashline: reduction > -100 percent implies blankness!***} +\else\num@segmentsi=#1 \advance\num@segmentsi by 100 + \multiply\num@segments by\num@segmentsi \divide\num@segments by 100 +\fi\fi +% +\divide\num@segments by 2 % earlier num@segments included 'empty dashes' too. +\ifnum\num@segments >0 % if =0 then don't divide => \x@diff & \y@diff + \divide\x@diff by\num@segments% remain same. + \divide\y@diff by\num@segments + \advance\num@segments by\@ne %for the last segment for which I subtracted + %\@tempdima & \@tempdimb from \x@diff & \y@diff + \else\num@segments=2 % one at each end. +\fi +%%\typeout{num@segments finally = \the\num@segments} +%% equiv to \multiput(#4,#5)(\x@diff,\y@diff){\num@segments}{\copy\@dotbox} +%% with arguements in absolute dimensions. +\@xdim=#4\unitlength \@ydim=#5\unitlength +\@killglue +\loop \ifnum\num@segments > 0 +\unskip\raise\@ydim\hbox to\z@{\hskip\@xdim \copy\@dotbox\hss}% +\advance\num@segments \m@ne\advance\@xdim\x@diff\advance\@ydim\y@diff% +\repeat +\ignorespaces}} +%---------------------------------------------------------------------- +%%1.00 .833333 .80 .75 .66666 .60 .50 .40 .33333 .25 .20 .16666 +%% .916666 .816666 .775 .708333 .633333 .55 .45 .366666 .291666 .225 .183333 +%% 0.0 +%%0.083333 +%% the first line has absolute slopes corresponding to various permissible +%% integer combinations representing slopes. The second line is the midpoint +%% of all those slopes (attempted to show them in the middle of two entries). +%% +%% \lineslope(x@diff dimen, y@diff dimen) +%% Given base (x@diff) and height (y@diff) in dimensions, determines the +%% closest available slope and returns the two required integers in \@xarg +%% and \@yarg. The given base and height can be ANYTHING, -ve or +ve, or +%% even 0pt. \lineslope knows about (0,1) and (1,0) slopes too and returns +%% correct values if the conditions regarding x@diff & y@diff are obeyed +%% (see NOTE). Used by \drawline. This is the simplest and only way I could +%% figure out to accomplish it!. +%% NOTE: both the dimensions (x@diff & y@diff) must be in SAME units and the +%% larger of the two dimensions must be atleast 1pt (i.e. 65536sp). To avoid +%% dividing by 0, I make the larger dimension = 1pt if it is < 1pt. +%% will need a similar one for vectors, or maybe this can be used. For +%% vectors the range is -4, 4 unlike lines where it is -6, 6. +\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 +%%\typeout{xdim,ydim= \the\@xdim, \the\@ydim} +\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 +%%\typeout{closest slope integers = \the\@xarg, \the\@yarg} +} +%---------------------------------------------------------------------- +% usage: \drawline[#](x1,y1)(x2,y2)....(xN,yN) +% % # is an optional integer between -100 & infinity. +% \renewcommand{\drawlinestretch}{-50} %ONLY INTEGERS PERMITTED. +%---------------------------------------------------------------------- +\newif\if@toosmall +\newif\if@drawit +\newif\if@horvline +\def\drawlinestretch{0} %well, could have used a counter. +% kind of tail recursion. +\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[#1](#2,#3)(#4,#5){{% +\x@diff=#4\unitlength \advance\x@diff by -#2\unitlength +\y@diff=#5\unitlength \advance\y@diff by -#3\unitlength +%% override any linethickness declarations, and since horiz & vertical lines +%% come out thinner than the slanted ones, assign slightly larger values. +%% default values are: thinlines=0.4pt, thicklines=0.8pt +\ifx\@linefnt\tenln \linethickness{0.5pt} \else \linethickness{0.9pt}\fi +\lineslope(\x@diff,\y@diff)% returns the two integers in \@xarg & \@yarg. +%------ +\@toosmalltrue +{\ifdim\x@diff <\z@ \x@diff=-\x@diff\fi + \ifdim\y@diff <\z@ \y@diff=-\y@diff\fi + \ifdim\x@diff >10pt \global\@toosmallfalse\fi + \ifdim\y@diff >10pt \global\@toosmallfalse\fi} +%------ +%% For efficiency, if the line is horiz or vertical then we draw it in one +%% shot, only if the stretch is not -ve and the line is not too small. +\@drawitfalse\@horvlinefalse +\ifnum#1 <0 \relax\else\@horvlinetrue\fi +\if@toosmall\@horvlinetrue\fi% to get 'or' condition. We necessarily draw a +% solid line if the line is too small ignoring any -ve stretch. +\if@horvline + \ifdim\x@diff =0pt \put(#2,#3){\ifdim\y@diff >0pt \@linelen=\y@diff \@upline + \else\@linelen=-\y@diff \@downline\fi}% + \else\ifdim\y@diff =0pt + \ifdim\x@diff >0pt \put(#2,#3){\vrule \@height \@halfwidth \@depth + \@halfwidth \@width \x@diff} + \else \put(#4,#5){\vrule \@height \@halfwidth \@depth + \@halfwidth \@width -\x@diff}\fi + \else\@drawittrue\fi\fi % construct the line explicitly +\else\@drawittrue\fi +%------------------------------- +\if@drawit +\ifnum\@xarg< 0 \@negargtrue\else\@negargfalse\fi +\ifnum\@xarg =0 \setbox\@linechar% +\hbox{\hskip -\@halfwidth \vrule \@width \@wholewidth \@height 10.2pt + \@depth \z@} +\else \ifnum\@yarg =0 \setbox\@linechar% +\hbox{\vrule \@height \@halfwidth \@depth \@halfwidth \@width 10.2pt} +\else \if@negarg \@xarg -\@xarg \@yyarg -\@yarg + \else \@yyarg \@yarg\fi +\ifnum\@yyarg >0 \@tempcnta\@yyarg \else \@tempcnta -\@yyarg\fi +\setbox\@linechar\hbox{\@linefnt\@getlinechar(\@xarg,\@yyarg)}% +\fi\fi +%------ +\if@toosmall% => it isn't a horiz or vert line and is toosmall. + \@dottedline[\picsquare]{.98\@wholewidth}% +(#2\unitlength,#3\unitlength)(#4\unitlength,#5\unitlength)% +\else +%% following is neat. The last segment takes \wd\@linechar & \ht\@linechar +%% so plot the line as though it were from (#2,#3) to +%% (#4-\wd\@linechar,#5-\ht\@linechar) (i.e. for positive slope; of course, +%% signs are reversed for other slopes). For horizontal & vertical dashes we +%% don't have to subtract the ht & wd resp. since they are already centered. +\ifnum\@xarg=0\relax\else\ifdim\x@diff >\z@ \advance\x@diff -\wd\@linechar + \else\advance\x@diff \wd\@linechar\fi\fi +\ifnum\@yarg=0\relax\else\ifdim\y@diff >\z@\advance\y@diff -\ht\@linechar + \else\advance\y@diff \ht\@linechar\fi\fi +\ifdim\x@diff <\z@ \@x@diff=-\x@diff \else\@x@diff=\x@diff\fi +\ifdim\y@diff <\z@ \@y@diff=-\y@diff \else\@y@diff=\y@diff\fi +%%\typeout{x@diff,y@diff=\the\x@diff , \the\y@diff} +\num@segments=0 \num@segmentsi=0 +\ifdim\wd\@linechar >1pt + \num@segmentsi=\@x@diff \divide\num@segmentsi \wd\@linechar\fi +\ifdim\ht\@linechar >1pt + \num@segments=\@y@diff \divide\num@segments \ht\@linechar\fi +\ifnum\num@segmentsi >\num@segments \num@segments=\num@segmentsi\fi +\advance\num@segments \@ne %to account for round-off error +% +\ifnum #1=0 \relax \else\ifnum #1 < -99 + \typeout{***drawline: reduction <= -100 percent implies blankness!***} +\else\num@segmentsi=#1 \advance\num@segmentsi by 100 + \multiply\num@segments \num@segmentsi + \divide\num@segments by 100 + \ifnum \num@segments=0 \num@segments=1 \fi +\fi\fi +%%\typeout{num@segments after = \the\num@segments} +% +\divide\x@diff \num@segments +\divide\y@diff \num@segments +\advance\num@segments \@ne %for the last segment for which I subtracted + %\wd & \ht of \@linechar from \@x@diff & \@y@diff. +%%\typeout{numseg,x@diff,y@diff= \the\num@segments, \the\x@diff, \the\y@diff} +% +\@xdim=#2\unitlength \@ydim=#3\unitlength +\if@negarg \advance\@xdim -\wd\@linechar\fi +\ifnum\@yarg <0 \advance\@ydim -\ht\@linechar\fi +%%following loop equiv to \multiput@abs(\@xdim,\@ydim)% +%%(\x@diff,\y@diff){\num@segments}{\copy\@linechar} +%%with arguements in absolute dimensions. +\@killglue +\loop \ifnum\num@segments > 0 +\unskip\raise\@ydim\hbox to\z@{\hskip\@xdim \copy\@linechar\hss}% +\advance\num@segments \m@ne\advance\@xdim\x@diff\advance\@ydim\y@diff% +\repeat +\ignorespaces +\fi%the if of @toosmall +\fi}}% for \if@drawit +%---------------------------------------------------------------------- +%usage: \putfile{datafile}{OBJECT} +% The OBJECT is plotted at EACH of the coordinates read from the datafile. +% The idea of these macros is to generate (x,y) pairs using some program +% and then directly use those coordinates. Since TeX doesn't have real +% floating point calculations, it is much more efficient and accurate to do +% things this way. One can also use the unix facility 'spline' now to +% generate smooth curves with equidistant ``dots''. +% NOTE: the external file of coordinates must have x y pairs with a space +% between them. Also it is suggested that some extension such as '.put' +% be used for such datafiles to distinguish them in which case it must +% be explicitely specified in the 1st argument so that TeX doesn't look +% for a .tex extension. +% The % char remains valid as a comment char and such lines are ignored; +% however, there should be atleast one space after the second entry if a +% comment is on the same line as data since % eats up the newline. +%----------------------------------------------------------------------- +\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 +} +%---------------------------------------------------------------------- +\makeatother diff --git a/macros/latex/contrib/eepic/fig2eepic/epic-eg3.fig b/macros/latex/contrib/eepic/fig2eepic/epic-eg3.fig new file mode 100644 index 0000000000..7652788af7 --- /dev/null +++ b/macros/latex/contrib/eepic/fig2eepic/epic-eg3.fig @@ -0,0 +1,62 @@ +#FIG 1.4 +80 2 +5 1 0 1 0 0 0 0 0.000 0 1 0 346.808 76.731 348 68 353 83 338 77 + 0 0 1.000 4.000 8.000 +5 1 0 1 0 0 0 0 0.000 1 1 0 203.688 42.688 207 50 206 35 196 45 + 0 0 1.000 4.000 8.000 +5 1 0 1 0 0 0 0 0.000 1 1 0 182.250 47.250 189 47 177 43 182 54 + 0 0 1.000 4.000 8.000 +1 1 0 1 0 0 0 0 0.000 1 0.000 69 62 34 13 69 62 103 74 +1 3 0 1 0 0 0 0 0.000 1 0.000 198 62 11 11 198 62 198 74 +1 3 0 1 0 0 0 0 0.000 1 0.000 266 62 11 11 266 62 266 74 +1 3 0 1 0 0 0 0 0.000 1 0.000 334 62 11 11 334 62 334 74 +1 3 0 1 0 0 0 0 0.000 1 0.000 401 62 11 11 401 62 401 74 +1 3 0 1 0 0 0 0 0.000 1 0.000 468 62 11 11 468 62 468 74 +2 1 0 1 0 0 0 0 0.000 1 0 + 0 0 1.000 4.000 8.000 + 108 62 181 62 9999 9999 +2 1 0 1 0 0 0 0 0.000 1 0 + 0 0 1.000 4.000 8.000 + 216 62 249 62 9999 9999 +2 1 0 1 0 0 0 0 0.000 1 0 + 0 0 1.000 4.000 8.000 + 282 62 317 62 9999 9999 +2 1 0 1 0 0 0 0 0.000 1 0 + 0 0 1.000 4.000 8.000 + 350 62 384 62 9999 9999 +2 1 0 1 0 0 0 0 0.000 1 0 + 0 0 1.000 4.000 8.000 + 418 62 451 62 9999 9999 +3 0 0 1 0 0 0 0 0.000 1 0 + 0 0 1.000 4.000 8.000 + 329 74 289 104 229 109 199 94 194 79 9999 9999 +3 0 0 1 0 0 0 0 0.000 1 0 + 0 0 1.000 4.000 8.000 + 264 74 244 89 219 89 204 74 9999 9999 +3 0 0 1 0 0 0 0 0.000 1 0 + 0 0 1.000 4.000 8.000 + 256 73 234 79 210 73 9999 9999 +3 0 0 1 0 0 0 0 0.000 1 0 + 0 0 1.000 4.000 8.000 + 389 49 329 29 279 49 9999 9999 +3 0 0 1 0 0 0 0 0.000 1 0 + 0 0 1.000 4.000 8.000 + 394 44 353 16 259 24 214 53 9999 9999 +4 0 0 16 0 0 0 0.000 1 16 8 425 56 C +4 0 0 16 0 0 0 0.000 1 16 8 358 58 B +4 0 0 16 0 0 0 0.000 1 16 8 333 14 B +4 0 0 16 0 0 0 0.000 1 16 8 305 34 A +4 0 0 16 0 0 0 0.000 1 16 8 356 92 A +4 0 0 16 0 0 0 0.000 1 16 8 295 90 C +4 0 0 16 0 0 0 0.000 1 16 8 293 57 A +4 0 0 16 0 0 0 0.000 1 16 8 256 92 C +4 0 0 16 0 0 0 0.000 1 16 8 231 73 B +4 0 0 16 0 0 0 0.000 1 16 8 227 58 A +4 0 0 16 0 0 0 0.000 1 16 8 202 31 C +4 0 0 16 0 0 0 0.000 1 16 8 164 44 B +4 0 0 16 0 0 0 0.000 1 16 40 54 66 Start +4 0 0 16 0 0 0 0.000 1 16 8 197 66 1 +4 0 0 16 0 0 0 0.000 1 16 8 263 66 2 +4 0 0 16 0 0 0 0.000 1 16 8 333 66 3 +4 0 0 16 0 0 0 0.000 1 16 8 398 66 4 +4 0 0 16 0 0 0 0.000 1 16 8 467 66 * diff --git a/macros/latex/contrib/eepic/fig2eepic/epic-eg4.fig b/macros/latex/contrib/eepic/fig2eepic/epic-eg4.fig new file mode 100644 index 0000000000..cca46a6490 --- /dev/null +++ b/macros/latex/contrib/eepic/fig2eepic/epic-eg4.fig @@ -0,0 +1,72 @@ +#FIG 1.4 +80 2 +1 3 0 1 0 0 0 0 0.000 1 0.000 174 124 5 5 174 124 174 129 +1 3 0 1 0 0 0 0 0.000 1 0.000 209 169 5 5 209 169 209 174 +1 3 0 1 0 0 0 0 0.000 1 0.000 69 149 5 5 69 149 69 154 +1 3 0 1 0 0 0 0 0.000 1 0.000 129 241 5 5 129 241 129 246 +1 3 0 1 0 0 0 0 0.000 1 0.000 139 169 5 5 139 169 139 174 +1 3 0 1 0 0 0 0 0.000 1 0.000 223 241 5 5 223 241 223 246 +1 3 0 1 0 0 0 0 0.000 1 0.000 294 144 5 5 294 144 294 149 +1 3 0 1 0 0 0 0 0.000 1 0.000 219 84 5 5 219 84 219 89 +1 3 0 1 0 0 0 0 0.000 1 0.000 129 84 5 5 129 84 129 89 +2 1 1 1 0 0 0 0 4.000 1 0 + 0 0 1.000 4.000 8.000 + 222 230 212 179 9999 9999 +2 1 1 1 0 0 0 0 4.000 1 0 + 0 0 1.000 4.000 8.000 + 137 176 130 233 9999 9999 +2 1 1 1 0 0 0 0 4.000 1 0 + 0 0 1.000 4.000 8.000 + 213 241 138 241 9999 9999 +2 1 1 1 0 0 0 0 4.000 1 0 + 0 0 1.000 4.000 8.000 + 229 234 288 154 9999 9999 +2 1 1 1 0 0 0 0 4.000 1 0 + 0 0 1.000 4.000 8.000 + 200 171 150 171 9999 9999 +2 1 1 1 0 0 0 0 4.000 1 0 + 0 0 1.000 4.000 8.000 + 144 162 167 133 9999 9999 +2 1 1 1 0 0 0 0 4.000 1 0 + 0 0 1.000 4.000 8.000 + 203 161 179 133 9999 9999 +2 1 1 1 0 0 0 0 4.000 1 0 + 0 0 1.000 4.000 8.000 + 168 118 136 90 9999 9999 +2 1 0 1 0 0 0 0 0.000 1 0 + 0 0 1.000 4.000 8.000 + 73 157 122 233 9999 9999 +2 1 0 1 0 0 0 0 0.000 1 0 + 0 0 1.000 4.000 8.000 + 215 93 183 118 9999 9999 +2 1 0 1 0 0 0 0 0.000 1 0 + 0 0 1.000 4.000 8.000 + 78 151 129 166 9999 9999 +2 1 0 1 0 0 0 0 0.000 1 0 + 0 0 1.000 4.000 8.000 + 286 149 220 168 9999 9999 +2 1 0 1 0 0 0 0 0.000 1 0 + 0 0 1.000 4.000 8.000 + 227 88 288 137 9999 9999 +2 1 0 1 0 0 0 0 0.000 1 0 + 0 0 1.000 4.000 8.000 + 137 84 209 84 9999 9999 +2 1 0 1 0 0 0 0 0.000 1 0 + 0 0 1.000 4.000 8.000 + 124 90 76 142 9999 9999 +4 0 0 16 0 0 0 0.000 1 16 8 243 154 7 +4 0 0 16 0 0 0 0.000 1 16 8 96 152 6 +4 0 0 16 0 0 0 0.000 1 16 8 82 200 5 +4 0 0 16 0 0 0 0.000 1 16 8 205 112 4 +4 0 0 16 0 0 0 0.000 1 16 8 256 105 3 +4 0 0 16 0 0 0 0.000 1 16 8 88 110 2 +4 0 0 16 0 0 0 0.000 1 16 8 170 81 1 +4 0 0 16 0 0 0 0.000 1 16 8 134 159 I +4 0 0 16 0 0 0 0.000 1 16 8 208 159 H +4 0 0 16 0 0 0 0.000 1 16 8 171 113 G +4 0 0 16 0 0 0 0.000 1 16 8 49 156 F +4 0 0 16 0 0 0 0.000 1 16 8 125 261 E +4 0 0 16 0 0 0 0.000 1 16 8 220 260 D +4 0 0 16 0 0 0 0.000 1 16 8 305 146 C +4 0 0 16 0 0 0 0.000 1 16 8 217 74 B +4 0 0 16 0 0 0 0.000 1 16 8 123 75 A diff --git a/macros/latex/contrib/eepic/fig2eepic/fig2epic.1 b/macros/latex/contrib/eepic/fig2eepic/fig2epic.1 new file mode 100644 index 0000000000..a6bf42af4e --- /dev/null +++ b/macros/latex/contrib/eepic/fig2eepic/fig2epic.1 @@ -0,0 +1,205 @@ +.TH FIG2EPIC 1 "23 August 1988" +.SH NAME +fig2epic \- translates Fig intermediate code into EPIC or EEPIC macros +.SH SYNOPSIS +.B fig2epic +[ +.B \-S +.I scale +] [ +.B \-s +.I size +] [ +.B \-m +.I mag +] [ +.B \-F +.I fspec +] [ +.B \-L +.I lang +] [ +.B \-l +.I lwidth +] [ +.B \-c +.I cfg-file +] [ +.B \-v +] [ +\fIfig-file\fR [ \fItex-file\fR ] ] +.SH DESCRIPTION +.I Fig2epic +translates fig objects in the named +.I fig-file +into EPIC or EEPIC macros and puts them in +.I tex-file. +If a file name is presented, it is assumed to be the input file (fig +output file). The output file +.I (tex-file), +if not presented, will be the stdout. +If the +.I fig-file +is not presented, input will be assumed to come from the stdin. +The output from fig2epic can be edited to change font sizes/types. +.LP +Fig (Facility for Interactive Generation of figures) is a screen-oriented +tool which allows the user to draw and manipulate objects interactively. +It runs under the Suntools/Sunview window environment. +Fig2epic is compatible with Fig versions 1.3 and 1.4. +.LP +EPIC is an enhancement to LaTeX picture drawing environment. +It was developed by Sunil Podar of Department of Computer Science +in S.U.N.Y at Stony Brook. +.LP +EEPIC is an extension to EPIC and LaTeX picture drawing +environment. It was written by Conrad Kwok of Division of +Computer Science at University of California, Davis. +.SH OPTIONS +.TP +.B \-S +Set the scale at which the figure is rendered to. This option +automatically set the magnification and default font to +.I scale +/ 12 and +.I scale +-tt respectively. The font can be changed using \-F option. +The default is 12 and other valid options are 8, 9, 10 and 11. +.TP +.B \-s +Change the default font size to +.I size +.TP +.B \-m +Set the magnification at which the figure is rendered to +.I mag. +The default is 1.0 unless \-s option is used. +.TP +.B \-c +Use +.I cfg-file +as the configuration file. +.TP +.B \-F +Set the font specification command which precedes every text object in the +picture to +.I fspec. +This option, if specified, overrides any font changing commands. +The default is none. +Note that no "\\" is required in the font name. +.TP +.B \-l +Use "\fB\\thicklines\fR" when width of the line is wider than +.I lwidth. +The default is 2. +.TP +.B \-L +Use the specified language +.I lang +in the output. Default is EEPIC. Other valid options are EPIC and +EEPIC-EMU. EEPIC-EMU is for use with EEPIC emulation package. +.TP +.B \-v +Include comment in the output file. + +.SH LATEX MACROS +In order to include EPIC or EEPIC pictures into a document, it is +necssary to load the EPIC and EEPIC macros. It can be done by +including \fBEPIC\fR and \fBEEPIC\fR in \fB\\documentstyle\fR +option. See the EPIC or EEPIC manaul for details. + +.SH Configuration File +All the defaults in fig2epic can be changed using configuration +file. When fig2pic is executed, it will look for the files +specified in \-c option if any, +.I fig-file.cfg +(if +.I fig-file +is ended with ".fig", it will be replaced by ".cfg"), fig2epic.cfg +and $HOME/.fig2epic in the order specified above. The first +configuration file found will be used. + +.TP +.I LowerLeftX +This specify X coordinate of the lower left hand corner of the Fig +picture. Default is 0. +.TP +.I LowerLeftY +This specify Y coordinate of the lower left hand corner in unitlength of the Fig +picture. Default is 0. +.TP +.I TopMargin +Set the distance in unitlength of the figure from the top of the +LaTeX picture box. Default is 5. +.TP +.I BottomMargin +Set the distance in unitlength of the figure from the bottom of the +LaTeX picture box. Default is 10. +.TP +.I SegmentLength +The maximum segment length in inch used in generating splines +(for EPIC) and arc (for EPIC and EEPIC-EMU). Default is 0.0625 +inch. +.TP +.I TextFont +Set the font used for all text. This option overrides FontType +and FontSize. However, it is overrided by \-s, -S and -F options. +Note that no "\\" is required in the font name. +.TP +.I Magnification +Same as \-m option. Default is 1.0. +.TP +.I Verbose +Same as \-v. Default is FALSE +.TP +.I DotDistance +Dot distance in unitlength for dotted lines. +.TP +.I LineThick +Same as \-l. Default is 2. +.TP +.I Language +Same is -L. Default is EEPIC +.TP +.I DashScale +Scale the dash length. Default is 1.0. +.TP +.I EllipseCommand +Specify the command used in drawing an ellipse. Default is +ellipse for EEPIC or EEPIC-EMU. oval is always used for EPIC. Possible +values are ellipse and oval. +.TP +.I UseBox +Specify whether fig2epic should generate \\framebox and/or +\\dashbox command +in the output file or not. Default is not to use the *box +command. Possible options are none, solid, dash and both. +.TP +.I DashType +This option is only used when EPIC option is selected. Valid options +are "Normal" (use dashline in drawing dash lines), "Economic" +(use drawline with -50 stretch in drawing dash lines) and +"Dotted" (use dotted lines to replace dash lines). Default is +"Normal". "Normal" option will use up TeX memory quickly if long +dash lines are drawn. If you get "TeX Capacity Exceed" error, you should +try the "Economic" or "Dotted" option. +.TP +.I FontType +Selects one of the following font types as the default--Roman, +Bold, Italics, Modern and Typewriter. Default is Typewriter. +.TP +.I FontSize +Selects default font size in points. Default is 12. + +.SH "SEE ALSO" +fig(1), +EPIC manual, +EEPIC manual and TransFig manual +.SH AUTHOR +Conrad Kwok (kwok@iris.ucdavis.edu) +.br +University of California, Davis +.br +August 14, 1988 +.sp +modified from fig2latex, fig2tex and f2p. diff --git a/macros/latex/contrib/eepic/fig2eepic/makefile b/macros/latex/contrib/eepic/fig2eepic/makefile new file mode 100644 index 0000000000..6574890b8d --- /dev/null +++ b/macros/latex/contrib/eepic/fig2eepic/makefile @@ -0,0 +1,35 @@ +# Fig2epic : FIG to EPIC translator +# +# Conrad Kwok +# Modified from fig2pic which was modified from f2ps +# + +SRCDIR = ../src +SRCLIB = $(SRCDIR)/lib.a + +LIBS = -lm +# +# Use of gcc is recommended whenever available. +# -Inlcude DNoVPRINTF in CFLAGS if vprintf is not included in the library +# Include -DNoConfigFile and remove config.* if no configuration +# file is desired. +# +CFLAGS = -O $(CROSS) +CC = gcc $(CFLAGS) -I$(SRCDIR) + +fig2epic : fig2epic.o config.o $(SRCLIB) + $(CC) fig2epic.o config.o $(SRCLIB) -lm -o fig2epic + +# Include: +# -DINT32BIT when int is 32 bits long +# -DOldFashion when compiled using cc on Ultrix and BSD 4.x +config.o : config.c + $(CC) -DINT32BIT -c config.c + +$(SRCLIB): + (cd ../src; make) + +######### +clean : + rm -f *.o fig2epic core + diff --git a/macros/latex/contrib/eepic/fig2eepic/readme b/macros/latex/contrib/eepic/fig2eepic/readme new file mode 100644 index 0000000000..cc351f72e6 --- /dev/null +++ b/macros/latex/contrib/eepic/fig2eepic/readme @@ -0,0 +1,28 @@ +fig2epic V1.0a supports Fig-TFX codes in changing font type and font +sizes. It also supports black filled for cirlce and ellipse. You +need to have the Transfig package in order to compile fig2epic. +Transfig can be obtained from svax.cs.cornell.edu + +EPIC can be obtained from cs.rochester.edu in +public/latex-style/eepic.shar[12] and EEPIC can be obained from +iris.ucdavis.edu[128.120.57.20] in pub/EEPIC10.shar using +anonymous ftp. + +When the configuration file option is included in the +compilation, the new ANSI keyword "void" is used. If your +compiler does not support the "void" type, you will get 30+ +warning about "illegal pointer combination" or similar messages. +However, the program should still work. + +fig2epic has been tested on BSD 4.3, SUN OS 3.4, Ultrix 2.1 and +Encore Umax 4.2 + +Bugs report, suggestions and comments are always welcome. + +Conrad Kwok + +internet: kwok@iris.ucdavis.edu +csnet : kwok@ucd.csnet +csnet : kwok%iris.ucdavis.edu@csnet.relay +uucp : {ucbvax, uunet, ... }!ucdavis!iris!kwok + diff --git a/macros/latex/contrib/eepic/grafig.shar b/macros/latex/contrib/eepic/grafig.shar new file mode 100644 index 0000000000..11158b0b6a --- /dev/null +++ b/macros/latex/contrib/eepic/grafig.shar @@ -0,0 +1,535 @@ +#! /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 +# Makefile +# grafig.1 +# object.h +# grafig.c +# This archive created: Wed Mar 15 16:57:30 1989 +export PATH; PATH=/bin:$PATH +if test -f 'README' +then + echo shar: will not over-write existing file "'README'" +else +cat << \SHAR_EOF > 'README' +GraFig 0.0 is a "trial balloon" program which creates very simple +graphs from numerical data. It is completely rigid in its operation, +with NO options or features. I am distributing it for several reasons: + + 1) To find out whether there is a need for a fancier + version of such a program in the user community. + + 2) To find out what the important features of such + a program would be. + + 3) To demonstrate how easy it is to write a small + program which produces graphics in the form of Fig code. + (GraFig 0.0 took only several hours to write). + +I am interested in hearing back from ANY user who is interested in +this program, even (especially) if you cannot use it because of lack +of features. I am considering development of a much fancier tool +for the analysis/plotting of data, with an interactive graphical +interface. + +Please note: the output of GraFig can be edited using any of the +existing versions of Fig, so you can do a lot of pretty-ing up +of the graphs by hand. This program is meant to be minimal, in +order to get design suggestions for a more mature version. +------- +Update 3/15/89 + +The GnuTeX version of the GnuPlot numerical plotting program can now +generate Fig code. Thus, it has many features one would want in a more +mature version of GraFig. GnuTeX is available via anonymous TFP +from duke.cs.duke.edu. For more information about GnuTeX, contact +David Kotz (dfk@cs.duke.edu). +SHAR_EOF +fi # end of overwriting check +if test -f 'Makefile' +then + echo shar: will not over-write existing file "'Makefile'" +else +cat << \SHAR_EOF > 'Makefile' +SHAR = ../../shar/shar +SHARFILES = README Makefile grafig.1 object.h grafig.c + +grafig: object.h grafig.c + cc -O -o grafig grafig.c -lm + + +shar: ${SHARFILES} + ${SHAR} ${SHARFILES} >../grafig.shar +SHAR_EOF +fi # end of overwriting check +if test -f 'grafig.1' +then + echo shar: will not over-write existing file "'grafig.1'" +else +cat << \SHAR_EOF > 'grafig.1' +.TH GRAFIG 1 "1 Februrary 1989" + +.SH NAME +grafig \- generates numerical graphs in Fig code + +.SH SYNOPSIS +.B grafig <data_stream >fig_code + +.SH DESCRIPTION +.I Grafig +transforms a stream of data points on its standard input to +a numerical graph on its standard output. +The input is in the form of pairs of numbers representing +x and y coordinates, seperated by white space. +Thus, the set of points {(x1, y1), (x2, y2), ...} could represented +by the input file +.sp +x1 y1 +.br +x2 y2 + ... +.sp +The output is in the form of +.I Fig +code, which can be viewed and edited with the fig(1) graphics editor, +and can be incorporated into TeX(1) troff(1), or PostScript documents +using the TransFig(1) translation package. +.PP +This early version of grafig takes NO options or flags. +The output has only one possible form. + +.SH "SEE ALSO" +fig(1), +tex(1), +transfig(1), +troff(1), +.SH AUTHOR +Micah Beck (beck@svax.cs.cornell.edu) +SHAR_EOF +fi # end of overwriting check +if test -f 'object.h' +then + echo shar: will not over-write existing file "'object.h'" +else +cat << \SHAR_EOF > 'object.h' +/* + * FIG : Facility for Interactive Generation of figures + * + * (c) copy right 1985 by Supoj Sutanthavibul (supoj@sally.utexas.edu) + * January 1985. + * 1st revision : Aug 1985. + * 2nd revision : Feb 1988. + * + * %W% %G% +*/ +#define DEFAULT (-1) + +typedef struct f_pattern { + int w, h; + int *p; + } + F_pattern; + +typedef struct f_pen { + int x, y; + int *p; + } + F_pen; + +typedef struct f_point { + int x, y; + struct f_point *next; + } + F_point; + +typedef struct f_pos { + int x, y; + } + F_pos; + +typedef struct f_arrow { + int type; + int style; + double thickness; + double wid; + double ht; + } + F_arrow; + +typedef struct f_ellipse { + int type; +#define T_ELLIPSE_BY_RAD 1 +#define T_ELLIPSE_BY_DIA 2 +#define T_CIRCLE_BY_RAD 3 +#define T_CIRCLE_BY_DIA 4 + int style; + int thickness; + int color; +#define BLACK 0 + int depth; + int direction; + double style_val; + double angle; + struct f_pen *pen; + struct f_pattern *area_fill; +#define UNFILLED (F_pattern *)0 +#define BLACK_FILL (F_pattern *)1 +#define DARK_GRAY_FILL (F_pattern *)2 +#define MED_GRAY_FILL (F_pattern *)3 +#define LIGHT_GRAY_FILL (F_pattern *)4 +#define WHITE_FILL (F_pattern *)4 + struct f_pos center; + struct f_pos radiuses; + struct f_pos start; + struct f_pos end; + struct f_ellipse *next; + } + F_ellipse; + +typedef struct f_arc { + int type; +#define T_3_POINTS_ARC 1 + int style; + int thickness; + int color; + int depth; + struct f_pen *pen; + struct f_pattern *area_fill; + double style_val; + int direction; + struct f_arrow *for_arrow; + struct f_arrow *back_arrow; + struct {double x, y;} center; + struct f_pos point[3]; + struct f_arc *next; + } + F_arc; + +typedef struct f_line { + int type; +#define T_POLYLINE 1 +#define T_BOX 2 +#define T_POLYGON 3 + int style; + int thickness; + int color; + int depth; + double style_val; + struct f_pen *pen; + struct f_pattern *area_fill; + struct f_arrow *for_arrow; + struct f_arrow *back_arrow; + struct f_point *points; + struct f_line *next; + } + F_line; + +typedef struct f_text { + int type; +#define T_LEFT_JUSTIFIED 0 +#define T_CENTER_JUSTIFIED 1 +#define T_RIGHT_JUSTIFIED 2 + int font; +#define DEFAULT_FONT 0 +#define ROMAN_FONT 1 +#define BOLD_FONT 2 +#define ITALIC_FONT 3 +#define MODERN_FONT 4 +#define TYPEWRITER_FONT 5 + int size; /* point size */ + int color; + int depth; + double angle; /* in radian */ + int style; +#define PLAIN 1 +#define ITALIC 2 +#define BOLD 4 +#define OUTLINE 8 +#define SHADOW 16 + int height; /* pixels */ + int length; /* pixels */ + int base_x; + int base_y; + struct f_pen *pen; + char *cstring; + struct f_text *next; + } + F_text; + +typedef struct f_control { + double lx, ly, rx, ry; + struct f_control *next; + } + F_control; + +#define int_spline(s) (s->type & 0x2) +#define normal_spline(s) (!(s->type & 0x2)) +#define closed_spline(s) (s->type & 0x1) +#define open_spline(s) (!(s->type & 0x1)) + +typedef struct f_spline { + int type; +#define T_OPEN_NORMAL 0 +#define T_CLOSED_NORMAL 1 +#define T_OPEN_INTERPOLATED 2 +#define T_CLOSED_INTERPOLATED 3 + int style; + int thickness; + int color; + int depth; + double style_val; + struct f_pen *pen; + struct f_pattern *area_fill; + struct f_arrow *for_arrow; + struct f_arrow *back_arrow; + /* + For T_OPEN_NORMAL and T_CLOSED_NORMAL points + are control points while they are knots for + T_OPEN_INTERPOLATED and T_CLOSED_INTERPOLTED + whose control points are stored in controls. + */ + struct f_point *points; + struct f_control *controls; + struct f_spline *next; + } + F_spline; + +typedef struct f_compound { + struct f_pos nwcorner; + struct f_pos secorner; + struct f_line *lines; + struct f_ellipse *ellipses; + struct f_spline *splines; + struct f_text *texts; + struct f_arc *arcs; + struct f_compound *compounds; + struct f_compound *next; + } + F_compound; + +#define ARROW_SIZE sizeof(struct f_arrow) +#define POINT_SIZE sizeof(struct f_point) +#define CONTROL_SIZE sizeof(struct f_control) +#define ELLOBJ_SIZE sizeof(struct f_ellipse) +#define ARCOBJ_SIZE sizeof(struct f_arc) +#define LINOBJ_SIZE sizeof(struct f_line) +#define TEXOBJ_SIZE sizeof(struct f_text) +#define SPLOBJ_SIZE sizeof(struct f_spline) +#define COMOBJ_SIZE sizeof(struct f_compound) + +/********************** object codes **********************/ + +#define O_ELLIPSE 1 +#define O_POLYLINE 2 +#define O_SPLINE 3 +#define O_TEXT 4 +#define O_ARC 5 +#define O_COMPOUND 6 +#define O_END_COMPOUND (-O_COMPOUND) +#define O_ALL_OBJECT 99 + +/************ object styles (except for f_text) ************/ + +#define SOLID_LINE 0 +#define DASH_LINE 1 +#define DOTTED_LINE 2 + +#define CLOSED_PATH 0 +#define OPEN_PATH 1 +SHAR_EOF +fi # end of overwriting check +if test -f 'grafig.c' +then + echo shar: will not over-write existing file "'grafig.c'" +else +cat << \SHAR_EOF > 'grafig.c' +/* + * GraFig 0.0 - Generates Numerical Graphs in Fig Code + * + * Author: Micah Beck + * (email: beck@cs.cornell.edu) + * Dept. of Computer Science + * Cornell University + * + * Version 0.0: February 1, 1989 + */ +#include <stdio.h> +#include "object.h" + +#define FIG_MAGIC "#FIG 1.4" +#define RES 80 +#define COORD_SYS 2 + +#define MAX_DATA 1000 + +#define MARK_SIZE .05 +#define TIC_SIZE .1 +#define NUM_OFF_X .5 +#define NUM_OFF_Y .25 + +#define orig_x 1.0 +#define orig_y 9.0 +#define length_x 5.0 +#define length_y 5.0 + +extern double pow(), floor(), log10(); + +struct datapt {double x, y} dataset[MAX_DATA], *datasort[MAX_DATA]; + +main(argc,argv) +int argc; +char **argv; +{ + int i, c, data_size, datacmp(); + double tic(); + double max_x, max_y, min_x, min_y; + double dx, dy; + double tic_x, tic_y, w; + + /* read data */ + for (data_size=0, c=2; data_size<MAX_DATA-1 && c == 2; data_size++) + c = scanf("%lf %lf", &dataset[data_size].x, &dataset[data_size].y); + + if (c == EOF) + --data_size; + else + if (c != 2) + error("bad data format"); + else + error("data set truncated"); + + if (data_size == 0) error("no data!"); + + /* calculate maxima */ + max_x = max_y = dataset[0].x; + for (i=1; i<data_size; i++) { + if (max_x < dataset[i].x) max_x = dataset[i].x; + if (max_y < dataset[i].y) max_y = dataset[i].y; + } + + /* calculate scaling factors */ + dx = length_x / max_x; + dy = length_y / max_y; + + /* print FIG header */ + printf("%s\n", FIG_MAGIC); + printf("%d %d\n", RES, COORD_SYS); + + /* draw axes */ + fig_comment("Graph Axes"); + fig_line(orig_x, orig_y, orig_x+length_x, orig_y); + fig_line(orig_x, orig_y, orig_x, orig_y-length_y); + + /* plot data points */ + fig_comment("Data Points"); + for (i=0; i<data_size; i++) { + + dataset[i].x = orig_x + (dataset[i].x * dx); + dataset[i].y = orig_y - (dataset[i].y * dy); + + fig_line(dataset[i].x-MARK_SIZE, dataset[i].y, + dataset[i].x+MARK_SIZE, dataset[i].y); + fig_line(dataset[i].x, dataset[i].y-MARK_SIZE, + dataset[i].x, dataset[i].y+MARK_SIZE); + } + + fig_comment("Data Curve"); + qsort((char *)dataset, data_size, sizeof(struct datapt), datacmp); + fig_plot(dataset, data_size); + + /* draw tic marks with numbering */ + fig_comment("Axis Numbering"); + tic_x = tic(max_x); + tic_y = tic(max_y); + + for (i=1; (i*tic_x)<=max_x; i++) { + w = orig_x + i*tic_x*dx; + fig_line(w, orig_y, w, orig_y+TIC_SIZE); + fig_number(w, orig_y+NUM_OFF_Y, i*tic_x); + } + for (i=1; (i*tic_y)<=max_y; i++) { + w = orig_y - i*tic_y* dy; + fig_line(orig_x, w, orig_x-TIC_SIZE, w); + fig_number(orig_x-NUM_OFF_X, w, i*tic_y); + } +} + +error(s) +char *s; +{ + fprintf(stderr, "grafig: %s\n", s); + exit(1); +} + +double tic(r) +double r; +{ + double t; + + t = pow(10.0, floor(log10(r))); + if (2*t>r) return t/10; + else return t; +} + +datacmp(a, b) +struct datapt *a, *b; +{ + if (a->x < b->x) return -1; + if (a->x > b->x) return 1; + return 0; +} + +/* + * Fig Code Generating Routines + */ +fig_comment(str) +char *str; +{ + printf("#\n# %s\n#\n", str); +} + +fig_line(ax, ay, bx, by) +double ax, ay, bx, by; +{ + printf("%d %d %d %d %d %d %d %d %6.3f %d %d\n", + O_POLYLINE, T_POLYLINE, + SOLID_LINE, 1, DEFAULT, DEFAULT, DEFAULT, DEFAULT, 0.0, + 0, 0); + printf("%.0f %.0f %.0f %.0f 9999 9999\n", + ax*RES, ay*RES, bx*RES, by*RES); +} + +fig_plot(dp, ds) +struct datapt *dp; +int ds; +{ + int i; + + printf("%d %d %d %d %d %d %d %d %6.3f %d %d\n", + O_POLYLINE, T_POLYLINE, + SOLID_LINE, 1, DEFAULT, DEFAULT, DEFAULT, DEFAULT, 0.0, + 0, 0); + for (i=0; i<ds; i++) + printf("%.0f %.0f ", dp[i].x*RES, dp[i].y*RES); + + printf("9999 9999\n"); +} + +fig_number(x, y, num) +double x, y, num; +{ + char buf[10]; + + sprintf(buf, "%6lg", num); + printf("%d %d %d %d %d %d %d %6.3f %d %d %d %.0lf %.0lf %s\01\n", + O_TEXT, T_LEFT_JUSTIFIED, + DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, 0.0, DEFAULT, + 16, 8*strlen(buf), x*RES, y*RES, buf); +} +SHAR_EOF +fi # end of overwriting check +# End of shell archive +exit 0 |