home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-03-25 | 27.5 KB | 1,186 lines |
- Newsgroups: comp.sources.misc
- organization: Pixar -- Marin County, California
- subject: v11i067: Gnuplot 2.0 - 2 of 14
- From: thaw@ucbvax.Berkeley.EDU@pixar.UUCP (Tom Williams)
- Sender: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
-
- Posting-number: Volume 11, Issue 67
- Submitted-by: thaw@ucbvax.Berkeley.EDU@pixar.UUCP (Tom Williams)
- Archive-name: gnuplot2/part02
-
- This is gnuplot.sh02
-
- --- CUT HERE ---
- #! /bin/sh
- echo x - docs/Makefile
- sed 's/^X//' >docs/Makefile <<'*-*-END-of-docs/Makefile-*-*'
- X# Makefile for GNUPLOT documentation
- X#
- X# Note that the top-level file for documentation is gnuplot.doc.
- X# See README.
- X#
- X# To print manual:
- X# make gnuplot.dvi (for latex)
- X# (print or view gnuplot.dvi)
- X# OR
- X# make gnuplot.nroff (for nroff)
- X# (print or view gnuplot.nroff)
- X# or
- X# make "TROFF=itroff" troff (for troff; use your troff for itroff here)
- X#
- X# $Id: Makefile,v 1.1 90/01/11 15:43:03 dfk Exp Locker: dfk $
- X
- X# usually overridden by ../Makefile
- XHELPDEST = /usr/local/lib/
- X
- X# substitute your troff command (and any flags) for this one
- XTROFF=itroff
- X
- X# Compiler flags
- X# -DSYSV if att sys V
- X# -DMSDOS if MSDOS PS
- X# no extra flags for BSD
- XCFLAGS = -s
- X
- X# default is what is needed for interactive gnuplot
- Xdefault: gnuplot.hlp gnuplot.gih
- X
- X### [tn]roff documentation
- Xtroff: gnuplot.ms titlepage.ms
- X tbl gnuplot.ms | eqn | $(TROFF) -ms
- X
- X# for screen viewing, or printers with backspace/overstrike, remove the -Tlpr
- Xnroff gnuplot.nroff: gnuplot.ms titlepage.ms
- X tbl gnuplot.ms | neqn | nroff -ms -Tlpr > gnuplot.nroff
- X
- Xms gnuplot.ms: doc2ms gnuplot.doc
- X ./doc2ms < gnuplot.doc > gnuplot.ms
- X
- Xdoc2ms: doc2ms.c
- X cc $(CFLAGS) -o doc2ms doc2ms.c
- X
- X### LaTeX documentation
- Xtex gnuplot.tex: doc2tex gnuplot.doc
- X ./doc2tex < gnuplot.doc > gnuplot.tex
- X
- Xdvi gnuplot.dvi: gnuplot.tex titlepage.tex
- X (latex gnuplot.tex ; latex gnuplot.tex)
- X
- Xdoc2tex: doc2tex.c
- X cc $(CFLAGS) -o doc2tex doc2tex.c
- X
- X# this is how to make gnuplot.hlp
- Xhlp gnuplot.hlp: doc2hlp gnuplot.doc
- X ./doc2hlp < gnuplot.doc > gnuplot.hlp
- X
- Xdoc2hlp: doc2hlp.c
- X cc $(CFLAGS) -o doc2hlp doc2hlp.c
- X
- X# this is how to make gnuplot.gih
- Xgih gnuplot.gih: doc2gih gnuplot.doc
- X ./doc2gih < gnuplot.doc > gnuplot.gih
- X
- Xdoc2gih: doc2gih.c
- X cc $(CFLAGS) -o doc2gih doc2gih.c
- X
- X# this is how to check the gnuplot.doc file
- Xcheck: checkdoc gnuplot.doc
- X ./checkdoc < gnuplot.doc
- X
- Xcheckdoc: checkdoc.c
- X cc $(CFLAGS) -o checkdoc checkdoc.c
- X
- X# For Unix and MSDOS only
- Xinstall-unix: gnuplot.gih
- X cp gnuplot.gih $(HELPDEST)
- X
- X# for VMS only
- Xinstall-vms: gnuplot.hlp
- X cp gnuplot.hlp $(HELPDEST)
- X
- X# remove all derived files
- Xclean:
- X rm -f doc2ms gnuplot.nroff gnuplot.ms
- X rm -f doc2tex gnuplot.tex gnuplot.dvi gnuplot.aux gnuplot.log gnuplot.toc
- X rm -f doc2hlp gnuplot.hlp
- X rm -f doc2gih gnuplot.gih
- X rm -f checkdoc *~ *.o core a.out
- *-*-END-of-docs/Makefile-*-*
- echo x - docs/README
- sed 's/^X//' >docs/README <<'*-*-END-of-docs/README-*-*'
- XNotes on the gnuplot help files and documentation.
- X
- XGnuplot documentation is available in three ways:
- X
- X1 - interactively, within gnuplot
- X2 - as a printed document.
- X3 - as a manual page, through the Unix man(1) facility
- X
- XThe first two forms describe the inner workings, and contain
- Xequivalent information, while the third form tells how to run gnuplot.
- X
- XThe two first forms above derive their information from the file
- Xgnuplot.doc, which is the MASTER copy of gnuplot help information. All
- Xother forms, except for gnuplot.1, the man page, are derived from it.
- X
- Xgnuplot.doc -> gnuplot.hlp
- X -> gnuplot.gih
- X -> gnuplot.tex
- X -> gnuplot.ms
- X
- XOn VMS the interactive help is supplied by the system help facility,
- Xusing the gnuplot.hlp file. This is made with ('make hlp'). On Unix
- Xand MSDOS the interactive help is built in to the program, and uses
- Xthe gnuplot.gih file ('make gih').
- X
- XThe printed document is available in either latex or troff/nroff (ms)
- Xformat, using gnuplot.tex or gnuplot.ms, derived from gnuplot.doc with
- Xeither doc2tex or doc2ms. Type 'make dvi' or 'make nroff'. For troff,
- Xtype 'make ms' and then troff -ms gnuplot.ms in whatever way you use
- Xtroff.
- X
- XIf VMS users prefer the gnuplot interactive help facility to the
- Xsystem facility, this can be easily changed in command.c.
- X
- X
- XDescription of the gnuplot.doc format:
- X--------------------------------------
- X
- XHere is an example of the DOC master help format:
- X
- X?
- X1 gnuplot
- X GNUPLOT is a command-driven interactive function plotting program. It
- X ...
- X?exit
- X2 exit
- X 'exit', 'quit' and ...
- X?expressions
- X2 expressions
- X In general, any mathematical expression accepted by C, ...
- X
- X Topics:
- X functions operators
- X?expressions functions
- X?functions
- X3 functions
- X The functions in GNUPLOT are ...
- X
- X Topics:
- X abs acos arg ...
- X?expressions functions abs
- X?functions abs
- X?abs
- X4 abs
- X This function returns the absolute value of its argument. The
- X returned value is of the same type as the argument.
- X?expressions functions acos
- X?functions acos
- X?acos
- X4 acos
- X This function returns the arc cosine (inverse cosine) of its
- X argument. 'acos' returns its argument in radians.
- X
- X
- XSome notes about the format:
- X----------------------------
- XRemember that all text must be able to be processed by gnuplot, VMS,
- X nroff, troff, and latex, and always do something reasonable.
- XThe first column is reserved for control characters.
- XText does not start in the first column.
- XLines that start in column 2 may be typeset by LaTeX.
- XLines that have a space in column 2 are to be printed in a verbatim
- X environment by LaTeX.
- XDo NOT use tabs in the help file.
- XConversion from this format to vax .hlp file involves removal of
- X lines starting with [?@#$%] (see doc2hlp). VMS uses the numbers
- X to represent a tree.
- XConversion from this format to gnuplot .gih file involves removal of
- X lines starting with [0-9@#$%] (see doc2gih). Gnuplot matches your
- X help query against the ? lines to find the help information.
- X Multiple ? lines for one text block constitute synonyms. The most
- X specific should be first, eg 'expressions functions' before 'functions'.
- X Spaces are allowed here, but should be single.
- XBackquote pairs are converted by the doc2tex program into boldface;
- X that is, `some text` is converted to {\bf some text}. Be sure to pair
- X the backquotes, or the whole document will be boldface!
- X
- XControl characters in first column:
- X? used by .gih format, for builtin interactive help - keyword
- X0-9 used by VMS help and by doc2{tex,ms} formatters to define level,keyword
- X@ used by doc2{tex,ms} to define table start/end
- X# used by doc2tex: table entry
- X% used by doc2ms: table entry
- *-*-END-of-docs/README-*-*
- echo x - docs/checkdoc.c
- sed 's/^X//' >docs/checkdoc.c <<'*-*-END-of-docs/checkdoc.c-*-*'
- X/*
- X * checkdoc -- check a doc file for correctness of first column.
- X *
- X * Prints out lines that have an illegal first character.
- X * First character must be space, digit, or ?, @, #, %,
- X * or line must be empty.
- X *
- X * usage: checkdoc < docfile
- X * Modified by Russell Lang from hlp2ms.c by Thomas Williams
- X *
- X * Original version by David Kotz used the following one line script!
- X * sed -e '/^$/d' -e '/^[ 0-9?@#%]/d' gnuplot.doc
- X *
- X */
- X
- X#include <stdio.h>
- X#include <ctype.h>
- X
- X#define MAX_LINE_LEN 256
- X#define TRUE 1
- X#define FALSE 0
- X
- Xmain()
- X{
- X convert(stdin,stdout);
- X exit(0);
- X}
- X
- Xconvert(a,b)
- X FILE *a,*b;
- X{
- X static char line[MAX_LINE_LEN];
- X
- X while (fgets(line,MAX_LINE_LEN,a)) {
- X process_line(line, b);
- X }
- X}
- X
- Xprocess_line(line, b)
- X char *line;
- X FILE *b;
- X{
- X switch(line[0]) { /* control character */
- X case '?': { /* interactive help entry */
- X break; /* ignore */
- X }
- X case '@': { /* start/end table */
- X break; /* ignore */
- X }
- X case '#': { /* latex table entry */
- X break; /* ignore */
- X }
- X case '%': { /* troff table entry */
- X break; /* ignore */
- X }
- X case '\n': /* empty text line */
- X case ' ': { /* normal text line */
- X break;
- X }
- X default: {
- X if (isdigit(line[0])) { /* start of section */
- X /* ignore */
- X } else
- X fputs(line,b); /* output bad line */
- X break;
- X }
- X }
- X}
- X
- *-*-END-of-docs/checkdoc.c-*-*
- echo x - docs/doc2gih.c
- sed 's/^X//' >docs/doc2gih.c <<'*-*-END-of-docs/doc2gih.c-*-*'
- X/*
- X * doc2gih.c -- program to convert Gnuplot .DOC format to gnuplot
- X * interactive help (.GIH) format.
- X *
- X * This involves stripping all lines with a leading digit or
- X * a leading @, #, or %.
- X * Modified by Russell Lang from hlp2ms.c by Thomas Williams
- X *
- X * usage: doc2gih < file.doc > file.gih
- X *
- X * Original version by David Kotz used the following one line script!
- X * sed '/^[0-9@#%]/d' file.doc > file.gih
- X */
- X
- X#include <stdio.h>
- X#include <ctype.h>
- X
- X#define MAX_LINE_LEN 256
- X#define TRUE 1
- X#define FALSE 0
- X
- Xmain(argc,argv)
- Xint argc;
- Xchar **argv;
- X{
- XFILE * infile;
- XFILE * outfile;
- X infile = stdin;
- X outfile = stdout;
- X if (argc > 3) {
- X fprintf(stderr,"Usage: %s infile outfile\n", argv[0]);
- X exit(1);
- X }
- X if (argc >= 2)
- X if ( (infile = fopen(argv[1],"r")) == (FILE *)NULL) {
- X fprintf(stderr,"%s: Can't open %s for reading\n",
- X argv[0], argv[1]);
- X exit(1);
- X }
- X if (argc == 3)
- X if ( (outfile = fopen(argv[2],"w")) == (FILE *)NULL) {
- X fprintf(stderr,"%s: Can't open %s for writing\n",
- X argv[0], argv[2]);
- X }
- X
- X convert(infile,outfile);
- X exit(0);
- X}
- X
- X
- Xconvert(a,b)
- X FILE *a,*b;
- X{
- X static char line[MAX_LINE_LEN];
- X
- X while (fgets(line,MAX_LINE_LEN,a)) {
- X process_line(line, b);
- X }
- X}
- X
- Xprocess_line(line, b)
- X char *line;
- X FILE *b;
- X{
- X switch(line[0]) { /* control character */
- X case '?': { /* interactive help entry */
- X (void) fputs(line,b);
- X break;
- X }
- X case '@': { /* start/end table */
- X break; /* ignore */
- X }
- X case '#': { /* latex table entry */
- X break; /* ignore */
- X }
- X case '%': { /* troff table entry */
- X break; /* ignore */
- X }
- X case '\n': /* empty text line */
- X case ' ': { /* normal text line */
- X (void) fputs(line,b);
- X break;
- X }
- X default: {
- X if (isdigit(line[0])) { /* start of section */
- X /* ignore */
- X } else
- X fprintf(stderr, "unknown control code '%c' in column 1\n",
- X line[0]);
- X break;
- X }
- X }
- X}
- X
- *-*-END-of-docs/doc2gih.c-*-*
- echo x - docs/doc2hlp.c
- sed 's/^X//' >docs/doc2hlp.c <<'*-*-END-of-docs/doc2hlp.c-*-*'
- X/*
- X * doc2hlp.c -- program to convert Gnuplot .DOC format to
- X * VMS help (.HLP) format.
- X *
- X * This involves stripping all lines with a leading ?,
- X * @, #, or %.
- X * Modified by Russell Lang from hlp2ms.c by Thomas Williams
- X *
- X * usage: doc2hlp < file.doc > file.hlp
- X *
- X * Original version by David Kotz used the following one line script!
- X * sed '/^[?@#%]/d' file.doc > file.hlp
- X */
- X
- X#include <stdio.h>
- X#include <ctype.h>
- X
- X#define MAX_LINE_LEN 256
- X#define TRUE 1
- X#define FALSE 0
- X
- Xmain()
- X{
- X convert(stdin,stdout);
- X exit(0);
- X}
- X
- X
- Xconvert(a,b)
- X FILE *a,*b;
- X{
- X static char line[MAX_LINE_LEN];
- X
- X while (fgets(line,MAX_LINE_LEN,a)) {
- X process_line(line, b);
- X }
- X}
- X
- Xprocess_line(line, b)
- X char *line;
- X FILE *b;
- X{
- X switch(line[0]) { /* control character */
- X case '?': { /* interactive help entry */
- X break; /* ignore */
- X }
- X case '@': { /* start/end table */
- X break; /* ignore */
- X }
- X case '#': { /* latex table entry */
- X break; /* ignore */
- X }
- X case '%': { /* troff table entry */
- X break; /* ignore */
- X }
- X case '\n': /* empty text line */
- X case ' ': { /* normal text line */
- X (void) fputs(line,b);
- X break;
- X }
- X default: {
- X if (isdigit(line[0])) { /* start of section */
- X (void) fputs(line,b);
- X } else
- X fprintf(stderr, "unknown control code '%c' in column 1\n",
- X line[0]);
- X break;
- X }
- X }
- X}
- *-*-END-of-docs/doc2hlp.c-*-*
- echo x - docs/doc2hlp.com
- sed 's/^X//' >docs/doc2hlp.com <<'*-*-END-of-docs/doc2hlp.com-*-*'
- X$ def/user sys$input [.docs]gnuplot.doc
- X$ def/user sys$output []gnuplot.hlp
- X$ run doc2hlp
- *-*-END-of-docs/doc2hlp.com-*-*
- echo x - docs/doc2ms.c
- sed 's/^X//' >docs/doc2ms.c <<'*-*-END-of-docs/doc2ms.c-*-*'
- X/*
- X * doc2ms.c -- program to convert Gnuplot .DOC format to *roff -ms document
- X * From hlp2ms by Thomas Williams
- X *
- X * Modified by Russell Lang, 2nd October 1989
- X * to make vms help level 1 and 2 create the same ms section level.
- X *
- X * Modified to become doc2ms by David Kotz dfk@cs.duke.edu 12/89
- X * Added table and backquote support.
- X *
- X * usage: doc2ms < file.doc > file.ms
- X *
- X * where file.doc is a VMS .DOC file, and file.ms will be a [nt]roff
- X * document suitable for printing with nroff -ms or troff -ms
- X *
- X * typical usage for GNUPLOT:
- X *
- X * doc2ms < gnuplot.doc | troff -ms
- X */
- X
- Xstatic char rcsid[] = "$Id: doc2ms.c,v 1.1 90/01/11 15:43:54 dfk Exp Locker: dfk $";
- X
- X#include <stdio.h>
- X#include <ctype.h>
- X
- X#define MAX_NAME_LEN 256
- X#define MAX_LINE_LEN 256
- X#define LINE_SKIP 3
- X
- X#define TRUE 1
- X#define FALSE 0
- X
- Xtypedef int boolean;
- X
- Xstatic boolean intable = FALSE;
- X
- Xmain()
- X{
- X init(stdout);
- X convert(stdin,stdout);
- X finish(stdout);
- X exit(0);
- X}
- X
- X
- Xinit(b)
- XFILE *b;
- X{
- X /* in nroff, increase line length by 8 and don't adjust lines */
- X (void) fputs(".if n \\{.nr LL +8m\n.na \\}\n",b);
- X (void) fputs(".nr PO +0.3i\n",b);
- X (void) fputs(".so titlepage.ms\n",b);
- X (void) fputs(".pn 1\n",b);
- X (void) fputs(".ds CH GNUPLOT\n",b);
- X (void) fputs(".ds RH Page %\n",b);
- X (void) fputs(".bp\n",b);
- X (void) fputs(".nr PS 12\n",b);
- X (void) fputs(".nr VS 13\n",b);
- X (void) fputs(".ta 1.5i 3.0i 4.5i 6.0i 7.5i\n",b);
- X (void) fputs("\\&\n.sp 3\n.PP\n",b);
- X /* following line commented out by rjl
- X (void) fputs(".so intro\n",b);
- X */
- X}
- X
- X
- Xconvert(a,b)
- X FILE *a,*b;
- X{
- X static char line[MAX_LINE_LEN];
- X
- X while (fgets(line,MAX_LINE_LEN,a)) {
- X process_line(line, b);
- X }
- X}
- X
- Xprocess_line(line, b)
- X char *line;
- X FILE *b;
- X{
- X switch(line[0]) { /* control character */
- X case '?': { /* interactive help entry */
- X break; /* ignore */
- X }
- X case '@': { /* start/end table */
- X if (intable) {
- X (void) fputs(".TE\n", b);
- X (void) fputs(".EQ\ndelim off\n.EN\n\n",b);
- X intable = FALSE;
- X } else {
- X (void) fputs("\n.EQ\ndelim $$\n.EN\n",b);
- X (void) fputs(".TS\ncenter box tab (@) ;\n", b);
- X (void) fputs("c c l .\n", b);
- X intable = TRUE;
- X }
- X /* ignore rest of line */
- X break;
- X }
- X case '#': { /* latex table entry */
- X break; /* ignore */
- X }
- X case '%': { /* troff table entry */
- X if (intable)
- X (void) fputs(line+1, b); /* copy directly */
- X else
- X fprintf(stderr, "error: % line found outside of table\n");
- X break;
- X }
- X case '\n': /* empty text line */
- X case ' ': { /* normal text line */
- X if (intable)
- X break; /* ignore while in table */
- X switch(line[1]) {
- X case ' ': {
- X /* verbatim mode */
- X fputs(".br\n",b);
- X fputs(line+1,b);
- X fputs(".br\n",b);
- X break;
- X }
- X case '\'': {
- X fputs("\\&",b);
- X putms(line+1,b);
- X break;
- X }
- X default: {
- X putms(line+1,b);
- X break;
- X }
- X break;
- X }
- X break;
- X }
- X default: {
- X if (isdigit(line[0])) { /* start of section */
- X if (!intable) /* ignore while in table */
- X section(line, b);
- X } else
- X fprintf(stderr, "unknown control code '%c' in column 1\n",
- X line[0]);
- X break;
- X }
- X }
- X}
- X
- X
- X/* process a line with a digit control char */
- X/* starts a new [sub]section */
- X
- Xsection(line, b)
- X char *line;
- X FILE *b;
- X{
- X static char string[MAX_LINE_LEN];
- X int sh_i;
- X static int old = 1;
- X
- X (void) sscanf(line,"%d %[^\n]s",&sh_i,string);
- X
- X (void) fprintf(b,".sp %d\n",(sh_i == 1) ? LINE_SKIP : LINE_SKIP-1);
- X
- X if (sh_i > old) {
- X do
- X if (old!=1) /* this line added by rjl */
- X (void) fputs(".RS\n.IP\n",b);
- X while (++old < sh_i);
- X }
- X else if (sh_i < old) {
- X do
- X if (sh_i!=1) /* this line added by rjl */
- X (void) fputs(".RE\n.br\n",b);
- X while (--old > sh_i);
- X }
- X
- X /* added by dfk to capitalize section headers */
- X if (islower(string[0]))
- X string[0] = toupper(string[0]);
- X
- X /* next 3 lines added by rjl */
- X if (sh_i!=1)
- X (void) fprintf(b,".NH %d\n%s\n.sp 1\n.LP\n",sh_i-1,string);
- X else
- X (void) fprintf(b,".NH %d\n%s\n.sp 1\n.LP\n",sh_i,string);
- X old = sh_i;
- X
- X (void) fputs(".XS\n",b);
- X (void) fputs(string,b);
- X (void) fputs("\n.XE\n",b);
- X}
- X
- Xputms(s, file)
- X char *s;
- X FILE *file;
- X{
- X static boolean inquote = FALSE;
- X
- X while (*s != '\0') {
- X switch (*s) {
- X case '`': { /* backquote -> boldface */
- X if (inquote) {
- X fputs("\\fR", file);
- X inquote = FALSE;
- X } else {
- X fputs("\\fB", file);
- X inquote = TRUE;
- X }
- X break;
- X }
- X case '\\': { /* backslash */
- X fputs("\\\\", file);
- X break;
- X }
- X default: {
- X fputc(*s, file);
- X break;
- X }
- X }
- X s++;
- X }
- X}
- X
- Xfinish(b) /* spit out table of contents */
- XFILE *b;
- X{
- X (void) fputs(".pn 1\n",b);
- X (void) fputs(".ds RH %\n",b);
- X (void) fputs(".af % i\n",b);
- X (void) fputs(".bp\n.PX\n",b);
- X}
- *-*-END-of-docs/doc2ms.c-*-*
- echo x - docs/doc2tex.c
- sed 's/^X//' >docs/doc2tex.c <<'*-*-END-of-docs/doc2tex.c-*-*'
- X/*
- X * doc2tex.c -- program to convert Gnuplot .DOC format to LaTeX document
- X * Also will work for VMS .HLP files.
- X * Modified by Russell Lang from hlp2ms.c by Thomas Williams
- X * Extended by David Kotz to support quotes ("), backquotes, tables.
- X *
- X * usage: doc2tex < file.doc > file.tex
- X *
- X * where file.doc is a Gnuplot .DOC file, and file.tex will be an
- X * article document suitable for printing with LaTeX.
- X *
- X * typical usage for GNUPLOT:
- X *
- X * doc2tex < gnuplot.doc > gnuplot.tex
- X * latex gnuplot.tex ; latex gnuplot.tex
- X */
- X
- Xstatic char rcsid[] = "$Id: doc2tex.c,v 1.1 90/01/11 15:44:06 dfk Exp Locker: dfk $";
- X
- X#include <stdio.h>
- X#include <ctype.h>
- X#include <strings.h>
- X
- X#define MAX_NAME_LEN 256
- X#define MAX_LINE_LEN 256
- X#define TRUE 1
- X#define FALSE 0
- X
- Xtypedef int boolean;
- X
- Xboolean intable = FALSE;
- Xboolean verb = FALSE;
- X
- Xmain()
- X{
- X init(stdout);
- X convert(stdin,stdout);
- X finish(stdout);
- X exit(0);
- X}
- X
- X
- Xinit(b)
- XFILE *b;
- X{
- X (void) fputs("\\input{titlepage.tex}\n",b);
- X}
- X
- X
- Xconvert(a,b)
- X FILE *a,*b;
- X{
- X static char line[MAX_LINE_LEN];
- X
- X while (fgets(line,MAX_LINE_LEN,a)) {
- X process_line(line, b);
- X }
- X}
- X
- Xprocess_line(line, b)
- X char *line;
- X FILE *b;
- X{
- X switch(line[0]) { /* control character */
- X case '?': { /* interactive help entry */
- X break; /* ignore */
- X }
- X case '@': { /* start/end table */
- X if (intable) {
- X (void) fputs("\\hline\n\\end{tabular}\n", b);
- X (void) fputs("\\end{center}\n",b);
- X intable = FALSE;
- X } else {
- X if (verb) {
- X (void) fputs("\\end{verbatim}\n",b);
- X verb=FALSE;
- X }
- X (void) fputs("\n\\begin{center}\n", b);
- X (void) fputs("\\begin{tabular}{|ccl|} \\hline\n", b);
- X intable = TRUE;
- X }
- X /* ignore rest of line */
- X break;
- X }
- X case '#': { /* latex table entry */
- X if (intable)
- X (void) fputs(line+1, b); /* copy directly */
- X else
- X fprintf(stderr, "error: # line found outside of table\n");
- X break;
- X }
- X case '%': { /* troff table entry */
- X break; /* ignore */
- X }
- X case '\n': /* empty text line */
- X case ' ': { /* normal text line */
- X if (intable)
- X break; /* ignore while in table */
- X if (line[1] == ' ') {
- X /* verbatim mode */
- X if (!verb) {
- X (void) fputs("\\begin{verbatim}\n",b);
- X verb=TRUE;
- X }
- X (void) fputs(line+1,b);
- X } else {
- X if (verb) {
- X (void) fputs("\\end{verbatim}\n",b);
- X verb=FALSE;
- X }
- X puttex(line+1,b);
- X }
- X break;
- X }
- X default: {
- X if (isdigit(line[0])) { /* start of section */
- X if (!intable) /* ignore while in table */
- X section(line, b);
- X } else
- X fprintf(stderr, "unknown control code '%c' in column 1\n",
- X line[0]);
- X break;
- X }
- X }
- X}
- X
- X/* process a line with a digit control char */
- X/* starts a new [sub]section */
- X
- Xsection(line, b)
- X char *line;
- X FILE *b;
- X{
- X static char string[MAX_LINE_LEN];
- X int sh_i;
- X
- X if (verb) {
- X (void) fputs("\\end{verbatim}\n",b);
- X verb=FALSE;
- X }
- X (void) sscanf(line,"%d %[^\n]s",&sh_i,string);
- X switch(sh_i)
- X {
- X case 1:
- X (void) fprintf(b,"\\section{");
- X break;
- X case 2:
- X (void) fprintf(b,"\\section{");
- X break;
- X case 3:
- X (void) fprintf(b,"\\subsection{");
- X break;
- X case 4:
- X (void) fprintf(b,"\\subsubsection{");
- X break;
- X default:
- X case 5:
- X (void) fprintf(b,"\\paragraph{");
- X break;
- X }
- X if (islower(string[0]))
- X string[0] = toupper(string[0]);
- X puttex(string,b);
- X (void) fprintf(b,"}\n");
- X}
- X
- X/* put text in string str to file while buffering special TeX characters */
- Xputtex(str,file)
- XFILE *file;
- Xregister char *str;
- X{
- Xregister char ch;
- Xstatic boolean inquote = FALSE;
- X
- X while( (ch = *str++) != '\0') {
- X switch(ch) {
- X case '#':
- X case '$':
- X case '%':
- X case '&':
- X case '_':
- X case '{':
- X case '}':
- X (void) fputc('\\',file);
- X (void) fputc(ch,file);
- X break;
- X case '\\':
- X (void) fputs("$\\backslash$",file);
- X break;
- X case '~':
- X (void) fputs("\\~{\\ }",file);
- X break;
- X case '^':
- X (void) fputs("\\verb+^+",file);
- X break;
- X case '>':
- X case '<':
- X case '|':
- X (void) fputc('$',file);
- X (void) fputc(ch,file);
- X (void) fputc('$',file);
- X break;
- X case '"':
- X /* peek at next character: if space, end of quote */
- X if (*str == NULL || isspace(*str) || ispunct(*str))
- X (void) fputs("''", file);
- X else
- X (void) fputs("``", file);
- X break;
- X case '`': /* backquotes mean boldface */
- X if (inquote) {
- X fputs("}", file);
- X inquote = FALSE;
- X } else {
- X fputs("{\\bf ", file);
- X inquote = TRUE;
- X }
- X break;
- X default:
- X (void) fputc(ch,file);
- X break;
- X }
- X }
- X}
- X
- X
- Xfinish(b)
- XFILE *b;
- X{
- X (void) fputs("\\end{document}\n",b);
- X}
- *-*-END-of-docs/doc2tex.c-*-*
- echo x - docs/gnuplot.1
- sed 's/^X//' >docs/gnuplot.1 <<'*-*-END-of-docs/gnuplot.1-*-*'
- X.\" dummy line
- X.TH GNUPLOT 1 "13 February 1990"
- X.UC 4
- X.SH NAME
- Xgnuplot \- an interactive plotting program
- X.SH SYNOPSIS
- X.B gnuplot file ...
- X.br
- X.SH DESCRIPTION
- X.I Gnuplot
- Xis a command-driven interactive function plotting program.
- X.PP
- XIf files are given,
- X.I gnuplot
- Xloads each file with the
- X.I load
- Xcommand, in the order specified.
- X.I Gnuplot
- Xexits after the last file is processed.
- X.PP
- XHere are some of its features:
- X.PP
- XPlots any number of functions, built up of C operators, C library
- Xfunctions, and some things C doesn't have like **, sgn(), etc. Also
- Xsupport for plotting data files, to compare actual
- Xdata to theoretical curves.
- X.PP
- XUser-defined X and Y ranges (optional auto-ranging), smart axes scaling,
- Xsmart tic marks.
- X.PP
- XLabelling of X and Y axes.
- X.PP
- XUser-defined constants and functions.
- X.PP
- XSupport through a generalized graphics driver for
- XAED 512,
- XAED 767,
- XBBN BitGraph,
- XRoland DXY800A,
- XEEPIC,
- XEpson LX-800,
- XFig,
- XHP2623,
- XHP2648,
- XHP75xx,
- XHPGL,
- XIBM Proprinter,
- XImagen,
- XIris 4D,
- XKermit-MS,
- XLaTeX,
- XNEC CP6 pinwriter,
- XPostScript,
- XQMS QUIC,
- XReGis (VT125 and VT2xx),
- XSelanar,
- XTek 401x,
- XVectrix 384,
- Xand unixplot.
- XThe PC version compiled by Microsoft C
- Xsupports IBM CGA, EGA, VGA, Hercules, ATT 6300,
- Xand Corona 325 graphics.
- XThe PC version compiled by Turbo C
- Xsupports IBM CGA, EGA, MCGA, VGA and Hercules graphics.
- XOther devices can be added simply, but will require recompiling.
- X.PP
- XShell escapes and command line substitution.
- X.PP
- XLoad and save capability.
- X.PP
- XOutput redirection.
- X.PP
- XAll computations performed in the complex domain. Just the real part is
- Xplotted by default, but functions like imag() and abs() and arg() are
- Xavailable to override this.
- X.SH AUTHORS
- XThomas Williams, Pixar Corporation,
- X.br
- X(pixar!info-gnuplot@sun.com)
- X.br
- Xand Colin Kelley.
- X.PP
- XAdditions for labelling by Russell Lang, Monash University, Australia.
- X.br
- X(rjl@monu1.cc.monash.edu.au)
- X.br
- XFurther additions by David Kotz, Duke University, North Carolina, USA.
- X.br
- X(dfk@cs.duke.edu)
- X.SH BUGS
- XThe atan() function does not work correctly for complex arguments.
- X.br
- XSee the
- X.I help bugs
- Xcommand in gnuplot.
- X.SH SEE ALSO
- XSee the printed manual or the on-line help for details on specific commands.
- *-*-END-of-docs/gnuplot.1-*-*
- echo x - docs/lasergnu.1
- sed 's/^X//' >docs/lasergnu.1 <<'*-*-END-of-docs/lasergnu.1-*-*'
- X.TH LASERGNU l
- X.SH NAME
- Xlasergnu \- send gnuplot output to a printer
- X.SH SYNOPSIS
- X.B lasergnu
- X[ flags ] plot-command...
- X.SH DESCRIPTION
- X.I lasergnu
- Xruns
- X.IR gnuplot (1)
- Xin an environment to produce typeset output on an IMAGEN or
- XPostscript printer.
- X.PP
- XThe
- X.B gnuplot
- Xcommands
- X.B plot-command
- Xare performed and the output sent to the printer.
- XIf the
- X.B -f
- Xoption specifies a file for input, the plot command is optional.
- XThe command-line plot commands are executed prior to any in the
- Xfile(s).
- X.PP
- XFor example, to plot the function
- X.I sin(x)
- Xfrom -1 to +1, and to use printer im1, use the command
- X.br
- X.nf
- X lasergnu -Pim1 'plot [-1:1] sin(x) with lines'
- X.fi
- XTo execute the gnuplot command file
- X.I myplot,
- Xon the postscript printer lw0, use the command
- X.br
- X.nf
- X lasergnu -Plw0 -p -f myplot
- X.fi
- XThe following switches are recognized:
- X.TP
- X.BI \-p
- XUse the postscript language to make the plot, instead of Impress.
- XThis is for use on Postscript printers only.
- X.TP
- X.BI \-P\0 printer
- XThe output of this program is intended for
- X.I printer.
- X\ If the file is being spooled, this determines the printer it is spooled
- Xto (default: $LASER).
- XBe sure to use the -p flag if the printer is a postscript printer.
- X.TP
- X.BI \-f\0 file
- XTake gnuplot commands from the named file.
- XMultiple files may be supplied with separate -f options.
- X.TP
- X.BI \-t\0 title
- XSpecify the title of the plot.
- X.TP
- X.BI \-b
- XDo not print a banner page.
- X.TP
- X.BI \-J
- XDo not print a banner page.
- X.TP
- X.B \-help
- XPrints a list of options.
- X.SH SEE ALSO
- Xgnuplot(l), lpr(1)
- *-*-END-of-docs/lasergnu.1-*-*
- echo x - docs/titlepage.ms
- sed 's/^X//' >docs/titlepage.ms <<'*-*-END-of-docs/titlepage.ms-*-*'
- X.nr HM 3.2i
- X.TL
- XGNUPLOT
- X.br
- XAn Interactive Plotting Program
- X.sp
- X.AU
- XThomas Williams & Colin Kelley
- X.br
- XDavid Kotz & Russell Lang (Version 1.2)
- X.AI
- Xpixar!info-gnuplot@sun.com
- X\*(DY
- X.br
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- XThis manual is for GNUPLOT version 1.2.
- X.AB no
- X.AE
- X.LP
- X.nr HM 1.2i
- *-*-END-of-docs/titlepage.ms-*-*
- echo x - docs/titlepage.tex
- sed 's/^X//' >docs/titlepage.tex <<'*-*-END-of-docs/titlepage.tex-*-*'
- X\documentstyle{article}
- X\setlength{\textwidth}{6.25in}
- X\setlength{\oddsidemargin}{0.5cm}
- X\setlength{\topmargin}{-0.5in}
- X\setlength{\textheight}{9in}
- X\setlength{\parskip}{1ex}
- X\setlength{\parindent}{0pt}
- X\begin{document}
- X
- X\pagestyle{empty}
- X \rule{0in}{3in}
- X \begin{center}
- X {\huge\bf GNUPLOT}\\
- X \vspace{3ex}
- X {\Large An Interactive Plotting Program}\\
- X \vspace{2ex}
- X \large
- X Thomas Williams \& Colin Kelley\\
- X \vspace{2ex}
- X Version 1.2: \\
- X David Kotz \& Russell Lang\\
- X \vspace{2ex}
- X \verb+pixar!info-gnuplot@sun.com+
- X
- X \vfill
- X {\small This manual is for GNUPLOT version 1.2.}
- X
- X \end{center}
- X\newpage
- X
- X\tableofcontents
- X\newpage
- X
- X\setcounter{page}{1}
- X\pagestyle{myheadings}
- X\markboth{GNUPLOT 1.2}{GNUPLOT 1.2}
- X
- *-*-END-of-docs/titlepage.tex-*-*
- exit
-
-
-