Path: utzoo!utgpu!watmath!clyde!att!pacbell!ames!haven!uvaarpa!mcnc!duke!romeo!dfk From: dfk@romeo.cs.duke.edu (David F. Kotz) Newsgroups: comp.text Subject: GnuTeX version 1.3 source part 2 Keywords: gnutex part 2 Message-ID: <13025@duke.cs.duke.edu> Date: 10 Jan 89 16:51:54 GMT Sender: news@duke.cs.duke.edu Lines: 4047 #! /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: # gnutex # This archive created: Tue Jan 10 11:16:46 1989 export PATH; PATH=/bin:$PATH if test ! -d 'gnutex' then mkdir 'gnutex' fi cd 'gnutex' if test ! -d 'doc' then mkdir 'doc' fi cd 'doc' if test ! -d 'example' then mkdir 'example' fi cd 'example' if test -f '3.dat' then echo shar: will not over-write existing file "'3.dat'" else sed 's/^X//' << \SHAR_EOF > '3.dat' X-20.000000 -9.125028 X-19.000000 -9.109280 X-18.000000 -9.091787 X-17.000000 -9.072243 X-16.000000 -9.050265 X-15.000000 -9.025369 X-14.000000 -8.996933 X-13.000000 -8.964147 X-12.000000 -8.925931 X-11.000000 -8.880819 X-10.000000 -8.826766 X-9.000000 -8.760835 X-8.000000 -8.678648 X-7.000000 -8.573396 X-6.000000 -8.433886 X-5.000000 -8.240405 X-4.000000 -7.954906 X-3.000000 -7.494275 X-2.000000 -6.642892 X-1.000000 -4.712389 X0.000000 0.000000 X1.000000 4.712389 X2.000000 6.642892 X3.000000 7.494275 X4.000000 7.954906 X5.000000 8.240405 X6.000000 8.433886 X7.000000 8.573396 X8.000000 8.678648 X9.000000 8.760835 X10.000000 8.826766 X11.000000 8.880819 X12.000000 8.925931 X13.000000 8.964147 X14.000000 8.996933 X15.000000 9.025369 X16.000000 9.050265 X17.000000 9.072243 X18.000000 9.091787 X19.000000 9.109280 SHAR_EOF fi # end of overwriting check if test -f 'README' then echo shar: will not over-write existing file "'README'" else sed 's/^X//' << \SHAR_EOF > 'README' XThis directory has two simple examples of the use of gnutex. The first Xuses LaTeX. The file second demonstrates some pure gnuplot aspects, Xusing lasergnu instead of LaTeX. X XThe Makefile for the gnutex manual, in ../manual/Makefile, is a good Xexample of a Makefile to maintain a document containing gnutex plots. SHAR_EOF fi # end of overwriting check if test -f 'pic.tex' then echo shar: will not over-write existing file "'pic.tex'" else sed 's/^X//' << \SHAR_EOF > 'pic.tex' X\documentstyle{article} X\textwidth=6in X\begin{document} X \begin{center} X \input{plot} X \end{center} X\end{document} SHAR_EOF fi # end of overwriting check if test -f '1.dat' then echo shar: will not over-write existing file "'1.dat'" else sed 's/^X//' << \SHAR_EOF > '1.dat' X-20.000000 -3.041676 X-19.000000 -3.036427 X-18.000000 -3.030596 X-17.000000 -3.024081 X-16.000000 -3.016755 X-15.000000 -3.008456 X-14.000000 -2.998978 X-13.000000 -2.988049 X-12.000000 -2.975310 X-11.000000 -2.960273 X-10.000000 -2.942255 X-9.000000 -2.920278 X-8.000000 -2.892883 X-7.000000 -2.857799 X-6.000000 -2.811295 X-5.000000 -2.746802 X-4.000000 -2.651635 X-3.000000 -2.498092 X-2.000000 -2.214297 X-1.000000 -1.570796 X0.000000 0.000000 X1.000000 1.570796 X2.000000 2.214297 X3.000000 2.498092 X4.000000 2.651635 X5.000000 2.746802 X6.000000 2.811295 X7.000000 2.857799 X8.000000 2.892883 X9.000000 2.920278 X10.000000 2.942255 X11.000000 2.960273 X12.000000 2.975310 X13.000000 2.988049 X14.000000 2.998978 X15.000000 3.008456 X16.000000 3.016755 X17.000000 3.024081 X18.000000 3.030596 X19.000000 3.036427 SHAR_EOF fi # end of overwriting check if test -f '2.dat' then echo shar: will not over-write existing file "'2.dat'" else sed 's/^X//' << \SHAR_EOF > '2.dat' X-20.000000 -6.083352 X-19.000000 -6.072853 X-18.000000 -6.061191 X-17.000000 -6.048162 X-16.000000 -6.033510 X-15.000000 -6.016913 X-14.000000 -5.997955 X-13.000000 -5.976098 X-12.000000 -5.950620 X-11.000000 -5.920546 X-10.000000 -5.884511 X-9.000000 -5.840556 X-8.000000 -5.785765 X-7.000000 -5.715597 X-6.000000 -5.622591 X-5.000000 -5.493603 X-4.000000 -5.303271 X-3.000000 -4.996183 X-2.000000 -4.428595 X-1.000000 -3.141593 X0.000000 0.000000 X1.000000 3.141593 X2.000000 4.428595 X3.000000 4.996183 X4.000000 5.303271 X5.000000 5.493603 X6.000000 5.622591 X7.000000 5.715597 X8.000000 5.785765 X9.000000 5.840556 X10.000000 5.884511 X11.000000 5.920546 X12.000000 5.950620 X13.000000 5.976098 X14.000000 5.997955 X15.000000 6.016913 X16.000000 6.033510 X17.000000 6.048162 X18.000000 6.061191 X19.000000 6.072853 SHAR_EOF fi # end of overwriting check if test -f 'Makefile' then echo shar: will not over-write existing file "'Makefile'" else sed 's/^X//' << \SHAR_EOF > 'Makefile' X# Demo directory for gnutex X Xdemo1: X gnutex < demo1.gnu X latex pic X @echo ---------------------- X @echo Now print or view pic.dvi with some dvi output program X Xdemo2: X lasergnu -l -f demo2.gnu X Xclean: X rm -f *.aux *.log *.dvi *~ plot.tex SHAR_EOF fi # end of overwriting check if test -f 'demo1.gnu' then echo shar: will not over-write existing file "'demo1.gnu'" else sed 's/^X//' << \SHAR_EOF > 'demo1.gnu' Xset terminal latex Xset output "plot.tex" Xset size 3.5,3 Xset title "This is a very long title\\because it has\\three lines" Xset xlabel "This is the $x$ axis\\with more than two\\lines in the label" Xset ylabel "This is a longer\\version of\\the $y$ axis" Xset style new1 "$\otimes$" 3 "\circle*{100}" "\circle*{200}" "\circle*{300}" Xplot "3.dat" with new1 SHAR_EOF fi # end of overwriting check if test -f 'demo2.gnu' then echo shar: will not over-write existing file "'demo2.gnu'" else sed 's/^X//' << \SHAR_EOF > 'demo2.gnu' Xset samples 50 Xplot [-10:10] sin(x),atan(x),cos(atan(x)) Xset samples 100 Xplot [-pi/2:pi] cos(x),-(sin(x) > sin(x+1) ? sin(x) : sin(x+1)) Xset samples 200 Xplot [-3:5] asin(x),acos(x) Xplot [-30:20] besj0(x)*0.12e1 with impulses, (x**besj0(x))-2.5 with points Xset samples 400 Xplot [-10:10] real(sin(x)**besj0(x)) Xplot [-5*pi:5*pi] [-5:5] real(tan(x)/atan(x)), 1/x Xset autoscale Xset samples 800 Xplot [-30:20] sin(x*20)*atan(x) Xplot [-19:19] '1.dat' with impulses ,'2.dat' ,'3.dat' with lines SHAR_EOF fi # end of overwriting check cd .. cd .. if test ! -d 'help' then mkdir 'help' fi cd 'help' if test ! -d 'plot' then mkdir 'plot' fi cd 'plot' if test -f 'ranges' then echo shar: will not over-write existing file "'ranges'" else sed 's/^X//' << \SHAR_EOF > 'ranges' XThese two options specify the region of the plot which will be displayed. X XRanges may be provided on the 'plot' command line as synonyms for the X'set xrange' and 'set yrange' commands. X XSyntax: [{dummy-var =} {xmin : xmax}] { [{ymin : ymax}] } X XWhere dummy-var is the independent variable ('x' is used by default) and Xthe min and max terms can be expressions or constants. X XBoth the min and max terms are optional. The ':' is also optional if Xneither a min nor a max term is specified. This allows '[]' to be used Xas a null range specification. X XSpecifying a Y range turns autoscaling OFF. X XExamples: X Xplot cos(x) ; use current ranges Xplot [-10:30] sin(pi*x)/(pi*x) ; set xrange only Xplot [t = -10 :30] sin(pi*t)/(pi*t) ; same, but use t as dummy-var Xplot [-pi:pi] [-3:3] tan(x), 1/x ; set y and xranges Xplot [] [-2:sin(5)*-8] sin(x)**besj0(x) ; set only yrange Xplot [:200] [-pi:] exp(sin(x)) ; set xmax and ymin only SHAR_EOF fi # end of overwriting check if test -f '.general' then echo shar: will not over-write existing file "'.general'" else sed 's/^X//' << \SHAR_EOF > '.general' XThe 'plot' command is the primary command of the program. It displays Xfunctions and data in many, many ways. The full syntax of this Xcommand is: X X plot {ranges} {style} {, {style}...} X XWhere is either a mathematical expression or the name of a Xdata file enclosed in quotes. User-defined functions and variables may also Xbe defined here. X XCurly braces {,} denote optional items. X XA 'plot' command can be as simple as X X plot sin(x) X Xor as complex as (!) X X plot [t=1:100] [-pi:pi*2] tan(t), "data.1" with lines, besj0(t) with points SHAR_EOF fi # end of overwriting check if test -f 'style' then echo shar: will not over-write existing file "'style'" else sed 's/^X//' << \SHAR_EOF > 'style' XPlots may be displayed in one of these styles: 'lines', 'points', X'linespoints', 'impulses', or 'dots'. The 'lines' style connects Xadjacent points with lines. The 'points' style displays a small Xsymbol at each point. The 'linespoints' style is a combination of the Xprevious two styles. The 'impulses' style displays a vertical line Xfrom the X axis to each point. The 'dots' style is like the 'points' Xstyle except a very tiny dot is plotted at each point, and the symbol Xdoes not vary from plot to plot. This is useful for plotting very many Xpoints to get a feel for the distribution. In addition, for LaTeX Xoutput only, there are user-defined styles (see the 'set style' Xcommand in 'user-styles'). X XDefault styles are chosen with the 'set function style' and 'set data style' Xcommands. X XSyntax: with