TeXhax Digest Thursday, December 10, 1987 Volume 87 : Issue 100 [SCORE.STANFORD.EDU]TEXHAX100.87 Editor: Malcolm Brown Today's Topics: wanted: TeX -> PostScript converter Unix TeX METAFONT on SUN3/50-60 (TeXhax Digest V87 #97) Problems with QMS Unix TeX Driver Re: Possible Bug in Count Register Updating spelltex script problem with METAFONT, gftodvi and Simpson's QUIC driver Re: problem with METAFONT, gftodvi and Simpson's QUIC driver Possible Bug in Count Register Updating Apple Laserwriter .TFM files available? Single Spaced Bibliography old metafont Latest TeX upgrade ---------------------------------------------------------------------- From: Dave Sill Subject: wanted: TeX -> PostScript converter Does one exist? If so, where can I get it? (TeXHax: Please e-mail replies, I'm not on your list.) Thanks. ------------------------------ From: Richard Furuta Subject: Unix TeX I am the moderator of the Unix-TeX mailing list. I receive queries from time to time about whether it is active, etc. The list has not been active for the past year but I am planning on resurrecting it at some time in the future. (Indeed, I'm willing to consider giving this list away should someone else wish to become it's keeper.) For those of you who missed out on the history of this thing, Unix-TeX was originally a list devoted entirely to the Unix implementations of TeX distributed by the University of Washington. As such it was intended to be a very low volume list, primarily announcements of bug fixes, etc. A couple of years ago, TeXHaX went through an extended period of silence. During that period of time, Unix-TeX picked up much of the traffic that should really have gone to TeXHaX and became a more general-purpose list. With the return of TeXHaX, this general-purpose role for Unix-TeX is no longer necessary and on resurrection, I would expect that Unix-TeX will once again resume its former role. If you feel strongly that the list is needed *right now*, please drop me a line. I'll try to move it up in my list of things to do if there is a realistic need for the (more specialized) list. --Rick ------------------------------ From: mackay@june.cs.washington.edu (Pierre MacKay) Subject: METAFONT on SUN3/50-60 (TeXhax Digest V87 #97) The problems I have previously noted with SUN OS 3.0 were restricted to the SUN2. I had not heard of trouble with SUN3. IN any case Sun corrected the libraries successfully in O.S 3.2. It works splendidly, and produces much tighter and probably faster code, which works equally successfully on either a SUN2 or a SUN3. You do, however, need to make sure that you use an OS 3.n version of undump. The a.out file headers are quite different. This is as good a time as any to express sincere appreciation to SUN for actually living up to the claim of compatibility across machine architectures. I have, in the past, aired some complaints about buggy compilers, etc. in earlier releases, and there are probably going to be others as things like the SUN4 come into use. But OS 3.2 has been a real success, and the brief encounters I have had with 3.3 and 3.4 indicate that SUN is taking better care with its software environment than just about any other company I am aware of. I have been truly impressed, and very grateful for this. Pierre A. MacKay TUG Site Coordinator for Unix-flavored TeX ------------------------------ From: trwrb!simpson@trwind.TRW.COM (Scott Simpson) Subject: Problems with QMS Unix TeX Driver Robert Coleman of the University of Regina writes of problems with my QMS TeX driver printing files generated by gftodvi. This driver is woefully out of date and should be removed from the Unix TeX distribution tape. I have written a whole new set of very improved drivers for TeX and troff (both kinds) which I am currently testing and announced in a previous issue of TeXhax. I know the new drivers work with gftodvi. I created the hands in troff in about a hour with METAFONT and made regular and smoke proofs! I also know the TeX driver works with SliTeX's invisible fonts. You can get the test version of my software via anonymous ftp from trwind.trw.com. The file is quicspool.tar and is in the pub directory. Once people have sent me bug reports and I am confident the code is stable, I will announce a final release. I still have not decided on a distribution mechanism yet but I hope it will be acceptable to put on the TeX distribution tape. The source is about 5 meg, most of which is troff PK fonts. Scott Simpson TRW Space and Defense Sector ...{decvax,ihnp4,ucbvax}!trwrb!simpson (UUCP) trwrb!simpson@trwind.trw.com (ARPA) ------------------------------ Date: Fri, 4 Dec 87 07:16:57 PST From: KARNEY%PPC.MFENET@NMFECC.ARPA Subject: Re: Possible Bug in Count Register Updating Kent Eschenberg (TeXhax V87 #97) asks about a problem with counters in TeX. The relevant piece of code is \def\testa{\dummy=0 \advance\dummy by 1\ifnum\dummy=0\message{[TESTA=0]} \else\message{[TESTA=not0]}\fi} The "surprise" is that the \if tests true. However TeX scans the \if before executing the \advance because it is looking for the end of the number that begins with "1". This allows you to do things like \advance\dummy by 1\ifnum\dummy=0 0 \else 1 \fi which advances \dummy by 10 or 11. The moral is: Put a space after numbers. Charles Karney Phone: +1 609 683 2607 Plasma Physics Laboratory (after 87/12/12: +1 609 243 2607) Princeton University MFEnet: Karney@PPC.MFEnet PO Box 451 ARPAnet: Karney%PPC.MFEnet@NMFECC.ARPA Princeton, NJ 08544-0451 Bitnet: Karney%PPC.MFEnet@ANLVMS.Bitnet ------------------------------ Date: Fri 4 Dec 87 09:45:03-MST From: Steve Fullerton Subject: spelltex script The following is a modification of the Unix spell program to include Kamal Al-Yahya's detex program, permitting spell checking of TeX files. This program, spelltex, is an improvement over Kamal's texspell script in that it supports the full list of spell options, including "+dictionary", for including your own dictionary. --------------- cut here ---------------- # spell program # B_SPELL flags, D_SPELL dictionary, F_SPELL input files, H_SPELL history, S_SPELL stop, V_SPELL data for -v # L_SPELL sed script, I_SPELL -i option to deroff # Modified to emulate "texspell" by Kamal Al-Yahya # Added `detex' before `deroff' # --- Mathieu Federspiel, Statware, Inc., September 1987 H_SPELL=${H_SPELL-/usr/lib/spell/spellhist} T_SPELL=/tmp/spell.$$ V_SPELL=/dev/null F_SPELL= B_SPELL= L_SPELL="sed -e \"/^[.'].*[.'][ ]*nx[ ]*\/usr\/lib/d\" -e \"/^[.'].*[.'][ ]*so[ ]*\/usr\/lib/d\" -e \"/^[.'][ ]*so[ ]*\/usr\/lib/d\" -e \"/^[.'][ ]*nx[ ]*\/usr\/lib/d\" " trap "/bin/rm -f /tmp/spell.$$; exit" 0 1 2 13 15 for A in $* do case $A in -v) if /bin/pdp11 then echo -v option not supported on pdp11 >&2 EXIT_SPELL=exit else B_SPELL="$B_SPELL -v" V_SPELL=/tmp/spell.$$ fi ;; -a) : ;; -b) D_SPELL=${D_SPELL-/usr/lib/spell/hlistb} B_SPELL="$B_SPELL -b" ;; -x) B_SPELL="$B_SPELL -x" ;; -l) L_SPELL="cat" ;; +*) if [ "$FIRSTPLUS" = "+" ] then echo "multiple + options in spell, all but the last are ignored" >&2 fi; FIRSTPLUS="$FIRSTPLUS"+ if LOCAL=`expr $A : '+\(.*\)' 2>/dev/null`; then if test ! -r $LOCAL; then echo "spell cannot read $LOCAL" >&2; EXIT_SPELL=exit; fi else echo "spell cannot identify local spell file" >&2; EXIT_SPELL=exit; fi ;; -i) I_SPELL="-i" ;; *) F_SPELL="$F_SPELL `dirname $A`/`basename $A .tex`.tex" esac done ${EXIT_SPELL-:} cat $F_SPELL | eval $L_SPELL |\ detex -w $I_SPELL | deroff -w $I_SPELL |\ sort -u |\ /usr/lib/spell/spellprog ${S_SPELL-/usr/lib/spell/hstop} $T_SPELL |\ /usr/lib/spell/spellprog ${D_SPELL-/usr/lib/spell/hlista} $V_SPELL $B_SPELL |\ sort -u +0 - $T_SPELL |\ comm -23 - ${LOCAL-/dev/null} |\ tee -a $H_SPELL echo "`whoami` `date` TeXspell" >>$H_SPELL 2>/dev/null case $V_SPELL in /dev/null) exit esac sed '/^\./d' $V_SPELL | sort -u +0f +0 ------------------------------ Date: Fri, 4 Dec 87 14:49 EST From: Chris Lindblad Subject: problem with METAFONT, gftodvi and Simpson's QUIC driver Date: Thu, 26 Nov 87 13:43:28 CST From: Robert Coleman We are using the Washington distribution tape for UNIX flavoured TeX. Our system configuration is as follows: 1. A vax 750 running Berkley UNIX4.3 2. A QMS800 lasergrafix printer with the QUIC page language. 3. TeX2.0, LaTeX2.09, METAFONT1.2 4. We are using Scott Simpson's QUIC driver supplied with the Washington distribution. Both TeX and LaTeX work smoothly. METAFONT has been compiled, the GRAY font has been generated using the appropriate cannon engine definition for localfont and METAFONT produces the appropriate ..gf file; however, we get the following curious results. 1. gftopxl will correctly produce a font which can be used in a TeX or LaTeX document when the characters are suitably defined. 2. gftodvi produces a dvi file which does not print when Scott Simpson's QUIC driver is used, but the same dvi file does print when the MIT QUIC driver (also supplied with the distribution) is used. WOW! I have never been able to test the MIT driver on QMS 800s. I'm amazed that it works. If dvi files are all the same, why does Scott Simpson's QUIC driver accept the dvi files produced by TeX and LaTeX but not the dvi files produced by gftodvi?? Also, why is it that the MIT QUIC driver has no difficulty with the dvi files produced by the gftodvi program. Has there been some change to the dvi format? Is there another version of gftodvi that we could use? We cannot just switch to the MIT QUIC driver because this driver does not maintain a resident font table as Scott Simpson's QUIC driver does. It is this feature that makes it possible to process both troff and TeX jobs on the same laser printer. Although new users employ TeX/LaTeX, some older users continue with troff. The situation here at MIT sounds similar to yours. We print DVI output on our QMS 1200s and 2400s, but print out on the same printers QUIC output from other sources, including SCRIBE, Lisp Machines, troff, and a simple text-to-quic converter. We found that any driver that made unverifiable assumptions about what was in the memory of the printer would not be robust enough for our needs, so I wrote a DVI to QUIC driver that made no assumptions about the initial state of the printer. We have been running with this driver for a few years and have never regretted the design decision to download just those fonts needed from scratch for each print job. Having the QUIC output that the driver produces be able to stand alone, regardless of the state of the printer when the QUIC file has started printing, has resulted in a quite robust system. People know that can safely power cycle the printer without worrying about any harmful effects. We have found that when the printer is hooked up to the computer with a parallel printer interface, the penalty of downloading fonts as needed for each job was minimal. I don't know whether this would be true if one has his printer hooked up to his computer with a relatively slow serial interface. Anyway, so much for the discussion of the MIT driver. Here's a suggestion for how you might try to print files with Simpson's driver and with the troff output driver. I believe Simpson's driver keeps a file in the spool directory which contains information about what it thinks are the downloaded fonts in the printer. You could fix things so that the output filter that sends the QUIC output from troff to the printer (or for any QUIC data that might change the state of the printer) just obliterate this file, so that Simpson's driver would recover nicely from any change to the state in the printer. In addition, Scott Simpson's driver can load fonts on demand so that if a document uses a large number of fonts the printer may take longer but will eventually print the document. On the other hand, a driver that loads all the fonts required for a given document at the beginning of a run may encounter the problem of having its memory capacity exceeded. I believe the current MIT driver loads fonts incrementally on a per page basis. We have been able to print 400 page books (Patrick Winston's Artificial Intelligence, for example) with the driver without a hitch. I don't know what version of the MIT driver was put on the TeX distribution tape, but it might be a real old one. If you have internet access, a new one can be obtained from the file public/lpr.tar from ftp access from hermes.ai.mit.edu. It might be a good idea to put the more up to date MIT driver on the next TeX distribution tapes, but I don't how to get that done. If somebody wants to tell me, I would appreciate it. ------------------------------ Date: Fri, 4 Dec 87 13:49:05 CST From: William LeFebvre Subject: Re: problem with METAFONT, gftodvi and Simpson's QUIC driver I experienced a problem very similar to the one described by Robert Coleman. It has to do with the order of the font definitions in the postamble of the DVI file. TeX always writes the definitions in decreasing numerical order. That is, the font numbers assigned by successive FONTDEF commands in the postamble decrease. But gftodvi produces the FONTDEFs in a random order, neither ascending nor descending. If your DVI driver has a font lookup bug (such as incorrectly building a sorted list for binary searchs), it will probably never show up when processing a DVI file produced by TeX. But it will show up with a DVI file produced by gftodvi. One of the DVI drivers we used to use had such a bug long ago. It has since been fixed, but it did drive me batty for awhile. The first thing you should check should be that part of the source that handles FONTDEF commands. How does it store and retrieve this information? William LeFebvre Department of Computer Science Rice University ------------------------------ Subject: Possible Bug in Count Register Updating Date: Fri, 04 Dec 87 19:25:21 PST From: Richard Roy I get the same response on UNIX TeX, SUN 4.2bsd v. 3.4 TeX v. 2.5, i.e. isl>tex This is TeX, Version 2.5 for SUN 3.4 UNIX (Pascal) (preloaded format=plain 87.11.21) **\newcount\dummy \def\testa{\dummy=0 \advance\dummy by 1\ifnum\dummy=0\message{[TESTA=0]} \else\message{[TESTA=not0]}\fi} \def\testb{\dummy=0 \advance\dummy by 1 \ifnum\dummy=0\message{[TESTB=0]} \else\message{[TESTB=not0]}\fi} \testa \testb \bye \dummy=\count25 * * * * * * *[TESTA=0] *[TESTB=not0] *No pages of output. Transcript written on texput.log. isl> Interesting?? Has anybody got an answer for this one yet? RR %%% Yes, the answer was given both by Barbara Beeton in digest #99 and %%% Charles Karney in this issue. As Barbara indicated, this %%% is discussed on page 208 in the TeXbook. The solution is to always %%% put a space after a number, or else to type `\relax'. The former %%% might be a little more practical, since it's easier to type a single %%% space than to type out `\relax'. But either one should do it. Malcolm ------------------------------ Date: Fri, 4 Dec 87 11:41 CST From: "Binders, Creepers" Subject: Apple Laserwriter .TFM files available? We have an Apple laserwriter with a whole bunch of fonts in it (Zapf-Chancery, AvantGarde, Bookman, NewCenturySchlbk, Palatino....). However, we don't have .TFM (font metrics?) files for any of the postscript fonts other than the big three - Courier, Times-Roman, and Helvetica. We're running VAX/VMS. Our TeX version is 2.0. Anyone have these files out there? I don't need the fonts themselves -- they're builtin. Thanks for any help you can give me. Chris Kempke KEMPKEC@CARLETON.EDU ------------------------------ Date: Sat, 5 Dec 1987 07:55:26.46 EST From: Subject: Single Spaced Bibliography I have a friend who is typsetting his dissertation using LaTeX to typeset his dissertation. He is using /baselinestretch to double space the document. However, he would like to have his bibliography single spaced. He claims to not be able to change the spacing back to single space for the biblio. That is, setting \baselinestretch back to one seems to be ignored. What's wrong here? Rick Zaccone zaccone@bknlvms.bitnet ------------------------------ Date: Sat, 5 Dec 87 12:56:38 EST From: Ray Hirschfeld Subject: old metafont Does anybody have the SAIL source for the old metafont? I have a twenex binary only. I still use this beast to generate such things as the AMS symbol and cyrillic fonts, as well as (gasp!) an occasional am font when somebody insists. Thanks, Ray ------------------------------ Date: Sat, 5 Dec 87 12:49:14 PST From: mackay@june.cs.washington.edu (Pierre MacKay) Subject: Latest TeX upgrade Here is a context diff that can be used to patch TeX version 2.5 into version 2.7 on Unix systems. If you have older versions to patch, look at tex_patches.sh on ~ftp/pub at june.cs.washington.edu. --------------------------------cut here-------------------------------- *** TEX2.5.WEB Wed Oct 14 07:03:19 1987 --- TEX.WEB Sat Dec 5 03:37:31 1987 *************** *** 21,26 **** --- 21,28 ---- % Version 2.3 avoids incomplete page in premature termination (August 1987). % Version 2.4 fixes \noaligned rules in indented displays (August 1987). % Version 2.5 saves cur_order when expanding tokens (September 1987). + % Version 2.6 adds 10sp slop when shipping leaders (November 1987). + % Version 2.7 improves rounding of negative-width characters (November 1987). % A reward of $40.96 will be paid to the first finder of any remaining bug. % (This amount will double again in 1988.) *************** *** 161,167 **** known as `\TeX' [cf.~Stanford Computer Science report CS1027, November 1984]. ! @d banner=='This is TeX, Version 2.5' {printed when \TeX\ starts} @ Different \PASCAL s have slightly different conventions, and the present @!@:PASCAL H}{\ph@> --- 163,169 ---- known as `\TeX' [cf.~Stanford Computer Science report CS1027, November 1984]. ! @d banner=='This is TeX, Version 2.7' {printed when \TeX\ starts} @ Different \PASCAL s have slightly different conventions, and the present @!@:PASCAL H}{\ph@> *************** *** 10782,10795 **** -16+b\cdot2^{-4}+c\cdot2^{-12}+d\cdot2^{-20}&a=255.\cr}}\right.$$ (No other choices of |a| are allowed, since the magnitude of a number in design-size units must be less than 16.) We want to multiply this ! quantity by the integer~|z|, which is known to be less than $2^{27}$. Let ! $\alpha=16z$. If $|z|<2^{23}$, the individual multiplications $b\cdot z$, $c\cdot z$, $d\cdot z$ cannot overflow; otherwise we will divide |z| by 2, 4, 8, or 16, to obtain a multiplier less than $2^{23}$, and we can compensate for this later. If |z| has thereby been replaced by $|z|^\prime=|z|/2^e$, let $\beta=2^{4-e}$; we shall compute $$\lfloor(b+c\cdot2^{-8}+d\cdot2^{-16})\,z^\prime/\beta\rfloor$$ ! if $a=0$, or the same quantity minus $\alpha$ if $a=255$. This calculation must be done exactly, in order to guarantee portability of \TeX\ between computers. --- 10784,10797 ---- -16+b\cdot2^{-4}+c\cdot2^{-12}+d\cdot2^{-20}&a=255.\cr}}\right.$$ (No other choices of |a| are allowed, since the magnitude of a number in design-size units must be less than 16.) We want to multiply this ! quantity by the integer~|z|, which is known to be less than $2^{27}$. ! If $|z|<2^{23}$, the individual multiplications $b\cdot z$, $c\cdot z$, $d\cdot z$ cannot overflow; otherwise we will divide |z| by 2, 4, 8, or 16, to obtain a multiplier less than $2^{23}$, and we can compensate for this later. If |z| has thereby been replaced by $|z|^\prime=|z|/2^e$, let $\beta=2^{4-e}$; we shall compute $$\lfloor(b+c\cdot2^{-8}+d\cdot2^{-16})\,z^\prime/\beta\rfloor$$ ! if $a=0$, or the same quantity minus $\alpha=2^{4+e}z^\prime$ if $a=255$. This calculation must be done exactly, in order to guarantee portability of \TeX\ between computers. *************** *** 10810,10819 **** end @ @= ! begin alpha:=16*z; beta:=16; while z>=@'40000000 do ! begin z:=z div 2; beta:=beta div 2; end; end @ @= --- 10812,10822 ---- end @ @= ! begin alpha:=16; while z>=@'40000000 do ! begin z:=z div 2; alpha:=alpha+alpha; end; + beta:=256 div alpha; alpha:=alpha*z; end @ @= *************** *** 12097,12109 **** end; leader_wd:=width(leader_box); if (leader_wd>0)and(rule_wd>0) then ! begin edge:=cur_h+rule_wd; lx:=0; @; while cur_h+leader_wd<=edge do @; ! cur_h:=edge; goto next_p; end; end --- 12100,12113 ---- end; leader_wd:=width(leader_box); if (leader_wd>0)and(rule_wd>0) then ! begin rule_wd:=rule_wd+10; {compensate for floating-point rounding} ! edge:=cur_h+rule_wd; lx:=0; @; while cur_h+leader_wd<=edge do @; ! cur_h:=edge-10; goto next_p; end; end *************** *** 12255,12267 **** end; leader_ht:=height(leader_box)+depth(leader_box); if (leader_ht>0)and(rule_ht>0) then ! begin edge:=cur_v+rule_ht; lx:=0; @; while cur_v+leader_ht<=edge do @; ! cur_v:=edge; goto next_p; end; end --- 12259,12272 ---- end; leader_ht:=height(leader_box)+depth(leader_box); if (leader_ht>0)and(rule_ht>0) then ! begin rule_ht:=rule_ht+10; {compensate for floating-point rounding} ! edge:=cur_v+rule_ht; lx:=0; @; while cur_v+leader_ht<=edge do @; ! cur_v:=edge-10; goto next_p; end; end ----------------------------------------------------------------------------- Pierre A. MacKay TUG Site Coordinator for Unix-flavored TeX ------------------------------ %%% %%% subscriptions, address changes to: texhax-request@score.stanford.edu %%% please send a valid arpanet address!! %%% %%% submissions to: texhax@score.stanford.edu %%% %%% BITNET redistribution: TEX-L@MARIST.BITNET (list server) %%% %%%\bye %%% ------------------------------ End of TeXhax Digest ************************** -------