[comp.text] TeXhax Digest V88 #80

TeXhax@Score.Stanford.EDU (TeXhax Digest) (09/20/88)

TeXhax Digest   Tuesday, September 20, 1988   Volume 88 : Issue 80

Moderator: Malcolm Brown

Today's Topics:

                Re: TEX Implementation Language Zero
                            Boxes in LaTeX
                         TeX and VAX/VMS 5.0
                  Wanted:  DVI-to-PS drivers for VMS
      Dutch hyphenation, Xerox 8700 support, DIGITAL's DOCUMENT
                          Re: Nubs on tables
                    Request for PD TeX on the Mac
                         METAFONT vindicated
                 Problem installing TeX on a 3B2/400
                  We are having trouble using PiCTeX
                        TeXhax '86 back issues
                yaffb (yet another format for bibtex)
                 LaTeX eqnarray environment troubles
               PostScript emulation for common printers
      Re: MERGE.STY & multiline addresses, TeXhax Digest V88 #77
                            CDVI previewer
                   uneven spacing in \tt\obeyspaces
                             Semitic.sty

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

Date:         Mon, 29 Aug 88 23:28:22 EDT
From: EGNILGES%PUCC.BITNET@Forsythe.Stanford.EDU
Subject:      Re: TEX Implementation Language Zero 

In article <4998@claris.UUCP>, drc@claris.UUCP (Dennis Cohen) writes:
>
>Wasn't TeX originally written is SAIL?  I seem to remember some reference to
>it in the Pascal sources that I saw many years ago at JPL (gads, that seems
>like a lifetime ago -- working on Univac 1100s, IBM 3032s, ModComps and VAXen).
>
>Dennis Cohen

Dennis, Knuth writes (Ref. 1) that "a complete version of TEX was designed
and coded by the author in late 1977 and early 1978; that program, like its
prototype, was written in the SAIL language, for which an excellent
debugging system was available".  When I was with Bell-Northern Research
in the early 80s, the DEC-20 systems programmers thought very highly of
SAIL.  The following book is highly recommended for anyone who wants
to learn how to write insanely great code and comments.

Ref: Donald E. Knuth, T X, the Program.  Reading, MA, 1986: Addison-
                       E
Wesley Publishing Company. p. 2.

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

Date: Tuesday, 30 Aug 1988 11:01:02 NZT
From: CCC032U@aucc1
Subject: Boxes in LaTeX

I am having trouble aligning boxes in LaTeX. What I have is three boxes across
the page :
  +------+  +------------------------------------------------+ +-------------+
  |      |  |                                                | |             |
  |      |  |                                                | |             |
  |      |  +------------------------------------------------+ |             |
  |      |                                                     |             |
  +------+                                                     +-------------+
 
each is either a minipage or a parbox and I want the tops of the {\em boxes}
aligned. As far as I can figure out from the LaTeX manual LaTeX aligns the
text in the boxes not the boxes them selves. The situation is further
complicated by the fact that the left hand box contains a special to include
some graphics.
 
Anyway here's the code am using now
 
\def\maketitle {
\hspace*{-.3in}
\parbox{.75in}{
\hspace{.05in}
\special{include crest-48.epsf}
  \vspace{.6in}
     \begin{center} \small\it
     Computer \\
     Centre
     \end{center}
}
\parbox{4.1in}{\Large\bf\center \@title}
\begin{minipage}{1.5in}
   \begin{center}
%    \vspace*{-.13in}
     \begin {tabular}{|c|} \hline
      \@type \# \@number \\ \hline
      \@tag \\ \hline
     \end{tabular}
     \today
   \end{center}
\end{minipage}
}
 
It is part of a style option that I am developing for or documentation
The problem is that the vertical alignment is erratic. I have tried using
[t] and [b]s in various combinations but nothing seems to work satistfactorly.
Any help will be gratefully received.
 
Russell Fulton
 
Internet: ccc032u@aucc1.aukuni.ac.nz
 
Postal:   Computer Centre
          University of Auckland
          Private Bag
          Auckland, New Zealand
'Phone:   +64 9 737-999 x 8955  ( GMT +12 )




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

Date: Tue 30 Aug 88 07:35:30-PDT
From: PLOWMAN1%LOCK.SPAN@STAR.STANFORD.EDU
Subject: TeX and VAX/VMS 5.0

Has anyone tried executing TeX or LaTex under
VAX/VMS 5.0.  We are planning to upgrade our
system in October.  Any information on modification
or problems associated with the upgrade and
the TeX environment would be appreciated.

Thanks for the help!

			Paul Plowman
			Lockheed Engineering & Sciences Company
			2400 Nasa Road One,   M/C B14
			Houston, Texas 77058

			Phone:  (713) 333-6487

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

Date: Tue, 30 Aug 88 10:28 EDT
From: John W Manly <JWMANLY%amherst.BITNET@Forsythe.Stanford.EDU>
Subject: Wanted:  DVI-to-PS drivers for VMS

Hello everyone:

Here at Amherst College
we have just aquired some new Postscript laser printers (an Apple Laserwriter,
a DEC PrintServer-40 [LPS40], and a DEC ScriptPrinter [LN03R]), and are
interested in producing TeX output on them.  We are running VMS, soon to
be at Version 5.0-1.

So, what are other people using in the way of DVI-to-Postscript conversion
programs?  We have heard of Nelson Beebe's DVI driver family, and are
wondering how people like it, and what other programs they are using.

Of particular concern are the following points:  how much does the package
cost; does it's command line look like DCL or UNIX; can it display progress
message (like what page it is working on); can it use the built-in Postscript
fonts (like Times, Helvetica, and Avant-Guard); does it allow the inclusion
of external Postscript files via \special commands?

Ideally, of course, we would like something in the Public Domain for which
we can get source code as well.  Please send all responses directly to
me, and I will summarize to TEXHAX, since this strikes me as information that
a lot of people would like to have.  Thanks for any help.

PHONE:   (413)-542-2526            - John W. Manly
BITNET:  JWMANLY@AMHERST             System Manager
                                     Amherst College

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

From: klerk%ijsapl.DEC@decwrl.dec.com (Theo de Klerk DTN 838-2737 @UTO)
Date: 31 Aug 88 00:38
Subject: Dutch hyphenation, Xerox 8700 support, DIGITAL's DOCUMENT

DUTCH HYPHENATION PATTERNS 
 
    To implement a proper version of LaTeX on our machines, I'd like
    to know if there is any dutch hyphenation pattern for TeX available
    anywhere in netland.
 

XEROX 8700 SUPPORT REQUESTED

    Since our printer companies use Xerox 8700 machines, I'd also be interested
    to know if there is any font and/or device converter available for
    Xerox 8700 printer output on VAX/VMS systems.


VAX DOCUMENT

    In a previous issue of TeXHaX I saw a question on a modified TeX system
    in use at Digital Equipment. The system refered to is called VAX
    DOCUMENT and is used to produce all VAX/VMS system and layered product
    documentation. It has been extensively modified from standard TeX (it
    doesn't pass the test suite anymore) and provided with an additional
    top-layer (the TAG layer) that also supports the VMS  Language Sensitive
    Editor and its interactive debugging interface to make corrections to
    misspelled commands quick and easy. VAX DOCUMENT is available to
    customers too, but is not free of charge nor public domain. Currently
    it only runs on VAX/VMS systems VMS V4.6 and upwards.
    
    Theo de Klerk

    (klerk%ijsapl.DEC@decwrl.dec.com)

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

Date: Wed, 31 Aug 1988 0:39:07 EST
From: "Charles R. LaBrec" <crl@maxwell.physics.purdue.edu>
Subject: Re: Nubs on tables 

To understand the nubs on tables, you have to understand the rules
that dvitype uses, since it is the prototypical DVI driver.  Consider
the table that was used as an example:
> \vbox{    \tabskip=0pt \offinterlineskip
>             \def\tablerule{\noalign{\hrule}}
>             \halign to 199pt{\strut#& \vrule#\tabskip=1em plus2em&
>                  \hfil#\hfil& \vrule#& \hfil#\hfil& \vrule#&
>                  \hfil#& \vrule#\tabskip=0pt\cr\tablerule
>                  && 1&&32&&&\cr\tablerule
>                  &&11&& 4&&&\cr\tablerule
>              }
>   }
> 

Rick Zaccone notes that if 199pt is replaced by 200pt, the nubs go
away.  The reason for this is as follows.  Consider the table edges in
terms of coordinates:

 (0)                                                                 (w)
  v                                                                   v
  *********************************//**********************************
  *********************************//**********************************
  **                                                                 **
  **                                                                 **
  **                                                                 **
  **                                                                 **
    ^                                                                ^
   (t)                                                           x=(w-t)

In other words, the rules have width t, the table is of width w.
Fine.  That means that for w=199pt and t=.4pt (the default for rules),
then x=198.6pt.  For w=200pt, x=199.6pt.  Now lets consider
coordinates in units of pixels, which is what these printers use.  At
300 pixels/in (for the LaserWriter and most lasers these days), the
conversion factor is 300/72.27=4.1511.  So:

		199pt		200pt

	w	826.06		830.22
	t	  1.66		  1.66
	x	824.41		828.56

But pixel coords must be integers, and here lies the problem:
positions are rounded (usually, not accounting for drift), while rules
are rounded UP.  So:

		199pt		200pt

	w	827		831
	t	  2		  2
	x	824		829

See the problem? 
	x+t != w	for w=199pt
	x+t == w	for w=200pt

Therefore, for w=199pt, the hrules are 1 pixel wider than the right
edge of the right vrule, and there's the nub

Charles LaBrec
crl @ maxwell.physics.purdue.edu

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

Date:    Wed, 31 Aug 88 00:21:18 PDT
From:     zar@XHMEIA.Caltech.Edu (Perfect Tommy)
Subject: Request for PD TeX on the Mac

I'd like to know where I can find pub domain Macintosh (SE) Pascal source
for TeX & Metafont. Font files and sources aren't needed. Please reply
to me. Many thanks...

Dan Zirin (The Great Zar)
Security Pacific Bank | Global Systems Support
ZAR @ CITCHEM or ZAR @ XHMEIA.Caltech.edu or XHMEIA::ZAR

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

Date: Wed, 31 Aug 88 10:19 GMT
From: Ian Murphy <MURPHY_I%procyon.ie@Forsythe.Stanford.EDU>
Subject: METAFONT vindicated

It appears thats I wronged Metafont injustly in my last submission by saying it
couldn't do what i wanted, there IS in fact a way of doing exactly what i
wanted.

For those of you who didn't see my request for help a while back, what
I wanted was to get metafont to read in a copy of local.mf from my directory
AND to create a font of the correct name at the same time, the only way i
managed to discover was to say
 ** \input local; \mode=mymode; mag=2; input cmr10
but this always resulted in a font called local.xxxGF.

On pg 269 DEK quite clearly tells me how to do this, using the
\smode="filename" command which loads in the specified file.

If, for instance, i was creating a font for a device called 'cheapo' I could
create a file called cheapo.mf containing something along the lines of...

mode_def cheapo =
   lowres_;
   fillin :=-.1;
enddef;

and then create a font by saying
** \smode="cheapo"; mag=3; input cmr10

and I will get a font called cmr10.xxxGF at the correct resolution for my
cheapo printer.


Ian

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

Date:          Wed, 31 Aug 88 13:37 EDT
From: <OPRMEH%ULKYVX.BITNET@Forsythe.Stanford.EDU> (Michael Harpe)
Subject:       Problem installing TeX on a 3B2/400

I am attempting to install TeX 2.93 and friends from the latest Washington
tape onto a 3B2/400 with the floating point C compiler (fpcc).  All goes
well until time to compile the last module of C code (tex8.c).  The compile
fails with a compiler error indicating that the switch table has overflowed.
This also happens when I try to compile DVItype for the trip test.

I have looked everywhere for some kind of switch I can set to avoid this.
I looked in web2c, tex.web (forget it, I don't pretend to understand it)
and other places.  I did find a reference in tex.web to something that causes
defualt cases to be created by web interpreters.  That is what seems to
be needed to fix my problem.

If you have experienced this, please respond directly to me.  I appreciate
any help anyone can supply

Michael Harpe
Computer Operations Advisor
Dahlem CADL


"Have a Bud, get sudsed, vote for Spuds!" - Bloom County

Michael Harpe                   BITNET: MEHARP01@ULKYVX
203 Henry Vogt Building           PSTN: 502-588-7620
University of Louisville          AMPR: N4PLE @ ARTS
Louisville, KY  40292

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

From: Daniel Zwillinger <zwilling%linus@mitre-bedford.ARPA>
Date: Wed, 31 Aug 88 15:48:28 EDT
Subject: We are having trouble using PiCTeX 

We are having trouble using PiCTeX since we keep running
out of memory space in TeX.
We have made a ``whopperTeX'' (with more memory), 
but that also runs out of space occasionally.

Even if we can't fix the problem of running out of memory with PiCTeX, 
I would like to understand WHY it is running out of space.

Is there a simple answer ?


Dr. Daniel Zwillinger        CSNET: linus!zwilling@mitre-bedford.arpa
The MITRE Corporation        617/271-3404 
Bedford, MA 01730            

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

Date: Wed, 31 Aug 88 13:00:38 PDT
From: dinh@sm.unisys.com (Dinh Le)
Subject: TeXhax '86 back issues

Please tell me where can I find all '86 TeXhax back issues.  I could only
find '87 and '88 issues in score.stanford.edu.  Thanks in advance,

				'Dinh Le
				dinh@sm.unisys.com
				2400 Colorado Ave.
				Santa Monica, CA 90406
				(213) 829-7511 x5367

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

Date: Wed, 31 Aug 88 18:17:11 EDT
From: toms@ncifcrf.gov
Subject: yaffb (yet another format for bibtex)

I need to generate a bibliograpy with this form from Nucleic Acids Research:

"References should be numbered in order of appearance in the text and
must not be listed in alphabetic order.  The citation of journals
(abbreviated in the style of Chemical Abstracts), books and
multi-author books should conform with the following examples.
Single line-spacing should be used throughout, including between
individual references.
1. Razzell, W. E. and Khorana, H.G. (1958)
   Biochim. Biophys. Acta 28. 562-566.
2. Davidson, J.N. (1969) The Biochemistry of the
   Nucleic Acids, 6th edn, pp. 177-178.
   Methuen, London.
3. Burdon, R. H. (1971) In Davidson, I. N. and
   Cohn, W. E. (eds), Progress in Nucleic Acids
   Research and Molecular Biology, Academic
   Press, New York, Vol. II, pp. 33-79."

I don't see it in Rochester.  (But then, I didn't ftp everything from
there!) Things like natsci.bst seem to be on the right track, but I don't
know the heavy tex code.  It seems that (for someone who is an expert)
this should take all of 10 minutes - can any of you folks help?

  Tom Schneider
  National Cancer Institute
  Laboratory of Mathematical Biology
  Frederick, Maryland
  toms@ncifcrf.gov

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

Date: Thu, 01 Sep 88 15:58:41 MET
From: GDFGEJO%HDETUD1.BITNET@CUNYVM.CUNY.EDU
Subject: LaTeX eqnarray environment troubles

 Hi,

 Does anybody happen to know how to modify the LaTeX eqnarray environment
 in such a way that the aligment character (caught inbetween & &) is not
 surrounded by two anomalous blanks in the output DVI file. In order to
 clarify what I mean; What LaTeX produces from:

 \begin{eqnarray*}
   u &=& \cos(\omega t) \\
   v &=& \sin(\omega t)
 \end{eqnarray*}

 becomes in the DVI file

  u = cos(wt)
  v = sin(wt)

 whereas I would like to have (sometimes it just looks better)

  u=cos(wt)
  v=sin(wt)

 Thanks,

 Ejo Schrama
 Department of Geodesy
 Thysseweg 11 2629 JA Delft
 TU Delft Netherlands.

 E-mail gdfgejo@hdetud1 (bitnet)

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

Date: Fri, 2 Sep 88 17:03 GMT
From: Peter Flynn UCC <CBTS8001%IRUCCVAX.UCC.IE@Forsythe.Stanford.EDU>
Subject: PostScript emulation for common printers

On the contrary, the GoScript software from LaserGo does exactly this:
converts from a PostScript file to codes for many common printers.
I have it and it works, but *wow* is there a time penalty. Example:
a single page of SCORE music typesetting converted from PS to HPLJ in
just over 40 mins CPU on a 10MHz Sperry MicroIT (AT-equiv). Clearly this
is not a fast solution, but it produced excellent results, so for those
who don't do PS, but who wish to be able to reproduce the odd file or two,
it would do OK. Cost is $195 from LaserGo, 9235 Trade Place, Suite A,
San Diego, CA 92126 (619-530-2400, fax 619-530-0099, data 619-530-0013
[rbbs, 300/1200 bps]). I have no association with this company apart from
being a satisfied customer...
...Peter Flynn
   University of Cork, Ireland

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

Date: Wed, 31 Aug 88 17:34:39 est
From: munnari!jim.oz.au!brw@uunet.UU.NET (Brian Wallis)
Subject: Re: MERGE.STY & multiline addresses, TeXhax Digest V88 #77

TeXhax@Score.Stanford.EDU@munnari.oz (TeXhax Digest):
> 
> I have a problem with letter.sty (well, with a modified version, but
> the same problem appears with letter.sty, I have tested that).
> 
> I want to use MERGE.STY by Graeme McKinstry as published in
> TUGBoat 8/1 to do form letters.
> 
> In principle this works, but with one exception.
> I am using multiline-addresses and I want to use the recipients
> name, i.e. the first line of the address, in the header of page 2
> an later.
> 
> LETTER.STY by Leslie Lamport provides a mechanism for that.
> The \sendingaddress is split in two parts, namely \toname
> and \toaddress.
> As long as I use
> \begin{letter}{firstaddressline\\
> secondaddressline}
> in the letter directly everything is ok.
> 
> MERGE.STY works by using
> \begin{letter}{\sendaddress}
> in a macro where \sendadress is defined via
> \global\read\addrfile to\sendaddress
> in another macro.
> 
> Somehow by all this calls the \processto macro which does the
> separation into \toname and \toaddress seems not to be able
> to handle the \\ which is read into \sendaddress correctly,
> \toname also contains secondaddressline if the lines read in
> from the addressfile contained a two line address.
> 
> I there an easy cure for my problem?

YES!

I am a TeX hater from way back. I just don't like the way the parsing
and macros work. So I couldn't resist this one.

The problem comes from the way the \processto macro seperates the two
parts of the address. When it is called from MERGE.STY via
\begin{letter} it hasn't a hope since all it sees is a token for the
\sendaddress macro where it is looking for the token \\ to seperate
the two parts. The \\ may be in \sendaddress but \processto doesn't
see that. Anyway, all I did was steal \processto from letter.sty and
include it in the mergefile reading routine in MERGE.STY to define two
more macros (\@toname and \@toaddress) and then use them in the
\begin{letter} argument with a \\ between them. (the names have been
changed to protect the guilty)

There should be a better way to do this by getting \sendaddress
expanded in the argument to \begin{letter} but I'm not bent enough
(ie: I don't understand TeX well enough) to bother working out how
when this way works fine!

I've only tested this with the given example letter and address file.

Here is a diff of the changes
================================================================
*** origmerge.sty	Wed Aug 31 16:46:14 1988
--- merge.sty	Wed Aug 31 16:49:23 1988
***************
*** 26,31
  
  \def\merge#1{\def\mergef@le{#1 }\@openfile\readfile \contents}
  
  \def\readfile{\global\read\addrfile to\sendaddress % get the address
                \ifeof\addrfile
                \else

--- 26,44 -----
  
  \def\merge#1{\def\mergef@le{#1 }\@openfile\readfile \contents}
  
+ %
+ % The next four lines are unashamedly stolen from letter.sty and are
+ % used to split the address line read from the merge address file into
+ % two parts, the name (before the first \\) and the address (the rest)
+ % \@@processto is used after reading to \sendaddress to split it into
+ % \@toname and \@toaddress which are then used when \begin{letter} is
+ % invoked (see below) 
+ %
+ \long\def\@@processto#1{\@@xproc #1\\@@@\ifx\@toaddress\@empty 
+  \else \@@yproc #1@@@\fi}
+ \long\def\@@xproc #1\\#2@@@{\def\@toname{#1}\def\@toaddress{#2}}
+ \long\def\@@yproc #1\\#2@@@{\def\@toaddress{#2}}
+ 
  \def\readfile{\global\read\addrfile to\sendaddress % get the address
  	      \expandafter\@@processto\sendaddress
                \ifeof\addrfile
***************
*** 27,32
  \def\merge#1{\def\mergef@le{#1 }\@openfile\readfile \contents}
  
  \def\readfile{\global\read\addrfile to\sendaddress % get the address
                \ifeof\addrfile
                \else
                     \global\read\addrfile to \openingtext % get the

--- 40,46 -----
  \long\def\@@yproc #1\\#2@@@{\def\@toaddress{#2}}
  
  \def\readfile{\global\read\addrfile to\sendaddress % get the address
+ 	      \expandafter\@@processto\sendaddress
                \ifeof\addrfile
                \else
                     \global\read\addrfile to \openingtext % get the
***************
*** 40,46
  \newbox\l@tterbox
  \def\endmerge{\iffirsttime\endcontents\global\firsttimefalse\fi %
                                        % end contents if it is the first time
!               \begin{letter}{\sendaddress}
                \opening{\openingtext\vskip2\parskip}
                \setbox\l@tterbox=\copy\store % copy the contents
                                              % of the letter

--- 54,60 -----
  \newbox\l@tterbox
  \def\endmerge{\iffirsttime\endcontents\global\firsttimefalse\fi %
                                        % end contents if it is the first time
! 	      \begin{letter}{\@toname\\\@toaddress}
                \opening{\openingtext\vskip2\parskip}
                \setbox\l@tterbox=\copy\store % copy the contents
                                              % of the letter
================================================================

Brian Wallis (brw@jim.odr.oz)		    O'Dowd Research P/L.
	(03) 562-0100 Fax: (03) 562-0616,
	Telex: Jacobs Radio (Bayswater) 152093

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

Date: Sun, 4 Sep 88 23:06 GMT
From: Peter Flynn UCC <CBTS8001%IRUCCVAX.UCC.IE@Forsythe.Stanford.EDU>
Subject: CDVI previewer

Following requests at the Exeter conference, Wayne Sullivan's CDVI
previewer is now available from the Rochester, Aston and Heidelberg
repositories. I am still waiting for someone at Texas A&M to tell me
whom I should send this stuff to there. The file is a .ARC (uuencoded
into a .UUE on BITNET) and contains the .DOC and 4 .COMs (CGA, EGA,
Olivetti & Hercules). Thanks to Wayne for making this available.
...Peter Flynn

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

Date: Sun, 4 Sep 88 23:24 GMT
From: Peter Flynn UCC <CBTS8001%IRUCCVAX.UCC.IE@Forsythe.Stanford.EDU>
Subject: uneven spacing in \tt\obeyspaces

a recent mention of this problem in tabular work leads me to ask what
is probably a simple one... if you say \tt\obeyspaces (and you have
done a \let\ =\space as per texbook verbatim), it works fine except for
lines with leading spaces. sure you get the spaces, but they are not
aligned, ie a piece of source code (no tabs) which has different numbers
of leading spaces on different lines (eg different indentation levels)
makes the printable characters go out of alignment with other lines,
as if there are half-spaces being introduced somewhere, or if the space has
become flexible (maybe it has: have i missed something?). even lines with
the same number of leading spaces do not always align right. definitely
not a printer problem, it happens with several printers (epson fx, lq,
tosh 13xx, hplj, ln03). im using pctex v2.
...peter flynn

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

Date: Mon, 5 Sep 88 11:57 +1200
From: GRAEME%otago.ac.nz@RELAY.CS.NET
Subject: Semitic.sty

% This is a very simple LaTeX substyle to set Semitic languages. It is a very 
% much a hacked HEBREW.TeX distributed with the Hebrew fonts.
%    Graeme McKinstry,
%    Computing Services Centre,
%    University of Otago,
%    Dunedin,
%    New Zealand.
%    E-mail:  graeme%otago.ac.nz@relay.cs.net
%
% WHAT IT DOES:
%   * Reverses order of letters in words.
%   * Reverses order of words on a line (sets right-to-left).
%
% Use it as follows:
% \documentstyle[semitic,...]{...}
%           .
%           .
%           .
% Normal text here
% \begin{semitic}     
% Hebrew text in `natural direction'.  Type Hebrew paragraph as
% you would any `normal' paragraph in a LaTeX document.
% \end{semitic}  
% More text ...
%           .
%           .
%           .
%
% NOTES:
%   * There is now no need to put only 1 hebrew word on a line. Treat the
%     Hebrew text as `normal' text.                    
%   * There can be no space between `\end' and `{semitic}' in
%     `\end{semitic}' (similar to the verbatim environment).
%   * To keep something together enclose it in braces, e.g., {text together}
%     This will stop it being broken over a line but the contents
%     will still be reversed.
%   * To keep something together and to STOP IT BEING REVERSED enclose it
%     in 2 sets of braces, e.g.,
%        {{$\sin(\theta + \frac{\pi}{2}) = \cos \theta$}}
%   * The text is processed in LR mode and then formed into lines. Anything
%     that starts a new paragraph, e.g., displayed maths, will cause problems.
%     This also mean that no blank lines can appear in the environment.
%   * A new paragraph is started before and after the semitic environment.

\font\ivrit=redis10
\hyphenchar\ivrit=-1

% The two lines below are taken from D.Knuth and P.MacKay
%     TuGBoat vol.8,#1,page 14.
% Use \heb{hebrew text} for short hebrew passages.
\def\heb#1{{\ivrit \reflect#1\empty\tcelfer }}
\def\reflect#1#2\tcelfer{\ifx#1\empty\else\reflect#2\tcelfer#1\fi}

\def\ivrconcat#1#2{#1 #2}

\newbox\ivrbox        % The Semitic box to test full line condition
\newbox\ivrstrbox     % The box to hold the current Semitic string
\setbox\ivrbox=\hbox{}
\setbox\ivrstrbox=\hbox{}

\def\@esemitic{\end{semitic}}  % Used for checking end of environment

\def\semitic{\par\ivrit\parindent=0pt\@makesemiticline}
\def\endsemitic{\par}

% \@makesemitic line reads in a word at a time (a word is taken as text
% terminated by 1 or more spaces).                              
% It will then take this word and reverse it (using \reflect) and add it
% to the FRONT of the line being made. If this word makes the line too
% long (> \linewidth) then the line is broken before this word and this
% word is added to the next line.

\def\@makesemiticline#1 {\def\@word{#1}\relax
     \ifx\@word\empty               % removes CR
        \let\next=\@makesemiticline
     \else
        \ifx\@esemitic\@word         % i.e., read in \end{semitic}
           \let\next=\@esemitic      % will finish off semitic environment
           \hbox to\hsize{\hfil \unhbox\ivrstrbox \unskip}
        \else                       % semitic word
          \ifdim\wd\ivrstrbox=0pt   % i.e., contains nothing therefore
                                    % at beginning of line
            \setbox\ivrbox=\hbox{\reflect#1\empty\tcelfer}
          \else                     % add reversed word to FRONT of line.
            \setbox\ivrbox=\hbox{\ivrconcat{\reflect#1\empty\tcelfer
                  }{ \unhcopy\ivrstrbox}}
          \fi
          \let\next=\@makesemiticline     % will loop around yet again
          \ifdim \linewidth < \wd\ivrbox % line now too long
             \hbox to\linewidth{\hss     % remove \hss to justify
                    \unhcopy\ivrstrbox}
             \setbox\ivrstrbox=\hbox{\reflect#1\empty\tcelfer}
          \else                          % set store string to whole line
             \setbox\ivrstrbox=\hbox{\unhcopy\ivrbox}\relax
          \fi                                              
        \fi
      \fi\next}

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

%%%
%%% 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
**************************
-------