[comp.text.tex] Common TeX

klaus@cnix.uucp (klaus u schallhorn) (11/14/90)

Because of 8bit charset requirements I have finally decided
to ditch a homegrown formatter and confront TeX head on.

First thing I noticed is the [pardon me] awful chattyness of
TeX. It reminds me a lot of messydos software where you have
to read a screenful before you know if anything at all was
relevant.

Next thing I noticed, you can't ^C out of TeX, and I reckoned
[and found it confirmed in an article just read] that pipes
are probably out when TeX'ing. I would have loved to

	cat whatever | tex | lpr -dvi

NOW people start talking about "common tex", that's supposed
not to patronise you with error screens, faster and oriented
more towards unix [even knows unix?].

Can someone tell me what "common tex" is, where is came from,
how to get it, diff's compared to 3.?, suitability in 8bit char-
set environments and compatibility with fonts && style files.

Please note that I don't regard myself as being familiar with
TeX. I've just compiled it yesterday, am still deciding whether
I've passed trip&trap and that. I have, however, noticed
TeX's "lust" to talk, and to talk, and to talk.... Reminds me
of my mother-in-law, only that the formatting is different.

Please mail, I'll summarise

klaus
-- 
George Orwell was an Optimist

marcel@cs.caltech.edu (Marcel van der Goot) (11/15/90)

In <1990Nov14.150714.15442@cnix.uucp> klaus u schallhorn (klaus@cnix.uucp)
complains about the

> awful chattyness of TeX. 
and
> TeX's "lust" to talk, and to talk, and to talk....

However, klaus continues 
> Please note that I don't regard myself as being familiar with
> TeX. I've just compiled it yesterday, [...]

WOW! You must be a real genius! You just compiled the program, you
aren't quite sure yet whether it compiled correctly, you haven't used
TeX before, and already you know completely what's wrong with the
program. Thank you so much for this insight, I'm sure all readers
of this group have been waiting for it.

> I would have loved to
>     cat whatever | tex | lpr -dvi
> [...]
> [...] even knows unix?

Do you?
Why do you prefer typing "cat whatever.tex | tex" instead of
"tex whatever"? The desire to type 7 extra characters is very
unlike UNIX.

> Next thing I noticed, you can't ^C out of TeX, [...]

Maybe you did not compile it correctly? The TeX versions I have seen
(yes, under UNIX) all react to a ctrl-C with a prompt, at which
you can, among other things, type an X to terminate the program.

Have you considered that maybe the reason that TeX talks and talks and
talks is that you make errors and errors and errors? And you would
"love" to pipe your text with all those errors directly into lpr?

I can assure you, if you write complicated macros, every bit of
information you can get is welcome in case of errors. What do you suggest
as alternative error messages? "memory fault", "bus error", "?" maybe?

Anyway, enough flaming; to say something constructive:
One way to get rid of error messages is to type Q at the first error
prompt. A better way, in TeX 3.0, is to put
  \errorcontextlines=-1
(or =0, or =1, or...) in your input file.

As for "Common TeX", as far as I can tell this is just Knuth's program
rewritten for C/UNIX the hard way. The obvious disadvantage of that
is that it's hard to stay up-to-date that way. The next version is
supposedly going to be 2.95. Amazingly, according to
Piercarlo Grandi (pcg@cs.aber.ac.uk) and Doug McDonald
(mcdonald@aries.scs.uiuc.edu), Knuth's program is some terrible hack
whereas Common TeX is a beauty. You would almost think it was
rewritten from scratch. The main reason seems to be that the
Common TeX program is more readable than Knuth's program. I feel
I should point out, though, that most people just run TeX to typeset
their papers, rather than read the program. But then, typesetting can
be done with troff...

Have a nice day.

					Marcel van der Goot
					marcel@vlsi.cs.caltech.edu

oc@vmp.com (Orlan Cannon) (11/20/90)

In article <1990Nov19.192320.25129@warwick.ac.uk> cudcv@warwick.ac.uk
     (Rob McMahon) writes, in a justifiably irritated tone:
>In article <1990Nov15.085657.2589@nntp-server.caltech.edu>
>marcel@cs.caltech.edu writes large chunks of gratuitous flaming in response to
><1990Nov14.150714.15442@cnix.uucp> klaus u schallhorn (klaus@cnix.uucp), the
>first chunk of which has no information content, followed by
>
>>> I would have loved to
>>>     cat whatever | tex | lpr -dvi
>>
>>Do you?  Why do you prefer typing "cat whatever.tex | tex" instead of "tex
>>whatever"? The desire to type 7 extra characters is very unlike UNIX.
>
>I don't think he literally meant `cat'.  I've often wanted to use TeX as a
>filter, without having to create and tidy up unnecessary temporary files.

Is this so hard? I do this all the time.  Every night I dump data from
a database into a parser, which passes it through a formatter to add
LaTeX headers and formatting codes, which then passes it to LaTeX and
on to the printer.  It's all waiting in the morning when I come in. The
main shell script I use for this and other similar jobs is called
"printtex".  I type "printtex abcdefg.tex" and it prints on the default
output device. It has flags for using different output devices and
different fonts (variations of latex.fmt).  It looks after all the
temporary files and creates them, scans them for errors that I might
want to look at, and deletes them.

TeX is verbose enough to let me create several of these kinds of scripts,
for different purposes.  My only regret is that it is not *more* verbose.

For you non-programmers out there:  it's *easy* to ignore output, just
scan it and pipe it to /dev/null (or the equivalent).  It's when you
don't get enough output that there's a problem.

Hey.  I'm not a TeXpert.  Get it straight.  This is a trivial problem.
It's not a TeX problem.  It's a problem in how you deal with TeX.
-- 
Orlan Cannon                            oc@vmp.com
Video Marketing & Publications, Inc.    (800) 627-4551
Oradell, NJ 07649

cudcv@warwick.ac.uk (Rob McMahon) (11/20/90)

In article <1990Nov19.192320.25129@warwick.ac.uk> cudcv@warwick.ac.uk (Rob
McMahon) I compounded a crime by following up to a flame with another flame,
making comments that would have been better made via email.  This article is
an attempt to correct that (if I can spell supersedes :-).  Please accept my
apologies.

In article <1990Nov15.085657.2589@nntp-server.caltech.edu>
marcel@cs.caltech.edu writes: 
>In article <1990Nov14.150714.15442@cnix.uucp> klaus u schallhorn
>(klaus@cnix.uucp) writes:
>> I would have loved to
>>     cat whatever | tex | lpr -dvi
>
>Do you?  Why do you prefer typing "cat whatever.tex | tex" instead of "tex
>whatever"? The desire to type 7 extra characters is very unlike UNIX.

I don't think he literally meant `cat'.  I've often wanted to use TeX as a
filter, without having to create and tidy up unnecessary temporary files.

>> Next thing I noticed, you can't ^C out of TeX, [...]
>The TeX versions I have seen (yes, under UNIX) all react to a ctrl-C with a
>prompt, at which you can, among other things, type an X to terminate the
>program.

Sometimes you just want it to die, sometimes you don't want a prompt.  Why
else did I type ^C if I didn't want you to go away ... this is all part of the
same thing, trying to use TeX in a script when it expects to be run
interactively.  (Yes, I know about \batchmode.)

>And you would "love" to pipe your text with all those errors directly into
>lpr?

Sometimes, yes, when the errors are along the lines of `underfull hbox'.

>I can assure you, if you write complicated macros, every bit of information
>you can get is welcome in case of errors.

Great, for a `tex -i' when you're debugging, or a `tex -v' when you want to
see verbose errors.  Or it could even use `isatty(0)' to select between modes
at a pinch.  Normally all I want is a list of line numbers and what error
occurred there.

>One way to get rid of error messages is to type Q at the first error
>prompt.

*If there's someone there to type to it*.  You're assuming a particular mode
of use.  This is not the Unix way.  I ought to be able to do

	prog | tex 2>/dev/null | lpr -d

say from a cron job.  If I really want a log file, I'll redirect stderr to it
thank you, I don't need TeX to do it for me automatically.

A better answer at the moment is `tex \\batchmode\\input file', but you still
have to provide the input in file.tex, get the logfile in file.log, and accept
the output file.dvi.

>Amazingly, according to Piercarlo Grandi (pcg@cs.aber.ac.uk) and Doug
>McDonald (mcdonald@aries.scs.uiuc.edu), Knuth's program is some terrible hack
>whereas Common TeX is a beauty.

I think the comments were more along the lines of `it can be compiled to be
more efficient, works on more systems, and can more easily be worked with'.  I
certainly always used to use Common TeX before web2c arrived.  Trying to write
change files is just a nightmare.

Using C also allows the option of removing the fixed sized buffers, so that
small jobs run small, and large jobs don't run out of space and advise to to
recompile TeX (I don't know if this has been done in Common TeX yet, though,
the last copy I used still used fixed sized buffers).

Rob
--
UUCP:   ...!mcsun!ukc!warwick!cudcv	PHONE:  +44 203 523037
JANET:  cudcv@uk.ac.warwick             INET:   cudcv@warwick.ac.uk
Rob McMahon, Computing Services, Warwick University, Coventry CV4 7AL, England

steve@Advansoft.COM (Steve Savitzky) (11/21/90)

[large and occasionally heated discussion omitted, in which a desire
 is expressed to put tex in a pipeline.]

Use make.  More taste, less filling.  Very unix.

  # tex to dvi:
  # 	the "echo q" bit quits out of the error dialog if necessary;
  # 	running latex twice makes sure the auxiliary files are up to date.
  .SUFFIXES: .tex .dvi
  .tex.dvi:
	  echo q | latex $*
	  if [ -f $*.aux ]; then echo q | latex $*; fi

  all: foo.dvi

  print: foo.dvi
	  dvilp $?
	
  texclean:
	  -rm *.aux *.log *.toc *.dvi

  clean:
	  -rm *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a \
		  .emacs_* tags TAGS MakeOut *.odf *_ins.h \
		  *.aux *.log *.toc *.dvi
--
\ --Steve Savitzky--  \ ADVANsoft Research Corp \ REAL hackers use an AXE! \
 \ steve@advansoft.COM \ 4301 Great America Pkwy \ #include<disclaimer.h>   \
  \ arc!steve@apple.COM \ Santa Clara, CA 95954   \        408-727-3357      \
   \__ steve@arc.UUCP _________________________________________________________