[comp.text] TeXhax Digest V89 #87

TeXhax@cs.washington.edu (TeXhax Digest) (10/03/89)

TeXhax Digest    Sunday,  October 1, 1989  Volume 89 : Issue 87

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:         

               Re: Help with creating new BibTeX .bst files
                                MacBibTeX
                    Details of TeX servers worldwide
                           Re: Spell checkers
                   Problem with \midinsert, \pageshrink
                         Problem with \filbreak
                       Crude line numbering macro...
                TeXhax Digest V89 #82 (problems with \big)
                             Needed: dvitovdu
                            Bug in makeindex?
                 LaTeX: font changes in tabular enviroment

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

Date: Tue, 19 Sep 89 14:23:06 +0200
From: unido!mathematik.uni-Bremen.de!bengt@uunet.UU.NET
Subject: Re: Help with creating new BibTeX .bst files
Keywords: BibTeX, .bst

Tom Prusa <TPRUSA@SBCCVM.BITNET> asks about creating bst-files. Here's
my "wisdom":

Use the master file that generates the .bst-files with the C
preprocessor CPP. Modify this, cleanly, with the cpp-directives, so
that it will still generate functionally the same basic style files.
For example, I have an option for generating German styles, e.g.

#ifdef ENGLISH
        { "chapter" }
#endif
#ifdef GERMAN
        { "Kapitel" }
#endif

Local abbreviations are #include'd:

#include "journals.abbrevs"
#include "language.abbrevs"

Then, with a single operating system command, I generate all style
files, all having the same set of abbreviations. I use make, but it
can of course also be done with more primitive tools. An abbreviated
version of my Makefile follows:

# Makefile for bst

CPP = /lib/cpp -P
BSTDIRECTORY = /usr/lib/tex/bibtexstyles

all:	abbrv.bst alpha.bst plain.bst unsrt.bst \
	gabbrv.bst galpha.bst gplain.bst gunsrt.bst \
	proof.bst ieeetr.bst siam.bst named.bst

abbrv.bst:	abbrv.doc
		sed -e "s/%.*//g" < abbrv.doc > abbrv.bst

abbrv.doc:	bibtexstyles.cpp journals.abbrevs language.abbrevs
		$(CPP) -DABBRV bibtexstyles.cpp abbrv.doc

gabbrv.bst:	gabbrv.doc
		sed -e "s/%.*//g" < gabbrv.doc > gabbrv.bst

gabbrv.doc:	bibtexstyles.cpp journals.abbrevs language.abbrevs
		$(CPP) -DABBRV -DGERMAN bibtexstyles.cpp gabbrv.doc



install:	all
		cp *.bst $(BSTDIRECTORY)

clean:
		rm -f *.doc *.bst

zapdoc:
		rm -f *.doc


The generated standard styles are (functionally) identical to the
supplied ones, except for the local abbreviations (of course
documented in the Local Guide). I enclose a shellscript for generating
a nice LaTeX file containing the abbreviations.


(If your system lacks cpp, you get one (free) from Free Software
Foundation, for example on the Gnu Emacs tape.  I also think a saw a
baby-cpp in the Clarkson achieves.)

<<BTW, I submitted a BibTeX bugreport on June 26. Anyone seen that?
(The Bitnet "redistribution" of TeXhax misses issues every now and
then.)>>

#!/bin/sh

# Bengt Martensson <bengt@mathematik.uni-Bremen.de>

# Generates a nice LaTeX file of the abbreviations in the bibtex-styles in
# the arguments.

# Bugs: 
#   REQUIRES that the definition is written in ONE line
#   Does not check for consistency of the abbreviated versions and the 
#   full versions

short_file=/tmp/short$$
full_file=/tmp/full$$
outfile=printabbrevs.tex

usage='usage: printabbrevs [-output|-preview|-cpp|-latex] bibtexstyle-file...'

cpp=false
latex=false
preview=false
dvipreviewcommand="xdvi"

while :
do
   case "$1" in
	-cpp) cpp=true; shift;;
	-debug)	set -x; shift;;
	-preview) preview=true; shift;;
	-l|-latex) latex=true; shift;;
	-o|-output) outfile="$2"; shift 2;;
	-*|+*) echo "$usage" >&2; exit 1;;
	*) break;;
	esac
    done

if [ $# -lt 1 ]
then
   echo $usage >&2
   exit 1
fi

dvifile=`echo $outfile | sed -e 's/\.tex$/.dvi/'`
echo "Outputting to $outfile" >&2

warning=false
if $cpp
then
	cat $* | /lib/cpp -P > $short_file
	cat $* | /lib/cpp -P -DMONTH_FULL -DJOUR_FULL > $full_file
else
	cat $* > $full_file
	cp /dev/null $short_file
	if grep "#include" $full_file >/dev/null
	then
		warning=true
		echo "Warning: Ignoring #include in the file(s). (Use the -cpp flag to invoke cpp.)" >&2
	fi
fi

echo "\\documentstyle[a4wide]{article}
\\frenchspacing
\\begin{document}
\\title{Abbreviations in file(s): $*"  	> $outfile
if $warning
then
	echo "\\\\(cpp not invoked)"	>> $outfile
fi
echo "}
\\author{Generated by printabbrevs on `date '+%a %d-%h-%y %H:%M'`}
\\date{}
\\maketitle
\\begin{list}{}{\\settowidth\\labelwidth{1234567}
       \itemsep=2pt plus 1pt
       \def\makelabel#1{\tt #1\hfil}}" >> $outfile
awk '
/MACRO/ {
  key = substr($2,2,length($2)-2)
  it = substr($0,index($0,"\"")+1)
  it = substr(it,1,index(it,"\"")-1)
  if (full == 1) {
    full_array[key] = it
  }
  else {
    short_array[key] = it
  }
}

END {
  for (i in full_array) {
    printf "\\item[%s] %s {\\em %s}\n",i,full_array[i],short_array[i]
  }
  
}' full=1 $full_file full=0 $short_file |sort +1 >> $outfile

echo "\\end{list}
\\end{document}" >> $outfile

rm -f $full_file $short_file

if $latex
then
	latex $outfile
fi
if [ $? -ne 0 ] 
then
	exit 1
fi
if $preview
then
	$dvipreviewcommand $dvifile &
fi

Bengt Martensson		      			+49 421 218-2952
Institute for Dynamical Systems               		+49 421 171713 (home)
University of Bremen	        		   FAX:	+49 421 218-3054
Postfach 330 440	      bengt@mathematik.uni-Bremen.de
D-2800 Bremen 33  	      bengt%mathematik.uni-Bremen.de@uunet.UU.NET
F.R.G.			      G09E@DHBRRZ41.BITNET      

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

Date: 19-SEP-1989 10:32:14 GMT
From: FPS%VAXA.CC.IMPERIAL.AC.UK@UWAVM.ACS.WASHINGTON.EDU
Subject: MacBibTeX
Keywords: MacBibTeX

MacBibTeX was ported to the Mac and is distributed in
the UK by me. in the US i guess that Blue Sky will
distribute it too.

we really ought to put it somewhere accessible. i shall
certainly put it on the aston server. any volunteers for
the US.

note that there are (possibly two) versions of MakeIndex
for the Mac too. (see me after school....).

aardvark - mainly harmless

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

Date: Mon, 18 Sep 89 11:59 GMT
From: Peter Flynn UCC <CBTS8001%IRUCCVAX.UCC.IE@UWAVM.ACS.WASHINGTON.EDU>
Subject: Details of TeX servers worldwide
Keywords: TeX, servers, information

At the TeX89 conference in Karlsruhe, I started to prepare a document
describing the various servers containing TeXware. Before I release this,
a quick check: I have details on the following:

clarkson   aston   texas a&m   heidelberg   simtel-20 (+ trickle)

Are there any others I should include? If so, mail me quickly and I will
put them in. I am also including Jon Radel's mail order service (thanks,
Jon).

The file will be in 2 forms, SERVERS.TEX and SERVERS.ASC (the latter for
those who do not even have TeX yet). Lance Carnes has kindly offered to
include the file with hs shipments of PC-TeX: anyone else is welcome also
to do this. The doc is *not* an "academic-nets only" text, but should be
applicable to anyone connected to something with mail (including the
commercial mailers, courtesy of DasNet).

...Peter

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

Date: Mon, 18 Sep 89 12:13 MET
From: SCHRAMA%TUDGV1.TUDELFT.NL@UWAVM.ACS.WASHINGTON.EDU
Subject: Re: Spell checkers
Keywords: spell checkers

Frequently texhax is confronted with questions like these:

> Date: Fri, 1 Sep 89 14:53 EDT
> From: "Dwaine L. VanBibber" <DLV101%PSUVM.BITNET@UWAVM.ACS.WASHINGTON.EDU>
> Subject: Spell checkers for TeX
> Keywords: spell check, TeX
>
> Does anyone know of a shareware spell checker for use with TeX that runs on
> IBM PCs?

Now what to do with them:

In general, any spell checker will run with tex since the critical point
for a spell checker is the editor (and os) environment it works in. There
is really plenty of commercial software available that does spell checking
with a number of editors available under DOS. What I normally use is Turbo
pascal (its editor only) and Turbo lightnin (both come from Borland for
a real reasonable price). However do not believe that spell checkers help
to improve your English (as you might conclude from mine).

The most important point that spell checkers (that I know) miss are that
they only check words whereas they do not check the grammatical environment
of a sentence. Probably this is a very difficult problem (which can only be
solved by somebody like D. Knuth).

So therefore I want to propose that this list should concentrate on tex
related subjects. The item "spell checkers" is typically something for
journals like BYTE since it is really a very general problem.

Ejo Schrama, schrama@tudgv1.tudelft.nl

disclaimer: Anything stated in this message is the opinion of myself and
            not necessarily of my employer.

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

Date: Mon 18 Sep 89 18:01:40-EST
From: Michael Downes <MJD@MATH.AMS.COM>
Subject: Problem with \midinsert, \pageshrink
Keywords: TeX, \midinsert, \pageshrink

At the American Mathematical Society we've been puzzled for quite a while
by occasional odd behavior by Plain TeX's \midinsert ... \endinsert macro.
The contents of the midinsert are supposed to be placed in a vbox on the
current page, if there is enough room left on the page, and otherwise they
are supposed to be packaged as a topinsert.  The odd behavior that we
noticed was that in some cases the midinsert would be turned into a topinsert
even though there was enough room on the current page.  This was manifested
by the contents of the midinsert showing up at the TOP of the current page,
which purportedly did not have room for it.

After examination of the definition of \endinsert, I think the problem is
traceable to the fact that when the midinsert is being measured, \pageshrink is
not taken into account, and if it is converted to a topinsert, \pageshrink
*will* be taken into account.  Is this a known problem, and if so, does anyone
recall where it was reported?  (Barbara Beeton is away from the AMS at present,
else I could have asked her.)  I don't want to bother Knuth about this if it's
something that was fixed long ago.  Or does anyone know that there are bad
side effects if you try to take the \pageshrink into account when measuring
a midinsert?

Here is a test file that demonstrates the problem:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% No macro files except plain.tex are loaded
\hsize20pc
\vsize10pc
\vbox to 6pc{\hrule\smallskip
Some sample text within a vbox of a specified size (6pc).
The horizontal rules above and below indicate
the top and bottom of this vbox.  Below the vbox is
a vskip of zero points, with stretch and shrink of three picas.
Below that is a midinsert of height 4pc.
\vfil\hrule}
\vskip0pt plus 3pc minus 3pc
\midinsert
\vbox to 4pc{\vfil\centerline{A midinsert of 4pc, which ought}%
\centerline{to come at the bottom of}%
\centerline{page 1 or the top of page 2.}\vfil}
\endinsert

And finally another line of text; this should come out on page 1, unless
the midinsert remains on page 1.
\bye

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

It seems to me that to fix this problem one can add a line in the \endinsert
macro where the midinsert gets measured:

\def\endinsert{\egroup % finish the \vbox
  \if@mid \dimen@\ht\z@ \advance\dimen@\dp\z@
    \advance\dimen@12p@ \advance\dimen@\pagetotal
%%%%%%%  Add the following line:
    \advance\dimen@-\pageshrink 
    \ifdim\dimen@>\pagegoal\@midfalse\p@gefalse\fi\fi
  \if@mid \bigskip\box\z@\bigbreak
  \else\insert\topins{\penalty100 % floating insertion
    \splittopskip\z@skip
    \splitmaxdepth\maxdimen \floatingpenalty\z@
    \ifp@ge \dimen@\dp\z@
    \vbox to\vsize{\unvbox\z@\kern-\dimen@}% depth is zero
    \else \box\z@\nobreak\bigskip\fi}\fi\endgroup}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

A closing remark:  for complete security, it seems that the 12p@ in the third
line of the definition ought to be \bigskipamount, since the value 12pt is
really dependent on the space---a \bigskip---that will be added above the
midinsert if the midinsert is placed on the current page, and since it is
possible that a user may change the \bigskipamount.  Since \bigskipamount will
be coerced from a skip to a dimen if used this way, it will add precisely 12pt
to \dimen@, as before, if Plain TeX's settings are in effect.

Michael Downes
Composition Department, American Mathematical Society
Internet address: mjd@math.ams.com 

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

Date: Sat, 16 Sep 1989 15:48:49 EDT
From: Oswald Wyler <wyler@PROOF.ERGO.CS.CMU.EDU>
Subject: Problem with \filbreak
Keywords: TeX, \filbreak

I cannot get the TeX command \filbreak, as used e.g. in \beginsection,
to work properly, either in TeX or in LaTeX.  It may break a page near the
top, or I may find a section title as the last line of a page.  How can I
fix that?			Oswald Wyler
				wyler@cs.cmu.edu

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

Date: Fri, 15 Sep 89 11:02 CDT
From: <NABHELP%TAMSTAR.BITNET@UWAVM.ACS.WASHINGTON.EDU>
Subject:  Crude line numbering macro...
Keywords: TeX, line numbering, macro

Here is a short, crude solution to the problem posed by Wei-Chang Shann
in TeXhax89 v81. Line numbers 1 - 27 (which is normal for a double spaced,
10pt copy) will appear down the lefthand column. This is done by creating
a vertical box and placing it in the headline, and offsetting it. The
problem is that TeX cannot be allowed to strech or shrink between lines
and paragraphs because this would throw off the lines with the numbers.
So basically, with this solution, we have limited TeX (in some respects)
to a  word processor, but maybe this will help anyway.


\parskip=0pt
\baselineskip=24pt
\font\smallfont=cmr8
\headline={\hbox to 0pt{\kern-.75in\lower24pt\vbox{
\smallfont
\null
\vskip18ptplus0ptminus0pt
1 \par 2\par 3\par4\par5\par6\par7\par8\par9\par10\par11\par12\par
13\par14\par15\par16\par17\par18\par19\par20\par21\par22\par23\par24
25\par26\par27\vfill}\hss}}

Neil Burleson                Reply to: DECnet          THOR::NABTEXM
ACS Help Desk                          Internet        nabtexm@venus.tamu.edu
ACS User Services                      Bitnet          nabtexm@tamvenus
Remote Computing Center
TeXas A&M University

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

Date: Fri, 15 Sep 89 09:40:47 EDT
From: bkph@ai.mit.edu (Berthold K.P. Horn)
Subject: TeXhax Digest V89 #82 (problems with \big)
Keywords: LaTeX, \bib

I'd like to comment on Martin Ward's note on problems with \big in
other than ten point fonts.  This is a bug that has been the plain-tex
macros from the very beginning, and is not unique to LaTeX.  
It can have somewhat surprising results when one is resetting some
mathematical text in a different font size, as for example when making
overhead transparencies.  In this last case one also wants larger
sizes of cmex10.  We fixed the problem locally (mostly for YTeX users)
about five years ago.  Somehow I'd assumed this problem had been noted and
fixed elsewhere.  The fixes may be found in the following file, marked
with the comment %NEW.  This is a file that redefines some macros in
plain.tex, after \inputting plain.tex (This fix is more general than
the one given by Martin Ward, since it applies to more than just 11
and 12 point size, and since it works for various TeXs built on top of
plainTeX, not just LaTeX .

This is our /usr/local/lib/tex/inputs/plain-cm.tex:

%% Moderator's note: Due to the amount of space it occupies,
%% the file referred to is available by ftp from june.cs
%% washington.edu.

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

Date: Fri, 15 Sep 89 11:23:45 -0500
From: nhf@maxwell.physics.purdue.edu (Norman H. Fuchs)
Subject: Needed: dvitovdu
Keywords: dvitovdu 

According to Andrew Trevorrow, the Pascal sources for the Pyramid version
of his program DVITOVDU should be on the latest Unix TeX tape.  All I can
find on the distributed tape is the Modula-2 source, which is for an old
version of the program.  If the Pascal source is available, I'd like it,
please.

Norman Fuchs

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

Date: Sun, 17 Sep 89 21:54:17 BST
From: spqr%ecs.southampton.ac.uk@NSFnet-Relay.AC.UK
Subject: Bug in makeindex?
Keywords: Makeindex, bug

Running `makeindex' yesterday (version dated Feb 88, is there a more
recent one?), I was surprised to be told that my page numbers were
unacceptable, as the limit was 4 digits, and mine exceeded that. As
they were in the region 1000 to 2500, I was a bit miffed and poked at
the source, to discover a constant ARAB_MAX and a comparison of n >=
ARAB_MAX. ARAB_MAX was set to 4, my digit was 4 long, so the
comparison tripped and my index failed. Setting ARAB_MAX to 5 solved
the problem, but iof it hasn't been fixed before, it should be now.

not that makeindex is not an excellent thing. my index (entries in a catalogue,
not page numbers - I don't write books that long!) of aboyt 8500 entries
was swallowed, digested and spat out in exemplary fashion. I was impressed.

Sebastian Rahtz

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

Date: Tue, 19 Sep 89 12:12:54 NZT
From: Russell Fulton <ccc032u@aucc1.aukuni.ac.nz>
Subject: LaTeX: font changes in tabular enviroment
Keywords: LaTeX, fonts, environment
 
I need to set one line of a table in italics. The only way I can find to
do this is as follows:
 
\begin{tabular} {llllllll}
{\it first}&{\it line}&{\it must}&{\it be}& {\it set}& {\it in}&{\it italics}\\
other & lines & are & set & in roman\\
\end{tabular}
 
i.e. I have to set italics for each column. This is because (as far as I can
figure out) the '&' forces an 'end group' and TeX requires that braces be
matched within an group.
 
What I would like to be able to do is set italics once for the whole line.
 
Is it possible? Do other table making styles have this limitation?
 
Any help gratefully received!
 
Russell.
Organisation: "Computer Centre, University of Auckland
               Private Bag, Auckland, New Zealand"
telephone: "+64 9 737-999 X 8955 (GMT +12,nzt)"
fax: "+64 9 303-2467"
internet: "rj.fulton@aukuni.ac.nz"

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

%%% Further information about the TeXhax Digest, the TeX
%%% Users Group, and the latest software versions is available
%%% in every tenth issue of the TeXhax Digest.
%%%
%%% Concerning subscriptions, address changes, unsubscribing:
%%%
%%%  BITNET: send a one-line mail message to LISTSERV@xxx
%%%         SUBSCRIBE TEX-L <your name>    % to subscribe
%%%      or UNSUBSCRIBE TEX-L
%%%
%%% Internet: send a similar one line mail message to
%%%           TeXhax-request@cs.washington.edu
%%% JANET users may choose to use
%%%           texhax-request@uk.ac.nsf
%%% 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
%%%
%%%\bye
%%%

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