[comp.text] TeXhax Digest V88 #62

TeXhax@Score.Stanford.EDU (TeXhax Digest) (07/11/88)

TeXhax Digest   Sunday, July 10, 1988   Volume 88 : Issue 62

Moderator: Malcolm Brown

Today's Topics:

                            PiCTeX macros
                        wrap your flat files!
          Lining up a column of numbers, and Re: Hypenation
                 Hyphenation (TeXhax Digest V88 #59)
                       the "fixup" style option
                           dvi2ps with NTX
                      Underscore in identifiers
                       bib stuff: r2bib & keys
                 LateX question - vertical alignment.
                       Double Spacing in Theses
                    Re: Underscore in identifiers
                           tgrind for LaTeX

----------------------------------------------------------------------

Date: Wed, 29 Jun 88 09:50:04 cdt
Subject: PiCTeX macros
From: grunwald@m.cs.uiuc.edu (Dirk Grunwald)

In TeXHaX V88 #59, David Huenemoerder asks about macros to plot error bars
in PiCTeX.

Attached, find two macros files. The file, errorbars.tex implements plots
with and without error bars. Each point in the plot is ``marked'', e.g.
with a $\bullet$, or whatever.

The second file, ``pointers.tex'', contains macros useful for pointing
at things in a PiCTeX graph. E.g., if you've got data like:

\put {\pointLeft{\Full}} [l] at 0.520833 42.4616
\plot
0 6.
0.0416667 6.36401
	....
0.520833 42.4616
/

you'll get an arrow pointing left with the tip of the arrow at the endpoint
of your data plot.

The PiCTeX manual can be ordered for $15 from:
  Michael J. Wichura 
  Department of Statistics 
  University of Chicago 
  5734 University Avenue 
  Chicago, IL. 60637-4931

----errorbars.tex----
%
%	TeX macros to plot error bars with the PicTeX macros.
%
%	These macros are largely derived from the examples in the back
%	of the PiCTeX manual.
%
%	To plot with a mark at each data point, simply say
%
%	\plotWith mark M at x1 y1 x2 y2 .... xN yN /
%
%	where "M" is a mark character {e.g. $\bullet$}
%
%	To include error bars in the plot, say:
%
%	\plotWithErrorBars mark M at
%		x1 y1 e1
%		x2 y2 e2 .... xN yN eN
%	/
%
%	The line-breaking isn't needed. Marks are placed on the graph
%	at (xi, yi) for each data point. Vertical error bars are drawn
%	from (xi, yi + ei) to (xi, yi - ei).
%
%	The cross-bar at the top and bottom of the error bars is normally
%	5 pts, but can be changed by setting the \crossbarlength dimen.
%
%
%	Dirk Grunwald Apr 20 1988
%
%
\newdimen\dyposition
\newdimen\crossbarlength
\crossbarlength=5pt
\newdimen\lastPlotX
\newdimen\lastPlotY
\newdimen\tmpPlotX
\newdimen\tmpPlotY
%
%
\def\plotErrorBar#1 #2 #3 #4{%
    \message{ Plot #4 at #1 #2 }%
    \put {#4} at {#1} {#2}
    \dyposition=\Ydistance{#3}
    \put{%
      \vbox{%
	\hsize=\crossbarlength%
	\hrule height \linethickness%
	\vskip -.5\linethickness%
	\centerline{\vrule width \linethickness height 2\dyposition}%
	\nointerlineskip%
	\vskip -.5\linethickness%
	\hrule height \linethickness}%
    } at {#1} {#2} }
%
\def\plotWithErrorBars mark #1 at #2 #3 #4 {%
    \def\errorBarMark{#1}%
    %
    %    plot first point
    %
    \plotErrorBar {#2} {#3} {#4} {\errorBarMark}
    \lastPlotX=\Xdistance{#2}%
    \lastPlotY=\Ydistance{#3}%
    \futurelet\nextcharacter\plotErrorBarLoop}
%
\def\plotErrorBarLoop{%
    \if/\nextcharacter%
	\def\plotErrorBarAction{\plotErrorBarFinish}%
    \else%
	\def\plotErrorBarAction{\plotErrorBarContinued}%
    \fi%
    \plotErrorBarAction}
%
\def\plotErrorBarFinish/ {}
%
\def\plotErrorBarContinued#1 #2 #3 {%
    \plotErrorBar {#1} {#2} {#3} {\errorBarMark}%
    \tmpPlotX = \Xdistance{#1}%
    \tmpPlotY = \Ydistance{#2}%
    \setdimensionmode%
    \plot {\lastPlotX} {\lastPlotY} {\tmpPlotX} {\tmpPlotY} /
    \setcoordinatemode%
    \lastPlotX = \tmpPlotX%
    \lastPlotY = \tmpPlotY%
    \futurelet\nextcharacter\plotErrorBarLoop}
%    
\def\plotWith mark #1 at #2 #3 {%
    \def\plotWithMark{#1}%
    %
    %    plot first point
    %
    \message{Plot {\plotWithMark} at #2 #3}%
    \put {\plotWithMark} at {#2} {#3}
    \lastPlotX=\Xdistance{#2}%
    \lastPlotY=\Ydistance{#3}%
    \futurelet\nextcharacter\plotWithLoop}
%
\def\plotWithLoop{%
    \if/\nextcharacter%
	\def\plotWithAction{\plotWithFinish}%
    \else%
	\def\plotWithAction{\plotWithContinued}%
    \fi%
    \plotWithAction}
%
\def\plotWithFinish/ {}
%
\def\plotWithContinued#1 #2 {%
    \message{ Plot {\plotWithMark} at #1 #2}%
    \put {\plotWithMark} at {#1} {#2}
    \tmpPlotX = \Xdistance{#1}%
    \tmpPlotY = \Ydistance{#2}%
    \setdimensionmode%
    \plot {\lastPlotX} {\lastPlotY} {\tmpPlotX} {\tmpPlotY} /
    \setcoordinatemode%
    \lastPlotX = \tmpPlotX%
    \lastPlotY = \tmpPlotY%
    \futurelet\nextcharacter\plotWithLoop}
    
----pointers.tex----
%
%	Pointing at things
%
%	Each macro points in a different direction. The arrow is at the
%	logical corner, e.g. if I \pointUpRight, the arrow is in the upper
%	right corner.
%
%	\pointRight{..text..} 
%	\pointLeft{..text..} 
%	\pointDown{..text..} 
%	\pointUp{..text..} 
%
%	\pointUpRight{..text..}
%	\pointUpLeft{..text..}
%	\pointDownRight{..text..}
%	\pointDownLeft{..text..}
%
%	No global boxes are used. Each macro is grouped and uses box0.
%
%	Dirk Grunwald Apr 20 1988
%
\def\pointRight#1{{#1$\rightarrow$}}
\def\pointLeft#1{{$\leftarrow$#1}}
%
\def\pointUpRight#1{%
\begingroup\offinterlineskip%
\setbox0=\hbox{#1}%
\vbox{\hbox{\hskip\wd0$\nearrow$}\copy0}\endgroup}
%
\def\pointUpLeft#1{%
\begingroup\offinterlineskip%
\setbox0=\hbox{$\nwarrow$}%
\vbox{\copy0\hbox{\hskip\wd0{}#1}}\endgroup}
%
\def\pointDownRight#1{%
\begingroup\offinterlineskip%
\setbox0=\hbox{#1}%
\vbox{\copy0\hbox{\hskip\wd0$\searrow$}}\endgroup}
%
\def\pointDownLeft#1{%
\begingroup\offinterlineskip%
\setbox0=\hbox{$\swarrow$}%
\vbox{\hbox{\hskip\wd0{}#1}\copy0}\endgroup}
%
\def\pointDown#1{%
\begingroup\offinterlineskip%
\setbox0=\hbox{#1}%
\vbox{\copy0\hbox to \wd0{\hfill$\downarrow$\hfill}}\endgroup}
%
\def\pointUp#1{%
\begingroup\offinterlineskip%
\setbox0=\hbox{#1}%
\vbox{\hbox to \wd0{\hfill$\uparrow$\hfill}\copy0}\endgroup}

------------------------------

Date: Wed, 29 Jun 88 09:38:42 PDT
From: toms@ncifcrf.gov
Subject: wrap your flat files!

#!/bin/csh -f
#(ie run the cshell on this but don't read the .cshrc)
#
echo "version = 2.08 of wrap 1988 Feb 9 Tom Schneider"
# from: toms@ncifcrf.gov
#
# This shell program wraps a bit of text up in LaTeX commands so that
# the text can be printed in various sizes.  Wrap uses the
# verbatim mode of LaTeX, and changes sizes using the 10 size changes
# listed on p. 200 of the LaTeX manual.
# The form of the command is:
#     wrap myfile thesize
# where myfile is just text you want to print straight and thesize is the size.
# Thesize may be a number from 1 to 10.
# Numbers correspond to these sizes, which are listed in non decreasing order:
#      tiny, scriptsize, footnotesize, small,
#      normalsize,
#      large, Large, LARGE
#      huge, Huge
# You can use these names if you prefer.
# Note: Not all sizes can be done in \tt, so in those cases LaTeX will
# use the Roman font.
#
# NOTES:
# The intermediate file is called 'myfile.wrap.tex'.
# The output       file is called 'myfile.dvi'.
#
# BUGS:
# -When LaTeX cannot find the file, it stops.  control-d
#  will get you out, but then the statement that wrap makes
#  about your results is a lie.
# -In a filename with several parts, separated by periods, wrap only
#  recognizes the first part, so file 'a.b.c' will be output to 'a.dvi'
#  not 'a.b.c.dvi' as the program says.

# wreck previous file version:
echo > $1.wrap.tex

# start inserting LaTeX commands:
echo "\documentstyle[12pt]{article}" >> $1.wrap.tex
echo "\begin{document}" >> $1.wrap.tex
echo -n "\" >> $1.wrap.tex # begin the size command

switch ($2)
   case "tiny":
       echo $2 >> $1.wrap.tex
   breaksw
   case "scriptsize":
       echo $2 >> $1.wrap.tex
   breaksw
   case "footnotesize":
       echo $2 >> $1.wrap.tex
   breaksw
   case "small":
       echo $2 >> $1.wrap.tex
   breaksw
   case "normalsize":
       echo $2 >> $1.wrap.tex
   breaksw
   case "large":
       echo $2 >> $1.wrap.tex
   breaksw
   case "Large":
       echo $2 >> $1.wrap.tex
   breaksw
   case "LARGE":
       echo $2 >> $1.wrap.tex
   breaksw
   case "huge":
       echo $2 >> $1.wrap.tex
   breaksw
   case "Huge":
       echo $2 >> $1.wrap.tex
   breaksw
   case  "1":
       echo "tiny"         >> $1.wrap.tex
   breaksw
   case  "2":
       echo "scriptsize"   >> $1.wrap.tex
   breaksw
   case  "3":
       echo "footnotesize" >> $1.wrap.tex
   breaksw
   case  "4":
       echo "small"        >> $1.wrap.tex
   breaksw
   case  "5":
       echo "normalsize"   >> $1.wrap.tex
   breaksw
   case  "6":
       echo "large"        >> $1.wrap.tex
   breaksw
   case  "7":
       echo "Large"        >> $1.wrap.tex
   breaksw
   case  "8":
       echo "LARGE"        >> $1.wrap.tex
   breaksw
   case  "9":
       echo "huge"         >> $1.wrap.tex
   breaksw
   case "10":
       echo "Huge"         >> $1.wrap.tex
   breaksw
   default:
      echo "Usage: wrap myfile thesize"
      echo "where thesize is a number or the corresponding word:"
      echo " 1 tiny"
      echo " 2 scriptsize"
      echo " 3 footnotesize"
      echo " 4 small"
      echo " 5 normalsize"
      echo " 6 large"
      echo " 7 Large"
      echo " 8 LARGE"
      echo " 9 huge"
      echo "10 Huge"
      echo "I'm using scriptsize"
      echo "scriptsize"   >> $1.wrap.tex
   breaksw
endsw

# start the straight text
echo "\begin{verbatim}" >> $1.wrap.tex

# stuff in the text
cat $1 >> $1.wrap.tex

# stuff in the final LaTeX commands
# the verbatim command is broken so that wrap works on itself...
echo "\end""{verbatim}" >> $1.wrap.tex
echo "\end{document}" >> $1.wrap.tex

# run latex on the package
latex $1.wrap.tex
# clean up after latex
rm -f $1.aux
rm -f $1.log

# tell them about it:
echo " "
echo "Your document is now in '"$1.dvi"' ready for printing"

------------------------------

Subject: Lining up a column of numbers, and Re: Hypenation
Date: Wed, 29 Jun 88 16:12:12 -0700
From: David Hull <wiley!david@csvax.caltech.edu>

Ken McGlothlen wants to make a column of numbers like

                   | Column 1
         ----------|---------
            Row 1  |   32.0  
            Row 2  |  983.21 
            Row 3  |    1.1  

in a tabular environment.

Since all the numerals are the same width, you can do something like:

\def\*{\phantom{0}}

\begin{tabular}{...c...}
... & \*32.0\* & ... \\
... & 983.21 & ... \\
... & \*\*1.1\* & ... \\
\end{tabular}


John Lee wonders why TeX doesn't want to break the word
"micro-accelerometric" at any place but the hyphen.

Most style manuals say that, whenever possible, hyphenated compound
words should not be broken except at the hyphen.  However, you can put
in discretionary hyphens wherever you want, and TeX will then consider
that an allowable place to break the line:

    micro-accel\-erometic

-David Hull

------------------------------

Date: Wed, 29 Jun 88 23:16:21 PDT
From: mackay@june.cs.washington.edu (Pierre MacKay)
Subject: Hyphenation (TeXhax Digest V88 #59)

>   I've noticed a tendency that TeX not consider hyphenation of the second
>   word of a compound word, preferring instead to justify ridiculously.

It isn't a tendency, it is a rule.  At considerable risk, you could get 
around it by

1) \catcode`-=11 % make hyphens into letters.

2) \lccode`\-=`\- % supply them with an lccode

3) Edit the hyphen.tex source file to supply all necessary patterns
with hyphens, and take the risk of having lines end         micro--
accelerometric

A better way is to set up macros for the few (I hope) sesquipedalian 
compound words in any given text

\def\micacc{micro-accel\-er\-o\-met\-ric}

TeX will not attempt to put discretionary hyphenation nodes into any
word that already has a hard hyphen in it, but it will respect any 
discretionary nodes that you put there (this statement checked with 
\showhyphens).


Email:  mackay@june.cs.washington.edu		Pierre A. MacKay
Smail:  Northwest Computing Support Group	TUG Site Coordinator for
	Lewis Hall, Mail Stop DW10		Unix-flavored TeX
	University of Washington
	Seattle, WA 98195
	(206) 543-6259

------------------------------

From: hobby@research.att.com
Date: Thu, 30 Jun 88 07:40:02 EDT
Subject: the "fixup" style option

I wrote the so-called "fixup" style option that appeared in issue 57.
That was an old version that got distributed without attribution by
mistake.  The latest version is now be available from Rochester as
fixup.doc.

The main features are the following:
1) It makes LaTeX size changes effect plain's \big, \Big, \bigl, \bigr, etc.
2) It tries to eliminate extra vertical spaces that I think are extraneous
3) It makes operator spacing for eqnarray similar to plain's \eqalign

The name "fixup" is in some ways a little unfortunate since the desirability
of changes 1, 2, and 3 is a matter of opinion.  I offer it as an option
for those who want it.

The main motivation for (2) is that I was getting more vertical space in
my figures than the parameters in the style file seemed to imply I should
have.  The change effects spacing at the top of some figures and spacing
around the \write that \caption puts into the vertical list.

- John Hobby
hobby@research.att.com

------------------------------

Date: Thu, 30 Jun 88 11:51:44 EDT
From: bowen@cs.Buffalo.EDU (Devon E Bowen)
Subject: dvi2ps with NTX

I'm having a lot of trouble getting the dvi2ps program to work with the
new NTX and the new laserprep file. Problem is, the new laserprep PostScript
conflicts with the PostScript used by dvi2ps. For example, in one case the
dvi2ps code wants to use "vo" for vertical offset and the laserprep file
wants to use it as a function. I fixed this, but there's more... The other
problem is that this is the only laserprep file that will work with the
NTX printer.

Has anyone successfully included Mac files into TeX docs with dvi2ps on an
NTX printer? If so, please help! Thanks.


Devon Bowen			Packet:    KA2NRC@WA0PTV
University at Buffalo		BITNET:    bowen@sunybcs.BITNET
				Internet:  bowen@cs.Buffalo.EDU
UUCP: ...!{ames,boulder,decvax,rutgers}!sunybcs!bowen

------------------------------

Date: Thu, 30 Jun 88 16:36:03 BST
From: mike%prg.oxford.ac.uk@NSS.Cs.Ucl.AC.UK
Subject: Underscore in identifiers

I have a problem with the Plain TeX macro \_, which puts an underscore
in the middle of an identifier.  Here is the definition from
plain.tex:

\def\_{\leavevmode \kern.06em \vbox{\hrule width.3em}}

Now, I want to set lots of mathematical text with multi-letter
identifiers in it, some of them containing underscores (in fact, this
text is a formal specification in the notation `Z').  Instead of
putting each identifier in its own hbox to set it in horizontal mode,
I decided to change the mathcodes of letters to use text italic
instead of math italic (e.g. \mathcode`\A="7441: that's "7000
(variable family) + "400 (text italic) + "41 (ASCII `A')). Appendix G,
verses 14 and 17 (pp. 444-5 of the pew TeXbooks), nicely provides for
ligs and kerning and omits the italic corrections you always get with
math italic.

The trouble comes with \_, because the explicit kern (or, if we delete
that, the vbox) makes the last letter before it fail to be marked as a
text symbol, and TeX shoves in an italic correction at verse 17. This
looks really bad with identifiers like $diff\_list$ and $DISK\_POOL$
where the italic correction is huge.

First idea: try to get rid of it with \unkern.  No, there's no kern
there for \unkern to find: the kern is only added when the math list
is converted to a horizontal list later.

Second idea: force an italic correction with \/, then try to get rid
of it. No, \/ in math mode just inserts a kern of width zero to force
the italic correction in later.

Third idea: suggestions welcome.

Last resort: make all the letters active characters in math mode
(\mathcode "8000) and hold on to your hat.

-- Mike Spivey, Programming Research Group, Oxford

------------------------------

Date: Thu, 30 Jun 88 13:32:32 EDT
From: csrobe@icase.arpa (Charles S. Roberson)
Subject: bib stuff: r2bib & keys

Greetings-
	
I'm in the middle of putting together a bibliography and I often get sources
in the Un*x refer format.  I have a rather old (1985 or before ) version of
the r2bib filter and was wondering if there is a newer version around that
is a little more robust?  Also, is there filter that does the reverse
(bib2r)?

Does anyone have a suggestion on a method for building mneumonic keys for 
bibitems?  I would like to come up with a scheme that would allow me (and
others) to re-construct the keys for \cite commands w/o having to go
trudging through the BibTeX database, unless necessary.  My bigest problem
is dealing with multiple authors.  All comments will be appreciated.

Thanks,
-c
|Chip Roberson                ARPANET:  csrobe@icase.arpa                 |
|1105 London Company Way      BITNET:   $csrobe@wmmvs.bitnet              |
|Williamsburg, VA 23185       UUCP:     ...!uunet!pyrdc!gmu90x!wmcs!csrobe|
      "One world is enough, for all of us..."         - The Police.

------------------------------

From: munnari!elecvax.eecs.unsw.oz.au!8325499@uunet.UU.NET
Date: Thu, 30 Jun 88 23:44:03 EST
Subject: LateX question - vertical alignment.

 Hello World


     I am trying to set a data directory as part of a report but cannot get
  the following to work.
     What I want is something like
  
           definition :     -      -
                            | this |
                            | that |
                            | other|
                            -      -
                            something else
  
  
     What I get is 
  
  
                           -      -
                           | this |
          definition :     | that |
                           | other|
                           -      -
                           something else
  
  with the definition centered on the middle of the square brackets.
  how can I make it line up on the top of the bracket.
  
  thanks
       Gilbert
  
_________________________cut here _________________________________
\documentstyle[12pt]{report}
\begin{document}

\newcommand{\bdd}[2]{\begin{tabular}{p{45mm}cl}
                                   #1 & : & \parbox[t]{60mm}{#2} \\
                    }
\newcommand{\cdd}[1]{ & & #1  \\ }
\newcommand{\edd}{\end{tabular}\vspace{1.5ex}}
\newcommand{\aoverthree}[3]{\begin{tabular}{@{}c@{}} 
                                             #1 \\ 
                                             #2 \\
                                             #3
                          \end{tabular} }
\newcommand{\ddor}[1]{ \begin{math}
                       \left[ \textstyle \rm #1 
                                   \right] 
                       \end{math}
                       }

\bdd{definition}{\ddor {\aoverthree {this}
                                    {that}
                                    {other}
                       }}
                 \cdd {something else}
\edd

\end{document}

------------------------------

Date: Thu, 30 Jun 88 12:38:19 MDT
From: shebs%defun@cs.utah.edu (Stanley T. Shebs)
Subject: Double Spacing in Theses

Gordon Howell's call to action regarding spacing in theses reminded me of
a conversation last year with Utah's thesis editor.  She is somewhat of a
TeX enthusiast (at least partly due to someone's 400-page math thesis),
but was adamant about doublespacing.  The reason?  Easier on the eyes when
reading, as with any draft document.  As I looked around the office and its
tall stacks of theses, it was not hard to imagine eyestrain as a serious
occupational hazard for thesis editors...

							stan shebs
							shebs@cs.utah.edu

------------------------------

Date: Thu 30 Jun 88 13:02:41-PDT
From: Barbara Beeton <BEETON@Score.Stanford.EDU>
Subject: Re: Underscore in identifiers

actually, variable names usually shouldn't be in math mode at all.
if you look in webmac.tex, you can see what knuth used for ``tex:
the program", in which, i think you'll agree, the underscore looks
pretty good.
on score.stanford.edu, webmac.tex is in should be in <tex.inputs> and
it should probably be in a similar location on any system that's been
created from a standard distribution.
					-- barbara beeton

------------------------------

Date: Thu, 30 Jun 88 18:37 EST
From: "Jerry Leichter (LEICHTER-JERRY@CS.YALE.EDU)"
Subject: tgrind for LaTeX

In TeXhax V58 #88 - which I just copied from Score, neither it nore V57
arrived here for some reason - Ben Britt asks for a LaTeX version of tgrind.

I have such a beast.  When I get the time, I plan to clean it up, document
it, and make it generally available; but right now I don't have the time.
It's a modification of the original tgrind that I did for use in writing my
thesis, and that's what I'm currently spending all my time on.

You can get a copy via anonymous FTP.  (Sorry, I just don't have the time
right now to send it any other way - please don't ask.)  FTP to
VENUS.YCC.YALE.EDU, CD to [.TGRIND], and copy all the files.  Below is all
the documentation that currently exists on TGRIND - I guess I should really
name it something else to avoid confusion; I was planning to before sending
it out.

First, here's what you'll find in the directory:

Directory UTOOLS:[GUEST.TGRIND]

REGEXP.C;1               27/27       6-OCT-1987 18:16
! Source for regular expression parser
!
TGRIND.C;39              53/54      22-MAY-1988 15:45
TGRIND.DOC;82            19/21      27-JUN-1988 18:25
! NOT documentation - source for TGRIND.STY
!
TGRIND.EXE;21            34/36      22-MAY-1988 15:45
! Pre-built VMS image, for people lacking a C compiler.  Get the code anyway;
! it's the only way to understand what the program is doing.  As far as I
! know, all the code is portable, though you may have to change some file
! specs.
!
TGRIND.STY;51             9/9       27-JUN-1988 18:26
! Style file.  Place in TEX$INPUTS and include tgrind as a style option.
! Produced from TGRIND.DOC using docsty.
!
TGRIND.TEX;5             14/15      19-NOV-1987 15:26
! OBSOLETE version of macro file to produce stand-alone listings.  I haven't
! kept this up to date because I haven't needed it.  I have no idea if it
! works any more.
!
VGRINDEFS.C;1            12/12       6-OCT-1987 18:16
! Source for code to parse VGRINDEFS.SRC
!
VGRINDEFS.SRC;8          13/15      22-APR-1988 15:52
! Defines language syntax.  Put this in TEX$INPUTS.
!
Total of 8 files, 181/189 blocks.

To build TGRIND, compile all the .C modules, and link them all together.

Cursory documentation:  The original TGRIND produced stand-alone listing files
from C code.  The biggest change in this one is that you can include your code
in-line in a LaTeX source document.  The new "-e" option enables this mode.
Output goes to stdout, which can be re-directed Unix-style (>foo); the input
file or files are listed on the line.  For example:

	$ tgrind -e sample.lt >sample.tex

Warning:  The line is read from left to right - place the -e option BEFORE the
file you want it to apply to.  Switching modes in mid-stream will produce
strange results.  You cannot switch languages in mid-stream, or use more than
one language in any given file.

Within the text, you mark groups of lines as either text- or display-style
program code:

Text style:

	The expression
	%(
	a + 3
	%)
	produces 10.

prints something like:  "The expression a + 3 produces 10." (with a + 3 set
as a program.)

Display style:

	The statement
	%[
	a += 3;
	%]
	is an example of an incrementing operator.

prints something like:

	The statement

	   a += 3;

	is an example of an incrementing operator.

Important rules:

	% and the following character must be the first two characters on
		the line to be recognized.

	Put NOTHING on the line after the % and the key character.  If you
		do that, tgrind will provide a default environment that will
		produce an \hbox for %( )%, and a \vbox for %[ - %].  If you
		put stuff on the line, tgrind assumes you want to control the
		format completely.  Doing this requires understanding EXACTLY
		what the code tgrind produces is doing.  (Sometimes I'm not
		sure I do!)

	%) and %] are, if I remember right, simply ignored outside of a
		code group, but any extra %( or %[ produces a warning,
		so a missing %) or %] is usually caught.

You can insert your own code by using a line starting with "%=" in the program
text.  Whatever you enter after that is left in the output, exactly as you
typed it.  It will be executed in a strange environment, so doing anything
fancy is very tricky.  A macro, \Line, is provide to help you do simple
things.  For example,

%[
%=\Line{________\vdots}
	a = 1;
%]

produces:

	.
	.
	.
	a = 1;

(Within the program text, "_" is active and expands to a fixed-width space.
A whole bunch of macros are also defined.  If you understand how tgrind sets
lines up, you can replace the 8 _'s with a call to \Tab - but I'll let you
hang yourself on that one.)

The output of tgrind always contains exactly one output line for each input
line.  Hence, you can look up line numbers in TeX error messages in your
original file, rather than in the tgrind'ed (tground?) file.  (Of course, if
the problem is in the tgrind output....)

The environment that tgrind's output builds uses a LOT of stack space.  I
found I had to build a TeX with a larger stack, but that's not always
necessary - it depends on exactly how you nest stuff.

Many things are controllable by re-defining various macros.  You can change
what fonts tgrind will use for various kinds of things, how much it indents
the output, whether it adds line numbers, and if so at what interval it
prints them and whether it sticks them on the left or right, and so on.
This stuff is all described in TGRIND.DOC, though probably not very well.
The default settings produce output that looks reasonable to me, though I
can't say I'm ecstatic about it.  Doing a REALLY good job would require
defining some special fonts.

				Yours for better program typesetting,

							-- Jerry
------------------------------

%%%
%%% Concerning subscriptions, address changes, unsubscribing:
%%%     BITNET: send a one-line mail message to LISTSERV@TAMVM1.BITNET:
%%%         SUBSCRIBE TEX-L <your name>    % to subscribe
%%%
%%%     All others: send mail to
%%%           texhax-request@score.stanford.edu
%%%     please send a valid arpanet address!!
%%%
%%%
%%% All submissions to: texhax@score.stanford.edu
%%%
%%% Back issues available for FTPing as:
%%%          machine:      directory:  filename:
%%%   [SCORE.STANFORD.EDU]<TEX.TEXHAX>TEXHAXnn.yy
%%%      nn = issue number
%%%      yy = last two digits of current year
%%%\bye
%%%

------------------------------

End of TeXhax Digest
**************************
-------