#!/bin/sh
#

	case "$0" in
	*/jtex|jtex)	body=virtex; me=jtex; fmt=jplain;;
	*/jlatex|jlatex)	body=virtex; me=jlatex; fmt=jlplain;;
	*/bigjtex|bigjtex)	body=virTEX; me=bigjtex; fmt=JPLAIN;;
	*/bigjlatex|bigjlatex)	body=virTEX; me=bigjlatex; fmt=JLPLAIN;;
	*)		echo "don't know how to be $0" 1>&2; exit 1;;
	esac

	# verify 0, 1 or 2 arguments
	case $# in
	0|1|2)	;;
	*)	echo "usage: $me foo[.tex [my[.fmt]]" 1>&2; exit 1;;
	esac

	exec $body "&"${2-$fmt} ${1+"$1"}

# This script provides an alternative to preloading TeX.  See the
# README.WEB-to-C file for the tradeoffs that come by doing things
# this way.  There is a short delay before TeX (LaTeX/SliTeX) gets
# working, but there is a greater flexibility, and a tremendous
# saving in disk space.  Only one compilation of initex and virtex
# needs to be stored, and it is much smaller than any preloaded image,
# or even than the preloaded file that results from using fmtdump.
# When TeX is invoked as tex, a private format_file (such as a 
# combination of lplain, amstex and pictex) can be loaded in place
# of one of the standards (be sure that the TEXFORMATS environment 
# is correct if you try this).  
# 
# At the University of Washington we use only the TeX with the
# BIGTEX.PATCH applied, so a format file of this size is easily
# accommodated (approximately 725 Kbytes).  Preloaded using undump, TeX
# with this format file would take up nearly 3 Megabytes of disk.  Even
# after using fmtdump, it would be quite large, and you would still have
# the virtex and *.fmt files as additional storage overhead.
# 
# To set this script up, copy it into a directory named in your
# path environment, and rename it tex.  Then link it (hard links
# are fine in this case) to latex and slitex, and insure that it
# is executable.
# 
# You invoke latex and slitex as usual, with a single input file
# argument (or no argument at all).  You can invoke tex with zero,
# one or two arguments.  If the second argument is present, it is 
# assumed to be a *.fmt file in your TEXFORMATS path.



