[comp.text] TeXhax Digest V89 #43

TeXhax@cs.washington.edu (TeXhax Digest) (05/22/89)

TeXhax Digest    Thursday, May 4, 1989  Volume 89 : Issue 43

Moderators: Tiina Modisett and Pierre MacKay

%%% The TeXhax digest is brought to you as a service of the TeX Users Group %%%
%%%       in cooperation with the UnixTeX distribution service at the       %%%
%%%                      University of Washington                           %%%

Today's Topics:         

                    Has anyone ported MakeIndex to a Mac?
                       \crcr vs \cr and nesting \if's
                     Calling editors from TeX on VAX/VMS
                           Halmos boxes for proofs
                     AMS fonts are not seen in the preview
                 Is there an Arabic font available in MF form?
                          Indenting lines with LaTeX
                          Simple Double Column Macros
                              DVI file standards
                Need undump for SunOS 4.0 (Sun 3 and/or Sun 4)

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

Date: Fri, 28 Apr 89 05:41:47 PDT
From: MINER%UTA.MFENET@CCC.MFECC.LLNL.GOV
Subject: Has anyone ported MakeIndex to a Mac?
Keywords: MakeIndex, Macintosh

Has anyone ported MakeIndex to a Mac?

Thanks,

Buff Miner

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

Date: Fri, 28 Apr 89 05:44:08 PDT
From: KARNEY%PPC.MFENET@CCC.MFECC.LLNL.GOV
Subject: \crcr vs \cr and nesting \if's
Keywords: \crcr, \cr, nested ifs

In response to two of your queries in TeXhax V89 #27.

To understand what \crcr does read the TeXbook p249.  (Basically it acts
like a \cr if the user forgets to put in the last \cr in an \halign.)

The problem you describe with nested \if's is discussed on p211 of the
TeXbook.  The solution is to use the \newif command to define \ifabc
\abctrue and \abcfalse.

    Charles Karney
    Plasma Physics Laboratory   Phone:    +1 609 243 2607
    Princeton University        MFEnet:   Karney@PPC.MFEnet
    PO Box 451                  Internet: Karney%PPC.MFEnet@NMFECC.LLNL.GOV
    Princeton, NJ 08543-0451    Bitnet:   Karney%PPC.MFEnet@LBL.Bitnet

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

Date: Fri, 28 Apr 89 05:36:25 PDT
From: KARNEY%PPC.MFENET@CCC.MFECC.LLNL.GOV
Subject: Calling editors from TeX on VAX/VMS
Keywords: TeX, VAX/VMS

I answered this question for someone else in TeXhax already a while back.
Since the question has reappeared in TeXhax, my reply may be of interest to
other TeXhax readers.  See also the article by Adrien Clark in TugBoat V10
#1 (April 1989).  The command file for EDT I give is rather inelegant.
Maybe there are better ones.  I use Emacs, so I never bothered to
investigate this further.

    Charles Karney
    Plasma Physics Laboratory   Phone:    +1 609 243 2607
    Princeton University        MFEnet:   Karney@PPC.MFEnet
    PO Box 451                  Internet: Karney%PPC.MFEnet@NMFECC.LLNL.GOV
    Princeton, NJ 08543-0451    Bitnet:   Karney%PPC.MFEnet@LBL.Bitnet


I modifed TeX to call the editor of your choice on the 'e' response.  The
mods were straightforward.  You get TeX to execute
 $ @tex$edit <file> <line> <image> 
using lib$do_command.  You define tex$edit to point to a suitable command
procedure to open the file and position you on the correct line.  I've
appending the version for EDT (edt.com).  The <image> argument gives the
name of the image running TeX.  This allows the editor to restart the
correct program (TeX or LaTeX) when it exits.  I have Emacs do this.  I
don't know whether the same thing is possible with EDT.  Incidentally, an
orthogonal solution has been implemented by Adrian Clark (with some UK
address which I can find for you if you want) which uses the callable
interface to EDT or TPU.  This only works with DEC editors, and since I use
Emacs I can't benefit from it.

The additions to tex.ch are: (sorry I can't send you the whole tex.ch since
I using a modifed version from Kellerman and Smith)
%------------------------------------------------------------
@x Editing hooks
var c:ASCII_code; {what the user types}
@!s1,@!s2,@!s3,@!s4:integer;
  {used to save global variables when deleting tokens}
@y
var c:ASCII_code; {what the user types}
@!s1,@!s2,@!s3,@!s4:integer;
  {used to save global variables when deleting tokens}
@!fp:fab_pointer; @!np:nam_pointer;
@!k:0..file_name_size;
@z

@x
@ It is desirable to provide an `\.E' option here that gives the user
an easy way to return from \TeX\ to the system editor, with the offending
line ready to be edited. But such an extension requires some system
wizardry, so the present implementation simply types out what file should be
edited and the relevant line number.
@^system dependencies@>
@y
@ It is desirable to provide an `\.E' option here that gives the user
an easy way to return from \TeX\ to the system editor, with the offending
line ready to be edited. Here we set a flag |call_editor| and determine
the true file name.
@^system dependencies@>
@z

@x
@.You want to edit file x@>
  print(input_stack[base_ptr].name_field);
@y
@.You want to edit file x@>
  call_editor:=true;
  fp:=@=pas$fab@>(input_file[input_stack[base_ptr].index_field]);
        np:=fp^.@=fab$l_nam@>@=::@>nam_pointer;
        edit_file:=np^.@=nam$l_rsa@>@=::@>str_pointer;
        edit_len:=np^.@=nam$b_rsl@>;
        for k:=1 to edit_len do print_char(xord[edit_file^[k]]);
@z

@x
final_end: ready_already:=0;
@y
final_end:
if call_editor then @<Run the editor@>;
@<Convert |history| to program exit status@>;
@z

@x
This section should be replaced, if necessary, by changes to the program
that are necessary to make \TeX\ work at a particular installation.
%....
@y
Here are the remaining changes to the program
that are necessary to make \TeX\ work on VAX/VMS.
@^system dependencies@>
%....

@ Define some extra global variables.
@^system dependencies@>
@<Glob...@>=
@!cpu_time:integer; {CPU time in milliseconds}
@!call_editor:boolean; {should we invoke the editor?}
@!edit_len:0..file_name_size;
@!edit_file:str_pointer;
@!imag_item:integer;
@!imag_name:packed array [1..50] of char;
@!imag_len:uword;
@!term_buf:varying [max_print_line] of char;

@ @<Set init...@>=
call_editor:=false;

@ @<Run the editor@> =
if odd(@=$trnlnm@>(,'LNM$FILE_DEV','TEX$EDIT',,)) then
  begin
    imag_item:= @=JPI$_IMAGNAME@>;
    if not odd(lib$getjpi@>(imag_item,,,,imag_name,imag_len)) then imag_len:=0;
    @= lib$do_command@>('@@TeX$edit '+substr(edit_file^,1,edit_len)
          +dec(line)+' '+substr(imag_name,1,imag_len))
  end
@z
%------------------------------------------------------------
Here's edt.com
%------------------------------------------------------------
$! Driver file for running EDT from TeX.
$! P1 = file name, P2 = line number
$! Assumptions:
$! (1) user has set up a symbol EDT to run EDT (e.g., EDT :== EDIT/EDT)
$! (2) if the user has a startup file, he lets EDT know about it by
$!     defining a logical name EDTINI or by having a file EDTINI.EDT
$!     in the default directory (not by using /COMMAND=filespec)
$ if f$type(edt) .nes. "STRING" then exit
$ if f$length(edt) .eq. 0 then exit
$ tmp = "sys$scratch:edit.tmp"                  ! Start a new INI file
$ create 'tmp'          ! Do it this way so a normal text file is created
$ edtini = f$search(f$trnlnm("edtini"))         ! Is there a EDTINI file
$ if edtini.eqs."" then -
  edtini = f$search("edtini.edt")               ! Is there a EDTINI.EDT
$ if edtini.nes."" then append 'edtini' 'tmp'   ! Tack it on
$ open/append tmp 'tmp'
$ write tmp f$string(f$integer(p2))             ! Jump to line
$ close tmp
$ define/user edtini 'tmp'                      ! Define new INI file
$ define/user sys$input sys$command             ! Set up terminal
$ edt 'p1'                                      ! Run EDT
$ delete := delete                              ! To get regular DELETE
$ delete 'tmp';*                                ! Clean up
%------------------------------------------------------------

CC:
        COLMENARES@FORDMURH.bitnet
        TeXhax@cs.washington.edu
        KARNEY

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

Date: Sat, 29 Apr 89 13:58:14 PDT
From: charlie@mica.stat.washington.edu (Charlie Geyer)
Subject: Halmos boxes for proofs
Keywords: LaTeX, Halmos boxes

In TeXhax Digest V89 #28, Michael Barr asks how to make Halmos boxes for 
proof terminators.

I use the following LaTeX environment.  It seems to work fine, but
could probably be improved.

\newenvironment{proof}{\trivlist\item[\hskip \labelsep {\sc Proof}\enskip]}%
{\unskip\nobreak\hskip 2em plus 1fil\nobreak%
\fbox{\rule{0ex}{1ex}\hspace{1ex}\rule{0ex}{1ex}}%
\parfillskip=0pt \endtrivlist}

Then proofs just go between \begin{proof} and \end{proof}.

Charlie Geyer
Department of Statistics
University of Washington
charlie@stat.washington.edu

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

Date: Sat,  29 Apr 89 03:26:13 +0200
From: Michael Maschler <MASCHLA%HBUNOS.BITNET@UWAVM.ACS.WASHINGTON.EDU>
Subject: AMS fonts are not seen in the preview
Keywords: AMS, fonts

We are using PCTeX on AT clones. We use Arbor Text Preview and
Arbor Text DVILASER to get the output on the screen and from our
Apple-Laser.

Recently we installed some symbols from AMS. They come allright
from the printer, but the preview program does not recognise them.

This is puzzling, because Arbor Text Preview and Arbor Text Dvilaser
use, in general *the same fonts*. Can you explain why? And, more
to the point -- what is needed to alleviate this problem.

Thanks in advance,
Michael Maschler

MASCHLA@HBUNOS.Bitnet
MASCHLA%HBUNOS.BITNET@EARN-RELAY

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

Date: Sat, 29 Apr 89 12:13:41 cst
From: convex!txsil!jon@Central.Sun.COM (Jonathan Kew)
Subject: Is there an Arabic font available in MF form?
Keywords: Fonts, Arabic

Is there an Arabic font available (in METAFONT form---I need modified Arabic
for languages such as Sindhi) anywhere?  I've seen some mention of work on
one in TeXhax, but don't recall an announcement about availability.

If anyone is interested, I have adapted Pat Monardo's Common TeX to create
a TeX-XeT (working from version 2.9).  I could send the diffs to anyone who
has a need for such a thing, or post them here if there's a lot of demand.

Jonathan Kew                                 jon@txsil.uucp
Summer Institute of Linguistics              (...!convex!txsil!jon)
7500 West Camp Wisdom Road
Dallas, TX 75236                             (214) 709-2418

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

Date: Fri, 28 Apr 89 12:18:37 GMT
From: Mary Keogh <MKEOGH89%IRLEARN.BITNET@UWAVM.ACS.WASHINGTON.EDU>
Subject: Indenting lines with LaTeX
Keywords: LaTeX, indentation

I've been having some trouble indenting lines in LaTeX. I tried such things as
  \hspace{10mm}
  \hskip10mm
  ~\hspace{10mm}
  ~\hskip10mm
  ~~~
none of which worked; the text stayed flush up against the margin (at the
top of the document I'd set \parindent to 0mm to prevent other lines in the
document being indented where I didn't want them to be). Eventually
\makebox[10]{~} did the trick but this seems a very odd way to get a
sentence moved in the page a bit.

As a very newcomer to LaTeX and TeX I'm sure that this problem has been
encountered before but, as I'd not seen it, any help or explaination would
be welcome.
                       Thanks, Mary K.

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

Date: Fri, 28 Apr 89 14:40:22 EST
From: smith%sandalphon@harvard.harvard.edu (Steven Smith)
Subject: Simple Double Column Macros
Keywords: Macros

In Issue 27, I mentioned some macros that provide balanced double column
capability.  As I received several e-mail requests for these macros,
I will provide them here.

My previous letter stated:

> I am looking for a sophisticated TeX or LaTeX double column macro capable
> of the following:
> 
>       i) Double/Single column capability on the same page (LaTeX
>          starts a new page each time its format is switched from
>          \doublecolumn to \singlecolumn).
> 
>      ii) The ability to split the opposing column of a large displayed
>          equation.  I.e.,
> 
>            The right column will be split   played equation  that  appears
>            when the equation                within it.   These  rules  are
>                                             ------------------------------
>               a^n = b^n + c^n +d^n + e^n + f^n + ... + z^n
>                                             ______________________________
>            appears  in  the left  column.   affected if the split  appears
>            Splitting  must   occur   with   on the top or bottom of a page.
>            horizontal  rules  to separate   The columns  must be  balanced
>            a split  column  from the dis-   and  may include single column
> 
>            material that spans the entire page.
> 
> 
> This format mimics that of many IEEE journals.  Is there an IEEE.sty
> LaTeX style file anywhere?  Have any TeX hackers attacked this problem?
> I currently use double column macros cannibalized from a Knuth paper on
> literate programming (included in VMS TeX releases).  These provide
> balanced double columns with single column text on the same page,
> but have no fancy large displayed equation/split column capability.
> I must admit, examination of the TeX macros performing only i) proves
> a daunting experience for those wishing to embellish them with ii).

My reasons for including this letter are, of course, surreptitious, but I
will nevertheless reveal them: it is my hope that some motivated hacker
take these macros and mold them into the utility described above.  As they
stand they are robust and useful, but limited.  For example, footnoting
is NOT supported (although I believe that this could be a simple addition
if one read Chapter 23 of the TeXbook carefully enough).

I have a few reservations about releasing these macros because i) I didn't
write them (I altered them from some Knuth macros), ii) I don't know how
they work (But they do. Honest.), iii) people will undoubtedly attempt
to encorporate them within LaTeX, an application they are NOT written for.
They redefine TeX's \output routine---the equivalent of lobotomizing
LaTeX.  A LaTeX application for local balanced double columns is possible,
but they must retrench all \ouput routine dependencies.  The rewritten macros
would exploit the \vsplit primitive of TeX and could use these double column
macros as an example.  If you are a LaTeXer who desires balanced double
columns, your best strategy is to either learn TeX or learn to write a LaTeX
style file that performs the task. (I submit that the latter proposition is
Sisyphean while the former is merely Herculean.)

Here are the macros.  Their syntax is

<Single Column Text>

\begindoublecolumns
<Double Column Text>
\enddoublecolumns

<More Single Column Text>

Note that \leftfloat and \rightfloat are defined for floating figures.
Their syntax is exactly that of floating figures in plain TeX:

\leftfloat
\vbox{}
\endfloat

Good Luck!


Steven Smith
smith%sandalphon@harvard.harvard.edu

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Cut Here %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newdimen\pagewidth \newdimen\pageheight \newdimen\ruleht

\newinsert\lefttop \newinsert\righttop
\count\lefttop=1000 \count\righttop=1000
\dimen\lefttop=\maxdimen \dimen\righttop=\maxdimen
\skip\lefttop=25pt plus 3pt minus 3pt
\skip\righttop=\skip\lefttop
\def\leftfloat{\insert\lefttop\bgroup
  \floatingpenalty=0
  \penalty0
  \vbox\bgroup}
\def\rightfloat{\insert\righttop\bgroup
  \floatingpenalty=0
  \penalty0
  \vbox\bgroup}
\def\endfloat{\egroup\egroup}

\def\doublefloatspace #1{
\leftfloat
\vbox to#1{\vfil}
\endfloat
\rightfloat
\vbox to#1{\vfil}
\endfloat}

\newbox\partialpage
\def\begindoublecolumns{\begingroup
  \output={\global\setbox\partialpage=\vbox{\unvbox255}}\eject
  \output={\doublecolumnout} \hsize=3.5in \vsize=19in}
\def\enddoublecolumns{\output={\balancecolumns}\eject
  \endgroup \pagegoal=\vsize}

\def\doublecolumnout{\dimen0=\pageheight
  \advance\dimen0 by-\ht\partialpage \splittopskip=\topskip
  \ifdim\ht\lefttop>0pt \setbox255=\vbox{\unvbox\lefttop
    \setbox0=\lastbox\unvbox0\vskip\skip\lefttop\unvbox255}\fi
  \setbox0=\vsplit255 to\dimen0
  \ifdim\ht\righttop>0pt \setbox255=\vbox{\unvbox\righttop
    \setbox0=\lastbox\unvbox0\vskip\skip\righttop\unvbox255}\fi
  \setbox2=\vsplit255 to\dimen0
  \onepageout\pagesofar
  \unvbox255 \penalty\outputpenalty}
\def\pagesofar{\unvbox\partialpage
  \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}}
\def\balancecolumns{\setbox0=\vbox{\unvbox255} \dimen0=\ht0
  \advance\dimen0 by\topskip \advance\dimen0 by-\baselineskip
  \divide\dimen0 by2 \splittopskip=\topskip
  {\vbadness=10000 \loop \global\setbox3=\copy0
    \global\setbox1=\vsplit3 to\dimen0
    \ifdim\ht3>\dimen0 \global\advance\dimen0 by1pt \repeat}
  \setbox0=\vbox to\dimen0{\unvbox1}
  \setbox2=\vbox to\dimen0{\unvbox3}
  \pagesofar}

\def\onepageout#1{\shipout\vbox{
\vbox to0pt{\vskip-22.5pt
  \hbox to\pagewidth{\vbox to8.5pt{\vss}\the\headline}\vss}
\nointerlineskip
\vbox to\pageheight{#1\boxmaxdepth=\maxdepth}
\baselineskip=24pt
\hbox to\pagewidth{\the\footline}}
\advancepageno}

\output{\onepageout{\unvbox255}}

\hsize=7.25in  \vsize=10in
\hoffset=.625in \voffset=.5in
\pagewidth=\hsize \pageheight=\vsize \ruleht=1pt
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Cut Here %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

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

Date: Sat, 29 Apr 89 16:21:18 cst
From: convex!txsil!jon@Central.Sun.COM (Jonathan Kew)
Subject: DVI file standards
Keywords: dviware

A couple of observations about DVI files:

1) There should be a standard which defines what a program which claims
   to process DVI files should be able to do, like there is for systems
   claiming the name TeX or MF.  It would be very helpful if all DVI-
   interpreting programs which do *not* handle the complete DVI standard
   were somehow required to admit this fact.  For example, I have a screen
   previewer which I discovered cannot cope with characters >=128 in the
   DVI file (i.e. those where TeX82 uses a set1 command.)  No, I don't
   mean that it only uses PXL fonts---I mean that it dies with a message
   about a bad DVI file.  This is *wrong* ... the DVI file is fine.
   I wouldn't mind quite as much if the fact were documented, though there's
   still no real excuse.  Many printer drivers also cannot handle 256-char-
   acter fonts.
   The DVI file format actually allows for 2, 3 and even 4-byte characters;
   I doubt that any DVI-reading programs actually interpret these correctly
   (or does anyone know of such?).  This is less worrying, since standard
   TeX82 never writes such characters.  But I still think we should be told.

2) If I remember correctly, the TeX-XeT extension published in TUGboat didn't
   involve a change to the DVI id byte.  Since DVI files which include the
   reflection op-codes cannot be interpreted by normal DVI-reading programs,
   it seems to me that the id byte should have been changed (see TeX: The
   Program, section 587) to reflect this fact.  Then ivddvi could change it
   back to 2, and drivers which know about reflection could accept either
   format.

Jonathan Kew                                 jon@txsil.uucp
Summer Institute of Linguistics              (...!convex!txsil!jon)
7500 West Camp Wisdom Road
Dallas, TX 75236                             (214) 709-2418

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

Date: Sat, 29 Apr 89 09:36:28 -0400
From: Bob Drzyzgula <fed!arccs1!m1rcd00@uunet.UU.NET>
Subject: Need undump for SunOS 4.0 (Sun 3 and/or Sun 4)
Keywords: SunOS 4.0

I have been trying to get the latest version of ctex (2.95) (dated
March 14, from labrea.stanford.edu(?), via uunet) to run on my sun3
under SunOS 4.0.  I got as far as having working initex & virtex, but
undump (suprise) doesn't know how to deal with the new object formats.
I tried adding -Bstatic to everything, that doesn't help. Has anyone
ported undump to 4.0? Or should I start working on that myself?

BTW, in geting cmf 1.7 to compile, I needed to add a new .c module
in cmf. It contained the following:

#define EXTERN extern
#include "mfd.h"
(The code for inputln() from ../ctex/extra.c)

Is this standard? Is there a more recent release of TeX without these
problems? Are there any other roadblocks I will run in to? I will, when
done with the Sun3, move on to the Sun4, so any info there would be
helpfull as well.

Thanks,


|Bob Drzyzgula                               |Internet: rcd@fed.frb.gov     |
|Senior Information Systems Analyst          |    uucp: uunet!fed!rcd       |
|Division of Research and Statistics         |  Bitnet: fed!rcd@uunet.uu.net|
|Federal Reserve Board, Washington, DC 20551 |   Phone: (202)-452-3425      |

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

%%% The TeXhax digest is brought to you as a service of the TeX Users Group
%%%       in cooperation with the UnixTeX distribution service at the 
%%%                      University of Washington
%%%
%%% Concerning subscriptions, address changes, unsubscribing:
%%%  BITNET: send a one-line mail message to LISTSERV@xxx
%%%          where xxx is the nearest geographical site in the
%%%          tree shown below
%%%         SUBSCRIBE TEX-L <your name>    % to subscribe
%%%      or UNSUBSCRIBE TEX-L <your name>
%%% Here is the BITNET re-distribution tree as shown in a recent
%%% REVIEW (The geography is guessed at from the subscription list)
%%%
%%%                        CLVM    TAMVM1      FINHUTC
%%%                           |    |     (Finland, UK, Scand, CERN)
%%%                           |    |           |
%%%  TeXhax ----> UWAVM ----- MARIST ----- EB0UB011 ----- BNANDP11
%%%                           |     (France,Italy,Spain)  (Belgium)
%%%                           |                |
%%%                        UBVM      HEARN --- DEARN
%%%                              (Netherlands) (Germany)
%%%
%%% Internet: send a similar one line mail message to
%%%           TeXhax-request@cs.washington.edu
%%%     Please be sure you send a valid internet address!!
%%%        in the form name@domain or name%routing@domain
%%%     and use the style of the Bitnet one-line message, so that
%%%     we can find your subscription request easily.
%%%
%%% All submissions to: TeXhax@cs.washington.edu
%%%
%%% Back issues available for FTPing as:
%%%          machine:              directory:  filename:
%%%   JUNE.CS.WASHINGTON.EDU         TeXhax/TeXhaxyy.nn
%%%              yy = last two digits of current year
%%%                       nn = issue number
%%%
%%% For further information about TeX Users Group services and publications
%%%  contact Karen at KLB@SEED.AMS.COM or write to TUG at
%%%   TeX Users Group
%%%   P.O. Box 9506
%%%   Providence, R.I. 02940-9506
%%%   Telephone      (401) 751-7760
%%%
%%% Current versions of the software now in general distribution:
%%%    TeX       2.95 (2.98 coming)    metafont  1.7
%%%    plain.tex 2.94                  plain.mf  1.7
%%%    LaTeX     2.09 ( 8/10/88)       cmbase.mf see cm85.bug
%%%    SliTeX    2.09                  gftodvi   1.7
%%%    tangle    2.9                   gftopk    1.4 
%%%    weave     2.9                   gftype    2.2
%%%    dvitype   2.9                   pktype    2.2 
%%%    pltotf    2.3                   pktogf    1.0
%%%    tftopl    2.5                   mft       0.3
%%%    BibTeX    0.99c                 
%%%    AmSTeX    1.1d
%%%\bye
%%%

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