dfk@romeo.cs.duke.edu (David F. Kotz) (03/21/89)
Common subdirectories: ../gnutex.old/Help and ./Help diff -cr ../gnutex.old/Makefile ./Makefile *** ../gnutex.old/Makefile Fri Feb 10 12:12:21 1989 --- ./Makefile Mon Mar 20 22:04:20 1989 *************** *** 1,3 **** --- 1,4 ---- + #------------------------------------------------------------------ # Makefile for gnutex # A plotting program supporting LaTeX output # David Kotz *************** *** 25,32 **** INDEX=-DINDEX=index #INDEX=-DINDEX=strchr # -DVFORK iff vfork() supported ! CFLAGS = -DVFORK $(INDEX) # -D<terminal> only if you wish to support <terminal> # -DAED Aed767 --- 26,38 ---- INDEX=-DINDEX=index #INDEX=-DINDEX=strchr + # Define this for production version + EXTRA=-O -s + # For the debugging version + #EXTRA=-g + # -DVFORK iff vfork() supported ! CFLAGS = -DVFORK $(INDEX) $(EXTRA) # -D<terminal> only if you wish to support <terminal> # -DAED Aed767 *************** *** 39,49 **** # -DPC IBM PC EGA/CGA graphics # -DPC -DCORONA IBM PC Corona graphics # -DLATEX LaTeX output # -DIMAGEN Imagen printer output (also use -Idir, where dir is the # location of imPcodes.h) ! TERMFLAGS = -DTEK -DUNIXPLOT -DLATEX -DIMAGEN -I.. ! #TERMFLAGS = -DLATEX -DIMAGEN -I.. # Your favorite tags program TAGS=etags --- 45,56 ---- # -DPC IBM PC EGA/CGA graphics # -DPC -DCORONA IBM PC Corona graphics # -DLATEX LaTeX output + # -DFIG FIG output # -DIMAGEN Imagen printer output (also use -Idir, where dir is the # location of imPcodes.h) ! TERMFLAGS = -DTEK -DUNIXPLOT -DLATEX -DFIG -DIMAGEN -I.. ! #TERMFLAGS = -DFIG -DLATEX # Your favorite tags program TAGS=etags *************** *** 71,77 **** cp gnutex.help $(HELPFILE) gnutex: $(OBJS) ! cc $(CFLAGS) -O -s $(OBJS) $(LIBS) -o gnutex -lm term.o: term.c cc $(CFLAGS) $(TERMFLAGS) -c term.c --- 78,84 ---- cp gnutex.help $(HELPFILE) gnutex: $(OBJS) ! cc $(CFLAGS) $(FINAL) $(OBJS) $(LIBS) -o gnutex -lm term.o: term.c cc $(CFLAGS) $(TERMFLAGS) -c term.c *************** *** 93,99 **** # Make a patch file, diffing this directory with ../gnutex.old # To apply the patch, use patch -p < ../gnutex.patch ! patch: -diff -cr ../gnutex.old . > ../gnutex.patch TAGS: $(SRC) --- 100,108 ---- # Make a patch file, diffing this directory with ../gnutex.old # To apply the patch, use patch -p < ../gnutex.patch ! patch: spotless ! echo -n > FIRST ! rm -f doc/manual/gnutex.dvi -diff -cr ../gnutex.old . > ../gnutex.patch TAGS: $(SRC) diff -cr ../gnutex.old/Makefile.vms ./Makefile.vms *** ../gnutex.old/Makefile.vms Mon Mar 20 22:01:40 1989 --- ./Makefile.vms Wed Mar 1 20:43:34 1989 *************** *** 0 **** --- 1,80 ---- + #------------------------------------------------------------------ + # Makefile for gnutex v1.5 for VMS + # + # A plotting program supporting LaTeX output + # David Kotz + # Duke University + # dfk@cs.duke.edu + # + # derived from gnuplot, originally by Colin Kelley and Thomas Williams + # + # VMS makefile provided by C.S. Henkel (henkel%ne@ncsuvx.ncsu.edu) + # + # Please read README.VMS + + # + # Adjust some of the items below, as necessary, and type 'make', if you + # have a VMS version of the make program. Else, just use this file as a + # template for the steps you'll have to do by hand. + # + + # The name of a logical name pointing to the help file. + # Define the logical gnutex$help to point to the "gnutex.help" file, + # or, just hardwire it's name right here, like this: + #HELPLOGICAL = disk:[directory]GNUTEX.HELP + # If you use a logical, you can port the executable to other VMS + # machines without much hassle. Note: $$ collapses to $ in the following: + HELPLOGICAL = gnutex$$help + COMMANDFLAGS="HELPFILE=""$(HELPLOGICAL)""" + + CFLAGS = "INDEX=strchr" + + # <terminal> only if you wish to support <terminal> + # AED Aed767 + # HP75 HP7580, and probably other HPs + # QMS QMS/QUIC laserprinter (Talaris 1200 and others) + # REGIS ReGis graphics (vt220, vt240, Gigis...) + # TEK Tektronix 4010, and probably others + # HALFTEK Tektronix 4010 (top/bottom half of screen) + # UNIXPLOT unixplot ! You're on your own here -CSH + # PC IBM PC EGA/CGA graphics + # PC CORONA IBM PC Corona graphics + # LATEX LaTeX output + # IMAGEN Imagen printer output (also use -Idir, where dir is the + # location of imPcodes.h) + + TERMFLAGS = TEK,REGIS,HP75,LATEX + + OBJS = plot.obj,scanner.obj,parse.obj,command.obj,eval.obj,standard.obj,\ + internal.obj,util.obj,graphics.obj,term.obj,misc.obj,help.obj,\ + version.obj + + # Defined, but not used: + SRC = command.c eval.c graphics.c internal.c misc.c parse.c \ + plot.c scanner.c standard.c term.c util.c Help/help.c version.c + + all: gnutex + + gnutex: $(OBJS) + define/nolog/table=lnm$$job lnk$$library sys$$library:vaxcrtl + define/nolog/table=lnm$$job lnk$$library_1 sys$$library:vaxcrtlg + link/exe=gnutex $(OBJS) + + .c.obj: + cc/define=($(CFLAGS)) $< + + term.obj: term.c + cc/define=($(CFLAGS),$(TERMFLAGS)) term.c + + command.obj: command.c + define/nolog/table=lnm$$job c$$include "[.help]" + cc/define=($(CFLAGS),$(COMMANDFLAGS)) command.c + + help.obj: [.help]help.c [.help]help.h + cc/define=($(CFLAGS)) [.help]help.c + + clean: + delete/nolog *.obj;* + + $(OBJS): plot.h + diff -cr ../gnutex.old/PATCHLEVEL ./PATCHLEVEL *** ../gnutex.old/PATCHLEVEL Wed Feb 1 11:24:36 1989 --- ./PATCHLEVEL Mon Mar 13 19:18:05 1989 *************** *** 1 **** ! 5 --- 1 ---- ! 6 Only in ../gnutex.old: Patch5-rm diff -cr ../gnutex.old/README ./README *** ../gnutex.old/README Wed Feb 1 18:01:33 1989 --- ./README Mon Mar 13 19:58:59 1989 *************** *** 1,28 **** ! This directory contains the sources for gnuplot, a general-purpose plotting program, as modified by David Kotz at Duke University in 1987-1988. At this point it is likely out of date with the current version of gnuplot; I may try to synchronize them someday, but the mods for Latex support and other support are significant. I have generally tried to retain the style of the original and to modify as ! little as possible to make this possible. This version should compile successfully on Vaxes, Suns, Microvaxes, ! IBM PCs, and HP-UX (a System V box). It also may work on VMS. ! I have not tried compiling this for VMS, and only use the Latex and ! Tektronix drivers. - Documentation is in - gnutex.1 - man page for gnutex - doc - documentation and examples about LATEX additions - help - help files for gnuplot and gnutex - - Sample gnutex input files are "try" and "try.tek" (a non-LATEX - version). Type "gnutex<try" then "latex pic" to see what it looks - like. - lasergnu is a system-dependent shell script to gnutex a simple plot ! and send it to the textronix-compatible imagen laser printer. Good luck. PLEASE send comments, suggestions, bugs etc to dfk@cs.duke.edu. I make --- 1,20 ---- ! This directory contains the sources for gnutex, a general-purpose plotting program, as modified by David Kotz at Duke University in 1987-1988. At this point it is likely out of date with the current version of gnuplot; I may try to synchronize them someday, but the mods for Latex support and other support are significant. I have generally tried to retain the style of the original and to modify as ! little as possible to make this possible. This version should compile successfully on Vaxes, Suns, Microvaxes, ! IBM PCs, and HP-UX (a System V box). See other READMEs. ! Documentation is in the doc directory, including man pages. A user ! manual is in doc/manual/. Sample gnutex input files can be found in ! doc/example/. lasergnu is a system-dependent shell script to gnutex a simple plot ! and send it to the Textronix-compatible Imagen laser printer. Good luck. PLEASE send comments, suggestions, bugs etc to dfk@cs.duke.edu. I make *************** *** 30,39 **** patches as things change. I consider this program to still be developing. ! MAILINGS: If you want to be on my gnutex mailing list send me a note ! with a good return address. This is not a two-way mailing list; I'm ! not going to moderate a group here! This will provide a way for me to ! announce updates and poll the users about things. COPYRIGHT: You may use this program as you wish, as far as I'm concerned, and --- 22,32 ---- patches as things change. I consider this program to still be developing. ! MAILINGS: ! If you want to be on my gnutex mailing list send me a note with a good ! return address. This is not a two-way mailing list; I'm not going to ! moderate a group here! This will provide a way for me to announce ! updates and poll the users about things. COPYRIGHT: You may use this program as you wish, as far as I'm concerned, and *************** *** 40,50 **** as long as you follow the usage statement given by the gnuplot authors in each file. ! THANKS: ! Thanks to many people who have pointed out bugs and made suggestions, ! including Bob Desinger, Paul E. McKenney, and J. D. McDonald; to ! bd@hp-sde.sde.hp.com, for the help-file code; and to the local users ! who put up with the newest bugs. PATCHES: patch1: Enhancement to add "set format" command. See help/set-show/format. --- 33,43 ---- as long as you follow the usage statement given by the gnuplot authors in each file. ! THANKS: ! Thanks to many people who have pointed out bugs, made suggestions, and ! sent additions, including Bob Desinger, Paul E. McKenney, J. D. ! McDonald, and Micah Beck; to bd@hp-sde.sde.hp.com, for the help-file ! code; and to the local users who put up with the newest bugs. PATCHES: patch1: Enhancement to add "set format" command. See help/set-show/format. *************** *** 54,62 **** but ".gnutex". patch4: Mostly changes to make it work on an IBM PC. patch5: Some bug fixes, System V support, Imagen support. David Kotz ! November 4, 1988 Department of Computer Science, Duke University, Durham, NC 27706 ARPA: dfk@cs.duke.edu CSNET: dfk@duke --- 47,56 ---- but ".gnutex". patch4: Mostly changes to make it work on an IBM PC. patch5: Some bug fixes, System V support, Imagen support. + patch6: Small changes to accomodate wierd systems, FIG support. David Kotz ! March 13, 1989 Department of Computer Science, Duke University, Durham, NC 27706 ARPA: dfk@cs.duke.edu CSNET: dfk@duke diff -cr ../gnutex.old/README.FIG ./README.FIG *** ../gnutex.old/README.FIG Mon Mar 20 22:01:26 1989 --- ./README.FIG Mon Mar 13 18:27:44 1989 *************** *** 0 **** --- 1,33 ---- + Please send all correspondence regarding the GnuTeX FIG driver to + David Kotz (dfk@cs.duke.edu), not to Micah. + + - I have set the resolution of the Fig file to 80 pixels/in, which + is what the Fig editors require. However, it can be set higher, and the + TransFig back end can handle higher resolution. This can be done by setting + the FIG_RES symbol, eg "-DFIG_RES=300". + + - It uses centered and right-justified text, which are not handled properly + by Fig 1.4.2, but is handled properly by Fig-FS and TransFig. + + - It requires the Fig header file "object.h", which is included in + TransFig and in Fig-FS. It is included in the GnuTeX distribution, + copied from TransFig Version 1.4-TFX Release 3a. + + - Note that multiple-line titles and axis labels (using \\) does not + work as it does with latex output, at least when using fig2epic for + output. + + - the font style used for all of the text can be specified on the + fig2{epic,tex,latex} command line, so you can change it if you don't + like the default. + + Thanks to Micah Beck for providing this driver. + Date: Mon, 13 Mar 89 13:23:39 -0500 + From: beck@svax.cs.cornell.edu (Micah Beck) + + TO OBTAIN TRANSFIG: + TransFig is available via anonymous FTP from svax.cs.cornell.edu in + ~ftp/pub/fig/transfig.tar.Z It is also available by mail from the Clarkson + archive server, and will soon be available from the Rice server as well. + Note that a new version (release 4) is expected in late March 1989. + diff -cr ../gnutex.old/README.VMS ./README.VMS *** ../gnutex.old/README.VMS Mon Mar 20 22:01:22 1989 --- ./README.VMS Wed Mar 1 20:56:08 1989 *************** *** 0 **** --- 1,20 ---- + Use the Makefile Makefile.vms if you have a make for VMS; otherwise + use it as a template for the manual compilation. + + Comments from VMS users: + + - Be sure to "$set term/nowrap" before using gnutex. + -C.S. Henkel henkel%ne@ncsuvx.ncsu.edu + + - When using the REGIS terminal type, the resulting output file is + sometimes too large to type out. The error says something like: + + $ type plot.regis + 44800 byte record too large for user's buffer + Invalid record size + + I suppose there's some problem with the file attributes, but I + don't know how they need to be modified; much less how to modify + them. + -C.S. Henkel henkel%ne@ncsuvx.ncsu.edu + diff -cr ../gnutex.old/README.sun4 ./README.sun4 *** ../gnutex.old/README.sun4 Tue Jan 10 10:35:33 1989 --- ./README.sun4 Mon Mar 13 19:10:40 1989 *************** *** 1,4 **** ! Please note that (at least in some versions of the Sun4 compiler or stdio library), the following bugs exist. BUG #1: This causes axes labels (in LATEX) and the plot ranges (the -l --- 1,4 ---- ! Please note that (at least in some versions of the Sun compiler or stdio library), the following bugs exist. BUG #1: This causes axes labels (in LATEX) and the plot ranges (the -l *************** *** 50,56 **** script done on Wed Nov 30 13:57:22 1988 ---------------------------------------------------------------------- ! BUG #2: The sscanf routine incorrectly parses "00 12" with the format "%f %f" and reads 0 and 0 instead of 0 and 12. This affects data input. If your data file contains x coordinates that are zero but are specified like '00' or '000' etc, then you wil read the wrong y --- 50,57 ---- script done on Wed Nov 30 13:57:22 1988 ---------------------------------------------------------------------- ! BUG #2: Happens on Sun4 Sys4-3.2, Sun3 and Sun4 SunOS 4.0 ! The sscanf routine incorrectly parses "00 12" with the format "%f %f" and reads 0 and 0 instead of 0 and 12. This affects data input. If your data file contains x coordinates that are zero but are specified like '00' or '000' etc, then you wil read the wrong y diff -cr ../gnutex.old/command.c ./command.c *** ../gnutex.old/command.c Thu Feb 2 13:09:30 1989 --- ./command.c Wed Mar 8 14:26:37 1989 *************** *** 252,258 **** if (is_definition(c_token)) define(); ! else if (equals(c_token,"help") || equals(c_token,"?")) { c_token++; len = 0; while (!(END_OF_COMMAND)) { --- 252,258 ---- if (is_definition(c_token)) define(); ! else if (almost_equals(c_token,"h$elp") || equals(c_token,"?")) { c_token++; len = 0; while (!(END_OF_COMMAND)) { *************** *** 1032,1038 **** int styles[MAX_KEYS+1]; /* the style for each plot */ char *text[MAX_KEYS+1]; /* text of each key entry */ int style; ! int entry = 0; /* x coordinate */ const_express(&a); --- 1032,1038 ---- int styles[MAX_KEYS+1]; /* the style for each plot */ char *text[MAX_KEYS+1]; /* text of each key entry */ int style; ! int curve = 0; /* index of the entry */ /* x coordinate */ const_express(&a); *************** *** 1049,1056 **** do { /* scan the entries in the key */ /* text */ if (isstring(c_token)) { ! text[entry] = (char *) malloc(MAX_ID_LEN); ! quote_str(text[entry], c_token++); } else int_error("expecting text of the key entry", c_token); --- 1049,1056 ---- do { /* scan the entries in the key */ /* text */ if (isstring(c_token)) { ! text[curve] = (char *) malloc(MAX_ID_LEN); ! quote_str(text[curve], c_token++); } else int_error("expecting text of the key entry", c_token); *************** *** 1066,1072 **** int_error("unknown plot style; type 'show style'", c_token); else ! styles[entry] = style; c_token++; if (!END_OF_COMMAND) --- 1066,1072 ---- int_error("unknown plot style; type 'show style'", c_token); else ! styles[curve] = style; c_token++; if (!END_OF_COMMAND) *************** *** 1075,1091 **** else c_token++; ! entry++; ! if (entry > MAX_KEYS) int_error("too many lines in the key", c_token); } while (!END_OF_COMMAND); ! text[entry] = NULL; /* acts as terminator */ do_key (x,y, styles, text); ! for (entry--; entry >= 0; entry--) ! free(text[entry]); } --- 1075,1091 ---- else c_token++; ! curve++; ! if (curve > MAX_KEYS) int_error("too many lines in the key", c_token); } while (!END_OF_COMMAND); ! text[curve] = NULL; /* acts as terminator */ do_key (x,y, styles, text); ! for (curve--; curve >= 0; curve--) ! free(text[curve]); } *************** *** 1120,1126 **** int plot_num; { static char data_file[MAX_ID_LEN+1], line[MAX_LINE_LEN+1]; ! register int i, l_num; register FILE *fp; float x, y; --- 1120,1126 ---- int plot_num; { static char data_file[MAX_ID_LEN+1], line[MAX_LINE_LEN+1]; ! register int i, l_num, datum; register FILE *fp; float x, y; *************** *** 1130,1136 **** os_error("can't open data file", c_token); l_num = 0; ! i = 0; while (fgets(line, MAX_LINE_LEN, fp)) { l_num++; --- 1130,1136 ---- os_error("can't open data file", c_token); l_num = 0; ! datum = 0; i = 0; while (fgets(line, MAX_LINE_LEN, fp)) { l_num++; *************** *** 1146,1179 **** switch (sscanf(line, "%f %f", &x, &y)) { case 1: /* only one number on the line */ y = x; /* assign that number to y */ ! x = i; /* and make the index into x */ /* no break; !!! */ case 2: if ( (autoscale_lx || (x >= xmin && x <= xmax)) && (autoscale_ly || (y >= ymin && y <= ymax))) { if (log_x) { if (x <= 0.0) ! break; ! plot[plot_num].points[i].x = log10(x); } else plot[plot_num].points[i].x = x; if (log_y) { if (y <= 0.0) ! break; ! plot[plot_num].points[i].y = log10(y); } else plot[plot_num].points[i].y = y; ! plot[plot_num].points[i].undefined = FALSE; ! if (autoscale_lx) { ! if (x < xmin) xmin = x; ! if (x > xmax) xmax = x; } ! if (autoscale_ly) { ! if (y < ymin) ymin = y; ! if (y > ymax) ymax = y; ! } ! i++; ! } break; default: (void) sprintf(line, "bad data on line %d", l_num); --- 1146,1185 ---- switch (sscanf(line, "%f %f", &x, &y)) { case 1: /* only one number on the line */ y = x; /* assign that number to y */ ! x = datum; /* and make the index into x */ /* no break; !!! */ case 2: + datum++; + plot[plot_num].points[i].undefined = FALSE; if ( (autoscale_lx || (x >= xmin && x <= xmax)) && (autoscale_ly || (y >= ymin && y <= ymax))) { if (log_x) { if (x <= 0.0) ! plot[plot_num].points[i].undefined = TRUE; ! else ! plot[plot_num].points[i].x = log10(x); } else plot[plot_num].points[i].x = x; if (log_y) { if (y <= 0.0) ! plot[plot_num].points[i].undefined = TRUE; ! else ! plot[plot_num].points[i].y = log10(y); } else plot[plot_num].points[i].y = y; ! if (plot[plot_num].points[i].undefined == FALSE) { ! if (autoscale_lx) { ! if (x < xmin) xmin = x; ! if (x > xmax) xmax = x; ! } ! if (autoscale_ly) { ! if (y < ymin) ymin = y; ! if (y > ymax) ymax = y; ! } } ! } else ! plot[plot_num].points[i].undefined = TRUE; ! i++; break; default: (void) sprintf(line, "bad data on line %d", l_num); Common subdirectories: ../gnutex.old/doc and ./doc diff -cr ../gnutex.old/gnutex.help ./gnutex.help *** ../gnutex.old/gnutex.help Wed Feb 1 21:12:46 1989 --- ./gnutex.help Mon Mar 13 20:11:23 1989 *************** *** 13,23 **** the entire command. Additional help is available for each of these topics: ! clear key plot shell ! comments label print start-up ! exit latex save substitution ! expressions load set user-defined ?continue Commands may extend over several input lines, by ending each line but the last with a backslash (\). The backslash must be the LAST character on each line. The effect is as if the backslash and newline --- 13,25 ---- the entire command. Additional help is available for each of these topics: ! clear fig load save substitution ! comments key manual set userdefined ! exit label plot shell ! expressions latex print startup ?continue + ?continuation + ?lines Commands may extend over several input lines, by ending each line but the last with a backslash (\). The backslash must be the LAST character on each line. The effect is as if the backslash and newline *************** *** 29,34 **** --- 31,37 ---- 'set output'. This usually generates a formfeed on hardcopy devices. Use 'set terminal' to set the device type. ?comments + ?comment Comments: Comments are now supported: a # may appear in most places in a line *************** *** 39,47 **** ?exit ?quit 'exit', 'quit' and your computer's END-OF-FILE character will ! exit GNUTEX. All these commands will clear the output device (as the 'clear' command does) before exiting. ?expressions In general, any mathematical expression accepted by C, FORTRAN, Pascal, or BASIC is valid. The precedence of these operators is determined by the specifications of the C programming language. White space (spaces and tabs) --- 42,51 ---- ?exit ?quit 'exit', 'quit' and your computer's END-OF-FILE character will ! exit GnuTeX. All these commands will clear the output device (as the 'clear' command does) before exiting. ?expressions + ?expression In general, any mathematical expression accepted by C, FORTRAN, Pascal, or BASIC is valid. The precedence of these operators is determined by the specifications of the C programming language. White space (spaces and tabs) *************** *** 52,69 **** 3 + 2i; {0,1} represents 'i' itself. Additional help is available for each of these topics: ! functions operators ?functions ?expressions functions ! The functions in GNUTEX are the same as the corresponding functions in the UNIX math library, except that all functions accept integer, real, and complex arguments, unless otherwise noted. The BASIC sgn() function is also supported. Additional help is available for each of these topics: ! abs asin besj1 ceil exp int real sinh tanh ! acos atan besy0 cos floor log sgn sqrt ! arg besj0 besy1 cosh imag log10 sin tan ?expressions functions abs ?abs This function returns the absolute value of its argument. --- 56,74 ---- 3 + 2i; {0,1} represents 'i' itself. Additional help is available for each of these topics: ! functions operators ?functions + ?function ?expressions functions ! The functions in GnuTeX are the same as the corresponding functions in the UNIX math library, except that all functions accept integer, real, and complex arguments, unless otherwise noted. The BASIC sgn() function is also supported. Additional help is available for each of these topics: ! abs asin besj1 ceil exp int real sinh tanh ! acos atan besy0 cos floor log sgn sqrt ! arg besj0 besy1 cosh imag log10 sin tan ?expressions functions abs ?abs This function returns the absolute value of its argument. *************** *** 174,180 **** Parentheses may be used to change order of evaluation. Additional help is available for each of these topics: ! binary unary ?expressions operators binary ?binary The following is a list of all the binary operators and their usage: --- 179,185 ---- Parentheses may be used to change order of evaluation. Additional help is available for each of these topics: ! binary unary ?expressions operators binary ?binary The following is a list of all the binary operators and their usage: *************** *** 193,201 **** | a|b bitwise inclusive or && a&&b logical and || a||b logical or ! ?: a?b:c terniary operation ! The terniary operator evaluates its first argument (a). If it is true (non-zero) the second argument (b) is returned, otherwise the third argument (c) is returned. ?expressions operators unary --- 198,206 ---- | a|b bitwise inclusive or && a&&b logical and || a||b logical or ! ?: a?b:c ternary operation ! The ternary operator evaluates its first argument (a). If it is true (non-zero) the second argument (b) is returned, otherwise the third argument (c) is returned. ?expressions operators unary *************** *** 202,217 **** ?unary The following is a list of all the unary operators and their usage: ! Symbol Example Explantion - -a unary minus ~ ~a one's complement ! !a logical negation ?key LATEX ONLY: Plotting a Key: If you wish a key describing the plots to be made, use the "key" command: ! key x,y "description1" w <style1> [, "description2" w <style2>"] ... The key command looks a lot like a plot command. The coordinates x,y specify the location of the key on the plot (see below). The key is --- 207,252 ---- ?unary The following is a list of all the unary operators and their usage: ! Symbol Example Explanation - -a unary minus ~ ~a one's complement ! !a logical negation + ?fig + Fig is an interactive drawing program that runs on Sun workstations + and under X windows. Files using the Fig language to describe the + pictures can be translated (with a suite of programs in the TransFig + package) to several other languages, such as PostScript, TeX, and + LaTeX. + + If you choose the "fig" terminal type in GnuTeX, a Fig format + file is produced that may be edited by Fig, translated by TransFig, + and printed or included in a TeX or LaTeX document. If you have + the EPIC or EEPIC macros, and your dvi translator supports the + tpic \specials, then you have the capability for very + good-quality output that draws curves with lines instead of dots. + The reader is referred to the Fig and EPIC documentation for further + information. + + On the other hand, the Fig driver does not support user-defined + linestyles, nor the "key" command. + + The input file for GnuTeX should contain commands similar to these: + set terminal fig + set output "plot.fig" + set size 5,4 + Note that the output file has a ".fig" extension. To obtain EEPIC + output from a command file (called, say, "plot.gnu"), use the + shell commands + gnutex < plot.gnu + fig2epic plot.fig plot.tex + Include the file plot.tex in your document as before, along with the + document style options [epic,eepic]. ?key LATEX ONLY: Plotting a Key: If you wish a key describing the plots to be made, use the "key" command: ! key x,y "description1" w <style1> [, "description2" w <style2>"] ... The key command looks a lot like a plot command. The coordinates x,y specify the location of the key on the plot (see below). The key is *************** *** 226,239 **** the bottom of the key. For example, the plot command ! plot "foo" w points, "bar" w lines, "funky" w linespoints followed by ! key 5,5 "This is foo" w points, "This is bar" w lines, \ ! "This is funky" w linespoints would give us a key that looks (roughly) like this: ! <> This is foo ! ..... This is bar ! ...+.. This is funky (The <> is a diamond). Any styles may be used in the key entries, including user-defined --- 261,274 ---- the bottom of the key. For example, the plot command ! plot "foo" w points, "bar" w lines, "funky" w linespoints followed by ! key 5,5 "This is foo" w points, "This is bar" w lines, \ ! "This is funky" w linespoints would give us a key that looks (roughly) like this: ! <> This is foo ! ..... This is bar ! ...+.. This is funky (The <> is a diamond). Any styles may be used in the key entries, including user-defined *************** *** 244,259 **** the key, but may be included to affect the point-type determination. For example, if you didn't want to key the "foo" curve above, but you wanted "funky" to look right, the key command is ! key 5,5 "" w points, "This is bar" w lines, \ ! "This is funky" w linespoints and gives us a key that looks (roughly) like this: ! ..... This is bar ! ...+.. This is funky The key is fairly rough at this time and I may find ways to make it look better. Suggestions welcome. ?label ! IMAGEN and LATEX ONLY: Arbitrary labels may be placed on the most recent plot, using the new "label" command. The syntax is --- 279,294 ---- the key, but may be included to affect the point-type determination. For example, if you didn't want to key the "foo" curve above, but you wanted "funky" to look right, the key command is ! key 5,5 "" w points, "This is bar" w lines, \ ! "This is funky" w linespoints and gives us a key that looks (roughly) like this: ! ..... This is bar ! ...+.. This is funky The key is fairly rough at this time and I may find ways to make it look better. Suggestions welcome. ?label ! IMAGEN, FIG, and LATEX ONLY: Arbitrary labels may be placed on the most recent plot, using the new "label" command. The syntax is *************** *** 293,303 **** Labels outside of the plotted boundaries are permitted but may interfere with axes labels or other text; use at your own risk. ?latex ! Documentation for the LATEX extensions to gnuplot (gnutex) (updated 11/4/88): ! To run gnutex, type /usr/local/bin/gnutex ! See /usr/local/public/doc/gnutex/* for examples and help. To use the LaTeX facilities of gnutex, the first command to gnutex should be --- 328,338 ---- Labels outside of the plotted boundaries are permitted but may interfere with axes labels or other text; use at your own risk. ?latex ! Documentation for the LATEX extensions to gnuplot (gnutex) ! To run gnutex at Duke, type /usr/local/bin/gnutex ! See /usr/local/public/doc/gnutex/* for examples and the manual. To use the LaTeX facilities of gnutex, the first command to gnutex should be *************** *** 315,321 **** specified (you probably only want one plot per file). This file can then be used in a LaTeX document, for example, \begin {figure} ! \input{plot} \end {figure} This puts the plot into a figure. --- 350,356 ---- specified (you probably only want one plot per file). This file can then be used in a LaTeX document, for example, \begin {figure} ! \input{plot} \end {figure} This puts the plot into a figure. *************** *** 324,537 **** lines with arbitrary slopes, and runs out of memory if lines are approximated by a series of many tiny dots, lines are drawn as a series of dots. The usual symbols are plotted for the "with points" ! linestyle. User-defined styles are described below. NOTE: Linestyles may no longer be abbreviated, for example, "p" for ! "points", "l" for "lines", and "linesp" for "linespoints". The full ! word must be written out. ! The plot is also labeled in a variety of ways. The ticks on the x ! and y axes are labeled with the appropriate numbers. The axes may be ! labeled and a title provided for the plot with new 'set' commands. ! The labels in effect at the time of the "plot" command are used, so ! they should be set before the plot. Once set, they retain their values ! until explicitly changed. For example, ! set title "This is the title of the plot" ! set xlabel "This is the x axis" ! set ylabel "This is the y axis" ! will label the top, bottom, and left sides of the plot, respectively. ! These can be more sophisticated, for example, ! set title "This is a very long title\\because it has\\three lines" ! set xlabel "This is the $x$ axis\\with more than two\\lines in the label" ! set ylabel "This is a longer\\version of\\the $y$ axis" ! Here there are line breaks, and math mode is used to make the 'x' and ! 'y' look like variables. The line breaks are particularly useful for ! the y axis label. ! ! If the ylabel is not coming out quite right (too close to the plot), ! its position may be adjusted with a second parameter, such as ! set ylabel "This is the y axis" 2 ! This will slide the y label about 2 characters further left (away from ! the plot). Positive and negative integers are allowed. ! ! Sometimes the x- or y-axis numbers really don't mean anything, and you ! would rather not have the numbers and tics printed on the axis. If ! this is the case, insert a ! set noxtics ! and/or ! set noytics ! before the plot command. To turn them back on use ! set xtics ! set ytics ! ! The tics on both axes are labelled with a format "$%g$", which uses ! the general-purpose printf format and math mode to format the number. ! If you want to change this, use the "set format" command: ! set format "format-string" ! set format <axis> "format-string" ! where <axis> is 'x', 'y', or 'xy'. Using 'xy' is the same as using ! nothing at all, as in the first form. This sets the format string to ! be used for the given axis (axes). For example, you may prefer ! "$%3.1f$" (note that math mode almost always looks better, but is not ! necessary). Or maybe "$%3.0f \mu$sec", or "$%5.2 \cdot 10^{-3}$". Use ! your imagination, but restrict yourself to the f, e, and g formats, as ! the number is a double-precision number, and the other formats ! (d,o,x,u,c,s) will not work correctly. ! ! ! Plotting a Key: ! If you wish a key describing the plots to be made, use the "key" command: ! key x,y "description1" w <style1> [, "description2" w <style2>"] ... ! ! The key command looks a lot like a plot command. The coordinates x,y ! specify the location of the key on the plot (see below). The key is ! drawn as a sequence of lines, with one plot described on each line. On ! the left-hand side of each line is a representation that attempts to ! mimic the way the curve is plotted (eg, a bunch of dots for a line, ! the point symbol for a point, etc). On the right side of each line is ! the text "description" given in the command. The lines are vertically ! arranged so an imaginary straight line divides the left- and ! right-hand sides of the key. It is the x-coordinate of this line that ! you specify with the x in the key command; the y in the key command is ! the bottom of the key. ! ! For example, the plot command ! plot "foo" w points, "bar" w lines, "funky" w linespoints ! followed by ! key 5,5 "This is foo" w points, "This is bar" w lines, \ ! "This is funky" w linespoints ! would give us a key that looks (roughly) like this: ! <> This is foo ! ..... This is bar ! ...+.. This is funky ! (The <> is a diamond). ! ! Any styles may be used in the key entries, including user-defined ! styles. For the points and linespoints styles, the point type plotted ! is determined in the same way as in the plot command, so your key ! entries should be in the same order as in the plot command. Note that ! a key entry with an empty (ie "") description will not be included in ! the key, but may be included to affect the point-type determination. ! For example, if you didn't want to key the "foo" curve above, but you ! wanted "funky" to look right, the key command is ! key 5,5 "" w points, "This is bar" w lines, \ ! "This is funky" w linespoints ! and gives us a key that looks (roughly) like this: ! ..... This is bar ! ...+.. This is funky ! ! The key is fairly rough at this time and I may find ways to make it ! look better. Suggestions welcome. ! ! ! User-defined linestyles: ! If you find the "dot" approximation to lines to be inadequate, or ! desire your different curves on the same plot to have different ! styles, then you can define your own style (up to 16 may be defined). ! A style may be defined at any time with a command of the form ! set style <name> <point> ! or ! set style <name> <spacing> <dot>... ! or ! set style <name> <point> <spacing> <dot>... ! ! The first form defines a style similar to "points", the second similar ! to "lines" and the third to "linespoints". The <name> is any ! identifier, just as with user-defined variables and functions (it may ! not be lines, points, impulses, or linespoints). To use the style, ! simply use the <name> where you would use any of the standard ! linestyle names: "with <name>", "set data style <name>", or "set ! function style <name>". ! ! The <point> is a quoted string of LaTeX source which describes text to ! be plotted at each point. Picture-mode and math-mode commands are the ! most useful. For example, "\circle*{100}" draws a disk 1pt in ! diameter at each data point (the units of picture coordinates in use ! are 1/100 point). "$\Diamond$" produces a large diamond symbol. ! ! The <spacing> and <dot> arguments define a line in terms of a sequence ! of "dots" to be output every <spacing> points along the line to be ! plotted. <spacing> is a real number whose units are points. Each dot ! (up to 5 dots are allowed) is a quoted string of LaTeX text, as with ! the point above. The dots are plotted in rotation along the whole ! curve. ! ! Thus, to simulate a linespoints linestyle with alternating big and ! little dots every 4 points the curve but to use a plus sign at each ! data point, ! set style mine "$+$" 4 "\circle*{100}" "\circle*{200}" ! ! The default style is as if ! set style lines 2 "\circle*{1}" ! set style linespoints <varies> 2 "\circle*{1}" ! Had been executed. (The smallest circle that will be drawn is about ! 100 units; smaller sizes as this one will use that smallest size). ! Linespoints is special in that its points vary with each curve on the ! plot, as with classic gnutex. This is not possible to embody in a ! single user-defined linestyle. ! ! Labeling Curves: ! Arbitrary labels may be placed on the most recent plot, using the new ! "label" command. The syntax is ! label x,y "text" ! where x,y is some coordinate in your plot's coordinate system (the ! commas are important). The text is any arbitrary LaTeX input, any will ! be processed in LR mode. The text is centered at the point x,y. The ! label command should follow the plot command. Any number of labels may ! be placed. ! ! If you want to adjust the way the label is positioned with respect to ! the point x,y, add another parameter: ! label x,y "text" pos ! where pos is one of r,l,t,b,lt,lb,rt,rb indicating that the text ! should be placed so that the point is at the right center, left ! center, top center, bottom center, left top corner, etc. ! ! An arrow can be drawn out from the point simply by giving its ! length in problem coordinates, after the pos: ! label x,y "text" pos length ! The length is defined to be the HORIZONTAL extent of the arrow, unless ! the arrow is vertical, in which case it is the vertical extent of the ! arrow. The arrow is drawn AWAY FROM the text; for example, if pos is ! lt, then away is defined to be up and to the left. If it is b, away is ! defined to be down. This allows for eight different directions of ! arrows. ! ! Further control over the slope of the arrow can be gained by ! specifying exactly the slope you want. You should read about vectors ! on page 198 in the LaTeX manual. The command looks like ! label x,y "text" pos length, h_slope, v_slope ! (the commas are important). The h_slope and v_slope are integers in ! the range -4 to 4, which specify the slope of the line (run, rise). ! A horizontal line is 1,0, vertical is 0,1. The two numbers may not ! have a common divisor other than +1 or -1. ! ! Labels outside of the plotted boundaries are permitted but may ! interfere with axes labels or other text; use at your own risk. ! ! Other ! ----- ! ! Gnutex normally clips (actually, does not plot at all) data points ! that fall within but too close to the boundaries (this is so the large ! symbols used for points will not extend outside the boundary lines). ! With the user-defined styles it is often desirable to make smaller ! points, and thus points near the boundaries may be plotted. To turn ! off clipping, use ! set noclip ! To turn it back on, use ! set clip ! The default is 'clip'. Without clipping you may have points near the ! boundaries that look bad; try adjusting the x and y ranges. ! ! Comments: ! Comments are now supported: a # may appear in most places in a line ! and gnutex will ignore the rest of the line. It will not have this ! affect inside quotes, inside numbers (incl. complex numbers), inside ! command substitutions, etc. In short, it works anywhere it makes sense ! to work. ! ! Please send bug reports and suggestions to dfk@cs.duke.edu. ?load This command executes each line of the specified input file as if it had been typed in interactively. Files created by the 'save' --- 359,373 ---- lines with arbitrary slopes, and runs out of memory if lines are approximated by a series of many tiny dots, lines are drawn as a series of dots. The usual symbols are plotted for the "with points" ! linestyle. User-defined styles are also possible. NOTE: Linestyles may no longer be abbreviated, for example, "p" for ! "points", and "l" for "lines". The full word must be written out. ! The plot is also labeled in a variety of ways. Get help on topics ! title xlabel ylabel tics ! format key userstyle label ! clip ?load This command executes each line of the specified input file as if it had been typed in interactively. Files created by the 'save' *************** *** 544,549 **** --- 380,390 ---- Syntax: load <input-file> The name of the input file must be enclosed in quotes. + ?manual + There should be a manual page installed for "gnutex" and for + "lasergnu". There is also a 23-page user manual available, with many + examples. Contact your GnuTeX installer. (At Duke this is found in + /usr/local/public/doc/gnutex/manual/...). ?plot The 'plot' command is the primary command of the program. It displays functions and data in many, many ways. The full syntax of this *************** *** 566,574 **** plot [t=1:100] [-pi:pi*2] tan(t), "data.1" with lines, besj0(t) with points Additional help is available for each of these topics: ! data-file ranges style ! ?plot data-file ! ?data-file ?data Discrete data contained in a file can displayed by specifying the name of the data file (enclosed in quotes) on the 'plot' command line. --- 407,415 ---- plot [t=1:100] [-pi:pi*2] tan(t), "data.1" with lines, besj0(t) with points Additional help is available for each of these topics: ! datafile ranges style ! ?plot datafile ! ?datafile ?data Discrete data contained in a file can displayed by specifying the name of the data file (enclosed in quotes) on the 'plot' command line. *************** *** 633,639 **** does not vary from plot to plot. This is useful for plotting very many points to get a feel for the distribution. In addition, for LaTeX output only, there are user-defined styles (see the 'set style' ! command in 'user-styles'). Default styles are chosen with the 'set function style' and 'set data style' commands. --- 474,480 ---- does not vary from plot to plot. This is useful for plotting very many points to get a feel for the distribution. In addition, for LaTeX output only, there are user-defined styles (see the 'set style' ! command in 'userstyles'). Default styles are chosen with the 'set function style' and 'set data style' commands. *************** *** 675,684 **** The 'show' command shows their settings. 'show all' shows all the settings. Additional help is available for each of these topics: ! autoscale logscale style variables ylabel ! clip output terminal xlabel yrange ! format samples title xrange ytics ! functions size user-styles xtics zero ?set autoscale ?show autoscale ?autoscale --- 516,525 ---- The 'show' command shows their settings. 'show all' shows all the settings. Additional help is available for each of these topics: ! autoscale logscale style variables ylabel ! clip output terminal xlabel yrange ! format samples title xrange ytics ! functions size userstyles xtics zero ?set autoscale ?show autoscale ?autoscale *************** *** 721,727 **** ?set format ?show format ?format ! IMAGEN and LATEX ONLY: The format of the tic-mark labels may be set with the "set format" command. The default format used for both axes is "$%g$", but other --- 562,568 ---- ?set format ?show format ?format ! IMAGEN, FIG, and LATEX ONLY: The format of the tic-mark labels may be set with the "set format" command. The default format used for both axes is "$%g$", but other *************** *** 777,783 **** ?set size ?show size ?size ! IMAGEN and LATEX ONLY: The 'set size' command will set the size of the plot, in inches. --- 618,624 ---- ?set size ?show size ?size ! IMAGEN, FIG, and LATEX ONLY: The 'set size' command will set the size of the plot, in inches. *************** *** 802,808 **** does not vary from plot to plot. This is useful for plotting very many points to get a feel for the distribution. In addition, for LaTeX output only, there are user-defined styles (see the 'set style' ! command in 'user-styles'). Default styles are chosen with the 'set function style' and 'set data style' commands. --- 643,649 ---- does not vary from plot to plot. This is useful for plotting very many points to get a feel for the distribution. In addition, for LaTeX output only, there are user-defined styles (see the 'set style' ! command in 'userstyles'). Default styles are chosen with the 'set function style' and 'set data style' commands. *************** *** 846,854 **** With Latex, this may be more complex: set title "This is a very long title\\because it has\\three lines" ! ?set user-styles ! ?show user-styles ! ?user-styles LATEX ONLY: If you find the "dot" approximation to lines to be inadequate, or --- 687,695 ---- With Latex, this may be more complex: set title "This is a very long title\\because it has\\three lines" ! ?set userstyles ! ?show userstyles ! ?userstyles LATEX ONLY: If you find the "dot" approximation to lines to be inadequate, or *************** *** 855,865 **** desire your different curves on the same plot to have different styles, then you can define your own style (up to 16 may be defined). A style may be defined at any time with a command of the form ! set style <name> <point> or ! set style <name> <spacing> <dot>... or ! set style <name> <point> <spacing> <dot>... The first form defines a style similar to "points", the second similar to "lines" and the third to "linespoints". The <name> is any --- 696,706 ---- desire your different curves on the same plot to have different styles, then you can define your own style (up to 16 may be defined). A style may be defined at any time with a command of the form ! set style <name> <point> or ! set style <name> <spacing> <dot>... or ! set style <name> <point> <spacing> <dot>... The first form defines a style similar to "points", the second similar to "lines" and the third to "linespoints". The <name> is any *************** *** 885,895 **** Thus, to simulate a linespoints linestyle with alternating big and little dots every 4 points along the curve but to use a plus sign at each data point, ! set style mine "$+$" 4 "\circle*{100}" "\circle*{200}" The default style is as if ! set style lines 2 "\circle*{1}" ! set style linespoints <varies> 2 "\circle*{1}" Had been executed. (The smallest circle that will be drawn is about 100 units; smaller sizes as this one will use that smallest size). Linespoints is special in that its points vary with each curve on the --- 726,736 ---- Thus, to simulate a linespoints linestyle with alternating big and little dots every 4 points along the curve but to use a plus sign at each data point, ! set style mine "$+$" 4 "\circle*{100}" "\circle*{200}" The default style is as if ! set style lines 2 "\circle*{1}" ! set style linespoints <varies> 2 "\circle*{1}" Had been executed. (The smallest circle that will be drawn is about 100 units; smaller sizes as this one will use that smallest size). Linespoints is special in that its points vary with each curve on the *************** *** 897,903 **** single user-defined linestyle. ?show variables - ?variables The 'show variables' command lists all user-defined variables and their values. --- 738,743 ---- *************** *** 905,911 **** ?set xlabel ?show xlabel ?xlabel ! IMAGEN and LATEX ONLY: The plot is labeled in a variety of ways. The ticks on the x and y axes are labeled with the appropriate numbers. The axes may be labeled --- 745,751 ---- ?set xlabel ?show xlabel ?xlabel ! IMAGEN, FIG, and LATEX ONLY: The plot is labeled in a variety of ways. The ticks on the x and y axes are labeled with the appropriate numbers. The axes may be labeled *************** *** 938,944 **** ?set ylabel ?show ylabel ?ylabel ! IMAGEN and LATEX ONLY: The plot is labeled in a variety of ways. The ticks on the x and y axes are labeled with the appropriate numbers. The axes may be labeled --- 778,784 ---- ?set ylabel ?show ylabel ?ylabel ! IMAGEN, FIG, and LATEX ONLY: The plot is labeled in a variety of ways. The ticks on the x and y axes are labeled with the appropriate numbers. The axes may be labeled *************** *** 1014,1020 **** prints a directory listing and then returns to GNUTEX. $ is accepted as a synonym for ! in VMS. ! ?start-up ?.gnutex When GNUTEX is run, it looks for an initialization file to execute. This file is called '.gnutex' on Unix systems, and 'GNUTEX.INI' on --- 854,860 ---- prints a directory listing and then returns to GNUTEX. $ is accepted as a synonym for ! in VMS. ! ?startup ?.gnutex When GNUTEX is run, it looks for an initialization file to execute. This file is called '.gnutex' on Unix systems, and 'GNUTEX.INI' on *************** *** 1028,1034 **** functions or variables which you use often. The variable 'pi' is already defined for you. ?substitution ! Command-line subsitution is specified by a system command enclosed in backquotes (``). This command is spawned and the output it produces replaces the name of the command (and backquotes) on the command line. --- 868,874 ---- functions or variables which you use often. The variable 'pi' is already defined for you. ?substitution ! Command-line substitution is specified by a system command enclosed in backquotes (``). This command is spawned and the output it produces replaces the name of the command (and backquotes) on the command line. *************** *** 1042,1048 **** a(x) = `leastsq` ; substitutes "`leastsq`" with output produced by a program named leastsq. a(x) = `run leastsq.exe` ; same but for VMS. ! ?user-defined You may define your own functions and variables. User-defined functions and variables may be used anywhere. --- 882,889 ---- a(x) = `leastsq` ; substitutes "`leastsq`" with output produced by a program named leastsq. a(x) = `run leastsq.exe` ; same but for VMS. ! ?userdefined ! ?variables You may define your own functions and variables. User-defined functions and variables may be used anywhere. *************** *** 1056,1062 **** Examples: w = 2 ! q = floor(tan(pi/2 - 0.1)) f(x) = sin(w*x) sinc(x) = sin(pi*x)/(pi*x) delta(t) = (t == 0) --- 897,903 ---- Examples: w = 2 ! q = floor(tan(pi/2 - 0.1)) f(x) = sin(w*x) sinc(x) = sin(pi*x)/(pi*x) delta(t) = (t == 0) diff -cr ../gnutex.old/ideas ./ideas *** ../gnutex.old/ideas Tue Jan 17 20:14:22 1989 --- ./ideas Mon Mar 13 20:00:04 1989 *************** *** 15,23 **** values are finite but out-of-range ---- - provide a FIG output mode - - ---- use EEPIC to draw plot lines ------ --- 15,20 ---- diff -cr ../gnutex.old/object.h ./object.h *** ../gnutex.old/object.h Mon Mar 20 22:01:54 1989 --- ./object.h Mon Mar 13 14:22:30 1989 *************** *** 0 **** --- 1,224 ---- + /* + * 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; + float thickness; + float wid; + float 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; + float style_val; + float 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; + float style_val; + int direction; + struct f_arrow *for_arrow; + struct f_arrow *back_arrow; + struct {float 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; + float 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; + float 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 { + float 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; + float 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 Department of Computer Science, Duke University, Durham, NC 27706 USA ARPA: dfk@cs.duke.edu CSNET: dfk@duke UUCP: decvax!duke!dfk