From wang@CSD4.CS.NYU.EDU Sat Mar  3 21:14:03 1990
Return-Path: <wang@CSD4.CS.NYU.EDU>
Received: from CSD4.CS.NYU.EDU by shasha.cs.nyu.edu (4.0/25-eef)
	id AA04129; Sat, 3 Mar 90 21:14:02 EST
Received: by CSD4.CS.NYU.EDU (5.61/1.34)
	id AA02844; Sat, 3 Mar 90 21:11:39 -0500
Date: Sat, 3 Mar 90 21:11:39 -0500
From: wang@CSD4.CS.NYU.EDU (Tsong-Li Wang)
Message-Id: <9003040211.AA02844@CSD4.CS.NYU.EDU>
To: shasha@shasha.cs.nyu.edu
Subject: What I know about the script
Cc: wang@CSD4.CS.NYU.EDU
Status: R

>From shasha@shasha.cs.nyu.edu Fri Mar  2 11:20:25 1990
Received: from SHASHA.CS.NYU.EDU by CSD4.CS.NYU.EDU (5.61/1.34)
	id AA11121; Fri, 2 Mar 90 11:20:25 -0500
Received:  by shasha.cs.nyu.edu (4.0/25-eef)
	id AA02117; Fri, 2 Mar 90 11:22:43 EST
Date: Fri, 2 Mar 90 11:22:43 EST
From: Dennis Shasha <shasha@shasha.cs.nyu.edu>
Message-Id: <9003021622.AA02117@shasha.cs.nyu.edu>
To: wang@csd2
Subject: how do you print out latex files
Status: RO

Tsong-Li,
Here is my command script.
Is there anything wrong with it?
Dennis


if test -s $1.aux
then
latex $1 > $1.temp;
dvi2ps $1.dvi | lpr -Pap4;
rm $1.dvi
else
latex $1 > $1.temp;
latex $1 > $1.temp;
dvi2ps $1.dvi | lpr -Pap4;
rm $1.dvi $1.temp
fi

  > > > Dennis, this script is not a safe command file for the following
  > > > reasons:
  > > >  1. I am not sure if the system knows the command "test".
  > > >     It may be safer to have 
  > > >         #! /bin/sh
  > > >     at the beginning of the script, so that the system knows
  > > >     the shell command.
  > > >   
  > > >  2. Suppose we do have something in the $1.aux file.  So
  > > >     the if part will be executed.  However, if we have made
  > > >     some changes in the $1 file, the script file will not
  > > >     aware of that change  and will just execute the old $1 file.
  > > >     
  > > >  3. Suppose we have syntax errors in our latex source file,
  > > >     using the above script, we can not see any diagnostic
  > > >     on the screen (since we redirect the output to a          
  > > >     temp file).   Even worse, since the latex will wait
  > > >     until we input a command (e.g. type q to skip all
  > > >     error messages), and since using the script we cannot
  > > >     enter any command from the keyboard, we will just
  > > >     wait forever in case of errors.
  > > >     
  > > >  4. I just learned that suppose we want to cross reference     
  > > >     any literature, using the way Lamport suggests,
  > > >     we should use  bibtex $1 command.  However this 
  > > >     command is absent in the above script file.
  > > >     
  > > > 
  > > >    
  > > >     The conclusion is that it's not appropriate to use 
  > > >     scripts to run latex files.  (I use scripts to run
  > > >     troff files, but never latex files.)
  > > >     
  > > >     By the way, the commands I described in my previous
  > > >     mail are not standard ones either.  Normally, one
  > > >     should type the following: (assuming t is the latex
  > > >     file name)
  > > >
  > > >               latex t
  > > >               bibtex t
  > > >               latex t
  > > >               latex t
  > > >               dvi2ps t | lpr -Pap4
  > > >
  > > >     Please note that one should type latex three times in
  > > >     order to get everything.
  > > >     Since I just use my way to cite literature (i.e. I put
  > > >     references on my own), and I am usually lazy,
  > > >     so I just type latex once (That's why sometimes I
  > > >     can not get, for example, the table of contents of a paper.)
  > > >
  > > > 
  > > >    Tsong-Li


