[comp.text] TeXhax Digest V90 #15

TeXhax@cs.washington.edu (TeXhax Digest) (02/07/90)

TeXhax Digest    Friday,  February 2, 1990  Volume 90 : Issue 15

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:         

                        Arguments in braces, revisited
                   RTF/DCA conversion program to TeX or LaTeX
                             PostScript previewer?
                         Looking for AFM->TFM for OzTeX
                       VF files and DVI-to-DVI converters
                         TeX, automatic line numbering
                         Help with metafont and dvialw
                layout.sty, bug repair and reversemarginpars
      *** Updated METAFONT, .BUG files available from Aston Archive ***

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

Date:  Mon, 22 Jan 90 15:27:24 MET
From: Victor Eijkhout <U641000%HNYKUN11.BITNET@Forsythe.Stanford.EDU>
Subject: Arguments in braces, revisited
Keywords: TeX, arguments

We all know that with \def\foo#1{...} the call \foo 10
makes #1 == 1, so we write \foo {10}. However, the \mark
_insists_ on finding its argument in braces: \mark{0} is good, and
\mark 0 gives an error msg.

Hm. Lessee, can I do that too?

Yes!

{\catcode`\<=1 \catcode`\>=2 \catcode`\{=12 \catcode`\}=12
 \global\def\baz{#1}<\dofoo<#1>\egroup>>
\def\foo{\bgroup\catcode`\{=12 \catcode`\}=12 \baz}
\def\dofoo#1{\message{#1}}
\foo keep your braces on!
\foo {an elephant in curly blankets}

Another exercise in futility, courtesy of


Victor Eijkhout                     Department of Mathematics
                                    University of Nijmegen
                                    Toernooiveld 5
  "Far out in the uncharted         6525 ED Nijmegen, the Netherlands
   backwaters of the unfash-
   ionable end of the               +31 80  61 3169
   western spiral arm               (switchboard: 61 1111)
   of the galaxy"
                                    u641000@HNYKUN11.BITNET

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

Date: Tue, 23 Jan 90 17:10:22 EST
From: Mark_Alexander_Davis@um.cc.umich.edu
Subject: RTF/DCA conversion program to TeX or LaTeX
Keywords: TeX, LaTeX, conversion program

Does anyone know of a utility that translates RTF or DCA into TeX or
LaTeX or vice versa?

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

Date:  23 Jan 90 14:06:00 EST
From: Albert (A.) Cohoe <COHOE%BNR.CA@UWAVM.ACS.WASHINGTON.EDU>
Subject:  PostScript previewer?
Keywords: previewer, PostScript,

Can anyone tell me where to find a PostScript previewer that runs
on Sun, HP and Apollo? We have all of these at BNR + a varied set
of publishing systems in which the only common denominator is
that they use PostScript as the output.

Regards - Albert

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

Date: Tue, 23 Jan 90 13:48:25 PST
From: John Dundas <dundas@sapphire.Jpl.Nasa.Gov>
Subject: Looking for AFM->TFM for OzTeX
Keywords: OzTeX, AFM, TFM

Since I am new to this group and I am sure that this question has been
asked before, I appologize, but I must ask anyway.  Does anyone know
of a public domain (shareware, etc.) program which will create TFM files
for Adobe PostScript fonts (generally from AFM files)
suitable for OzTeX on the Macintosh?  The program does not need to
execute on the Mac, but that would be a bonus.  If there is sufficient
interest/response, I will summarize back to the newsletter.

John Dundas
Jet Propulsion Lab
dundas@sapphire.jpl.nasa.gov

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

Date: Tue, 23 Jan 90 23:08:00 GMT
From: Chris Thompson <CET1%phoenix.cambridge.ac.uk@NSFnet-Relay.AC.UK>
Subject: VF files and DVI-to-DVI converters
Keywords: TeX, dvi files, virtual fonts

Reading, in rapid succession, Don Knuth's specification of VF format
(TeXhax #11-12) and the article by Stephan v. Bechtolsheim in TUGboat
Vol.10 No.3 about DVI-to-DVI converters, I had the following thought.

It would be possible to process a DVI file that contains references to
virtual fonts, and generate another which contains no such references.
Indeed, this can be done simply using the VF files, without even the
need to read the TFM files for the non-virtual fonts referred to.
Roughly, if the currently selected font is virtual, one replaces

  <putchar N>  by  <push> {DVI from the VF file} <pop>
& <setchar N>  by  <push> {DVI ...} <pop> <right by width from VF file>

adjusting the font numbers carefully (reassigning font numbers is a
standard trick in DVI-to-DVI processors). One also needs to check for
the case, which will never arise in practice, in which the DVI from the
VF file uses <w0> (or <x0>, <y0>, <z0>) before w has been set locally.

This isn't quite as good as putting support for VF files in the
DVI-to-device program, because the <right> command above should be
treated as a character escapement, rather than white space, for the
purposes of `DVItype-style pixel rounding'. (The effect is liable to
be that one effectively gets `maxdrift = 0' for material set in the
virtual font.) However, as a stopgap measure until all your favourite
DVI drivers are enhanced to support VF files, such a program might be
extremely useful. When Don says `I fully expect that all people who
have implemented DVI drivers will ... be unable to resist installing a
VF capability into their own software during the first few months of
1990', I fear his tongue must be in serious danger!

Chris Thompson
JANET:    cet1@uk.ac.cam.phx
Internet: cet1%phx.cam.ac.uk@nsfnet-relay.ac.uk

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

Date: Wed, 24 Jan 90 09:56 EET
From: "Saarinen@FINJYU.Earn/bitnet Saarinen@JYLK.JYU.FI" <SAARINEN@JYLK.JYU.FI>
Subject: TeX, automatic line numbering
Keywords: TeX, line numbering

A researcher wishes to have automatic line numbering on 
her output texts. For example, she would be satisfied with 
the output if every fifth output line is numbered (left 
or right margin) like that:

1 blah blah blah .. kukkuu ja kukkuu (in Finnish)
  blah blah xxxx  xxxx x x xx x xxxxx x x x xx xx
  blah blah xxxx xxxx xx x xx xxxx xxxxxx x xxxxx
  blah xxxx kukkuu ja kukkuu ja kukkuu ja  kukkuu 
5 blah blah kukkuu ja kukkuu ja kukkuu ja  kukkuu 
  blah ...

My question is: Is it possible to make a TeX macro to
do this kind of automatic line numbering?

Thanks in advance

Kauko Saarinen
Computing Centre
University of Jyvaskyla (Jyvaskyla, a's with umlauts) 
FINLAND

Bitnet:      Saarinen@finjyu
Internet:    Saarinen@jylk.jyu.fi

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

Date: Wed, 24 Jan 90 04:16:22 EST
From: Allan Adler <ara@lom1.math.yale.edu>
Subject: Help with metafont and dvialw
Keywords: MEATFONT, dvialw

I will not recall here the difficulties I have reported in earlier messages
on this subject. Let me merely begin by reporting what seems like near
success. I have managed, after much experimentation and many helpful
suggestions from people over the network, in getting metafont to produce
tfm files and gf files with any prescribed magnification. All that was
required was to type mode=localfont; mag=7.5; (or some other number instead
of 7.5). In this case, one gets a file with extension .1500gf . 

I also succeeded in getting the tools in mf84/MFware to compile and work,
so I was able to take the gf file and produce a dvi file. If I remember
right, gftodvi wanted to have gray.tfm and logo8.tfm available, but I
was able to produce them using metafont, as described above. In the case
of gray.tfm, it was really grayf.tfm suitably renamed.

I am stuck trying to print out the .dvi file . I was aware that one could
hack the makefile for dvialw by changing FONTPATH and changed it to one
of my own directories. Tonight, I discovered by reading the source code
for dvialw that one can overrule whatever the makefile defines FONTPATH
to be by setting the environment variable TEXFONTS appropriately. So I
can get it to look anywhere for fonts or perhaps I can give it a number
of directories, e.g. /usr/lib/tex/fonts:. 
However, the struggle is not over. For some reason, even though it
knows all the places to look, dvialw claims it is unable to open the
font files. The files it wants to see are:
gray.1500gf (it will probably take a lower number)
logo8.1500gf
cmr8.1500gf (if I remember right)
cmtt10.1500gf (ditto)
I have cmr8.1500pxl and cmtt10.1500pxl in my directory and I produced
gray.1500gf and logo8.1500gf in the manner described above, i.e. I
took the .mf files in /usr/tex/mf84/MFfonts/(gray|logo) and modified
them by adding the stuff about mode=localfont and mag=7.5
But for some reason, dvialw thinks it can't open the font files.

What could possibly make dvialw think it can't open a font file that is
right under its nose even after it has been told where its nose is ?

If anyone has any illuminating comments, I would very much like to hear
them. I feel that I am very close to being able to print out the .dvi
files produced by gftodvi but for 2 cents of useful information.

Allan Adler
ara@lom1.math.yale.edu

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

Date: Wed, 24 Jan 90 11:20 MET
From: "Johannes L. Braams" <JL_Braams%pttrnl.nl@UWAVM.ACS.WASHINGTON.EDU>
Subject: layout.sty, bug repair and reversemarginpars
Keywords: macro, layout.sty


    Hi all,

        I have a file called layout.sty, the only other identification
        is that it claims to be from TUGboat Volume 9 Number 1.
        It is a very handy to tool, but there was a bug and a missing
        feature in it. I herewith send my modified copy of the file,
        I indicated the places where I changed something with %% JB ...
        The bug was a missing backslash in the table which displays the
        values of various parameters. A missing feature was that the
        macro's didn't check the value of the flag \if@reversemargin and
        always put the marginal notes on the `outside' of the text.

    Regards,

        Johannes Braams

PTT Research Neher Laboratorium,        P.O. box 421,
2260 AK Leidschendam,                   The Netherlands.
Phone    : +31 70 3325051               E-mail : JL_Braams@pttrnl.nl
%-----------------------------------------------------------------------------
E-mail was :
    EARN/BITnet : BRAAMS@HLSDNL5   UUCP        : hp4nl!dnlunx!johannes
    SURFnet     : DNLTS::BRAAMS    INTERnet    : BRAAMS%HLSDNL5@CUNYVM.cuny.edu
 PSS (DATAnet1) : +204 1170358::BRAAMS
%------------------------------------------------------------------------------
%------------------------------------------------------------------------------
%
%    layout.sty    (from TUGboat Volume 9 No. 1)
%
% Modified 23-jan-90 by Johannes Braams (JL_Braams@pttrnl.nl)
%                    to check the status of the switch \if@reversemargin
%                    when computing the position of the marginal notes.
%                    Repaired a bug where a `\` was missing.
%
% This file should be called layout.sty and should be placed
% in the TeX_inputs directory.
%
% Define \bs if it is undefined, redefine it if it is already defined
%
\@ifundefined{bs}{\newcommand\bs{\char '134 }}{\renewcommand\bs{\char '134 }}
\@ifundefined{lb}{\newcommand\lb{\char '173 }}{\renewcommand\lb{\char '173 }}
\@ifundefined{rb}{\newcommand\rb{\char '175 }}{\renewcommand\rb{\char '175 }}
\newcount\hofset
\newcount\vofset
\newcount\hofref
\newcount\vofref
\newcount\omargin
\newcount\omarginref
\newcount\emargin
\newcount\emarginref
\newcount\marginref
\newcount\tmargin
\newcount\hheight
\newcount\hsep
\newcount\theight
\newcount\twidth
\newcount\mparsep
\newcount\mparwidth
\newcount\fskip
\newcount\fheight
\newcount\headref
\newcount\bodyref
\newcount\footref
\newcount\margnoteref
\newcount\oneinch
\newcount\topref
\newcount\paperwidth
\newcount\paperheight
%
% Constants
%
\oneinch=72
\paperwidth=600%A4, B4:615
\paperheight=845%A4, B4:795
\topref=\paperheight \advance\topref by -\oneinch
%
% Define calculations macro
%
\def\layout{%
%
%Convert dimensions to scalar values for use in the picture environment
%
\hofset=\hoffset \divide\hofset by 65536
\hofref=\hofset  \advance\hofset by \oneinch
\vofset=\voffset \divide\vofset by 65536
\vofref=\vofset  \vofset=\topref \advance\vofset by -\vofref
%
\tmargin=\topmargin \divide\tmargin by 65536
%
\hheight=\headheight \divide\hheight by 65536
\headref=\topref \advance\headref by -\vofref
\advance\headref by -\tmargin \advance\headref by -\hheight
%
\hsep=\headsep \divide\hsep by 65536
%
\theight=\textheight \divide\theight by 65536
\bodyref=\headref \advance\bodyref by -\hsep \advance\bodyref by -\theight
%
\fskip=\footskip \divide\fskip by 65536
%
\fheight=\footheight \divide\fheight by 65536
\footref=\bodyref \advance\footref by -\fskip
%
\omargin=\oddsidemargin \divide\omargin by 65536
%\omarginref=\omargin
\advance\omarginref by \oneinch
%\advance\omarginref by \hofref
%
\emargin=\evensidemargin \divide\emargin by 65536
%\emarginref=\emargin
\advance\emarginref by \oneinch
%\advance\emarginref by \hofset
%
\twidth=\textwidth \divide\twidth by 65536
%
\mparsep=\marginparsep \divide\mparsep by 65536
%
\mparwidth=\marginparwidth \divide\mparwidth by 65536
%
\if@twoside\ifodd\count\z@
%
% Twosided, odd page
%
   \typeout{Two sided document style, odd page.}
   \if@reversemargin%% JB added
    \margnoteref=\oneinch
      \advance\margnoteref by \hofref \advance\margnoteref by \omargin
    \marginref\margnoteref
      \advance\margnoteref by -\mparsep \advance\margnoteref by -\mparwidth
   \else
    \margnoteref=\oneinch
      \advance\margnoteref by \hofref \advance\margnoteref by \omargin
    \marginref\margnoteref
      \advance\margnoteref by \twidth \advance\margnoteref by \mparsep
%
   \fi
  \else
%
% Twosided, even page
%
   \typeout{Two sided document style, even page.}
   \if@reversemargin%% JB added
    \margnoteref=\oneinch
      \advance\margnoteref by \hofref \advance\margnoteref by \emargin
    \marginref\margnoteref
      \advance\margnoteref by \twidth \advance\margnoteref by \mparsep
   \else
    \margnoteref=\oneinch
      \advance\margnoteref by \hofref \advance\margnoteref by \emargin
    \marginref\margnoteref
      \advance\margnoteref by -\mparsep \advance\margnoteref by -\mparwidth
   \fi
  \fi
\else
%
% Not twosided, do odd page
%
 \typeout{One-sided document style.}
 \if@reversemargin%% JB added
   \margnoteref=\oneinch
     \advance\margnoteref by \hofref \advance\margnoteref by \omargin
   \marginref\margnoteref
     \advance\margnoteref by -\mparwidth \advance\margnoteref by -\mparsep
 \else
   \margnoteref=\oneinch
     \advance\margnoteref by \hofref \advance\margnoteref by \omargin
   \marginref\margnoteref
     \advance\margnoteref by \twidth \advance\margnoteref by \mparsep
 \fi
\fi
Dashed lines represent {\tt \bs hoffset} and {\tt voffset}.

\medskip
%
% Define the picture to be drawn
%
\setlength{\unitlength}{0.5pt}
\begin{picture}(\paperwidth,\paperheight)
\centering
\thicklines
%
% Page box and reference lines
%
\put(0,0){\framebox(\paperwidth,\paperheight){\mbox{}}}
\put(0,\vofset){\dashbox{10}(\paperwidth,0){\mbox{}}}
\put(\hofset,0){\dashbox{10}(0,\paperheight){\mbox{}}}
%
% Header
%
\put(\marginref,\headref){\framebox(\twidth,\hheight){\footnotesize Header}}
%
% Body
%
\put(\marginref,\bodyref){\framebox(\twidth,\theight){Body}}
%
% Footer
%
\put(\marginref,\footref){\framebox(\twidth,\fheight){\footnotesize Footer}}
%
% Marginal notes
%
\put(\margnoteref,\bodyref){\framebox(\mparwidth,\theight)%
{\footnotesize \shortstack{Margin\\Notes}}}
\end{picture}

\medskip
%
% Display the settings used to make the picture.
% Note: fractional points are truncated, i.e. 72.27pt is displayed as 72pt
%
{\tt\begin{tabular}{l@{\hspace{20pt}}l}
\bs hoffset = \number\hofref pt & \bs voffset = \number\vofref pt \\
\bs%
  \if@twoside%
    \ifodd\count\z@ oddsidemargin
    \else evensidemargin
    \fi
  \else oddsidemargin
  \fi
= \number%
  \if@twoside%
    \ifodd\count\z@ \omargin
    \else \emargin%% JB the \ was missing here
    \fi
  \else \omargin
  \fi
pt & \bs topmargin = \number\tmargin pt \\
\bs headheight = \number\hheight pt & \bs headsep = \number\hsep pt \\
\bs textheight = \number\theight pt & \bs textwidth = \number\twidth pt \\
\bs marginparsep = \number\mparsep pt &%
 \bs marginparwidth = \number\mparwidth pt \\
\bs footskip = \number\fskip pt & \bs footheight = \number\fheight pt \\[10pt]
\multicolumn{2}{c}{72pt $\approx$ 1 inch}
\end{tabular}}
} % end of \def\layout

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

Date: Tue, 23 JAN 90 18:33:49 GMT
From: TEX%rmcs.cranfield.ac.uk@NSFnet-Relay.AC.UK
Subject: *** Updated METAFONT, .BUG files available from Aston Archive ***
Keywords: METAFONT, .BUG files

This morning, I picked up some recently revised files from Labrea.Stanford.edu

There was an updated mf.web, correcting the bug which I reported in my Jan 
11th announcement of the port of MF v1.9 to VMS.  There was also a revised
version of mf84.bug, and I took the opportunity to collect the other .bug 
files available at Labrea.

All these files have been placed into the archive at Aston University, as 
follows:

[TEX-ARCHIVE.DIGESTS.UPDATES]CM85.BUG
[TEX-ARCHIVE.DIGESTS.UPDATES]LATEX.BUG
[TEX-ARCHIVE.DIGESTS.UPDATES]MF84.BUG
[TEX-ARCHIVE.DIGESTS.UPDATES]TEX82.BUG
[TEX-ARCHIVE.METAFONT.MFDIR.NEW]MF.WEB

(Older versions of the various .BUG files, of varying antiquity, and scattered 
across different directories [some more than once] in the archive, have been 
deleted.)

I have also created a full listing of the tex tree at Labrea, and this too is 
available from the Aston Archive; listing created 10:45GMT 23rd January:

[TEX-ARCHIVE.DIGESTS.UPDATES]LABREA.LIS

I hope to provide an updated version of this listing at regular intervals.

Since there's only a very minor change between this latest mf.web and the 
previous version (dated, at Aston, 11th Jan 1625GMT), I've also provided a 
change file that can be used, BY VMS USERS ONLY, to produce the latest version 
from that earlier version; just collect:

[TEX-ARCHIVE.METAFONT.MFDIR.NEW]MF.WEB_UPD

and apply EDIT/SUM MF.WEB/UPDATE=MF.WEB_UPD to activate the SUMSLP editor.

I've also revised:

[TEX-ARCHIVE.METAFONT.MFDIR.NEW.VMS]MF.CH

to match the new .WEB file; again, those who have already collected the 
previous edition (dated 11th Jan at 2047GMT) can use:

[TEX-ARCHIVE.METAFONT.MFDIR.NEW.VMS]MF.CH_UPD

to save the nausea of transferring the whole of the new change file.


                               Brian {Hamilton Kelly}

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ JANET:     tex@uk.ac.cranfield.rmcs                                     +
+ BITNET:    tex%uk.ac.cranfield.rmcs@ac.uk                               +
+ INTERNET:  tex%uk.ac.cranfield.rmcs@nsfnet-relay.ac.uk                  +
+ UUCP:      ...!mcvax!rmcs.cranfield.ac.uk!tex                           +
+         OR ...!ukc!rmcs.cranfield.ac.uk!tex                             +
+ Smail:     School of Electrical Engineering & Science, Royal Military   +
+            College of Science, Shrivenham, SWINDON SN6 8LA, U.K.        +
+ Phone:     Swindon (0793) 785252 (UK), +44-793-785252 (International)   +
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

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

%%% 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
**************************
-------