tsfax-0.2 -- a Lucid Emacs / LaTeX-mode fontend for mgetty+sendfax

Copyright (c) Harald Milz 1995


This is the README for my Emacs TeX-fax-mode called tsfax-0.2.

It is the first ALPHA release.  You must have LaTeX 2.09 and Lucid Emacs
19.10 installed.  I don't know whether the package works with later
versions of LaTeX or with GNU Emacs too (can someone please try it out?).

The package is copyrighted according to the GNU Public License Version
2.0 (or later, whichever applies). Read the file COPYING for details. 


WHAT IS IT, ANYWAY?

tsfax is a Lucid Emacs frontend for Gert Doering's (gert@greenie.muc.de)
mgetty+sendfax package. It makes use of Emacs' tex-mode (latex-mode,
actually) so that you can write nice faxes in LaTeX, using a derivative
of the LaTeX dinbrief.sty style. 

In this version, I made the attempt to rudimentarily support Jeff Uphoff's
(juphoff@nrao.edu) rfax/in.rfaxd package, however, the design phase of
this package is not finished by the time of this writing. You can ftp
both packages from
ftp.leo.org:/pub/comp/networking/communication/modem/mgetty/.


DESIGN

The stuff makes use of a modified version of dinbrief.sty, called fax.sty
(actually, I just omitted some items such as the placement of the
sender's address and placed the date line below the address box.  The
sender's line for the envelope window is missing too because that's not
needed here).

Now if you write such a fax, you can make use of all dinbrief.sty
features (except those listed above).  Plus, you can append arbitrary
pages to your fax (which isn't limited in terms of page numbers). So if
you want to send your friend a short and friendly fax and want to send a
screenshot of your fancy new X11 tool, you simply say

%APPEND "<filename-of-screenshot>" "<next-file>" etc.

somewhere in the TeX file. You are limited to the file formats that
faxspool recognizes. You might want to care for proper file name
extensions because this makes it easier for faxspool to choose the
correct conversion tool. Unfortunately, faxspool still isn't too smart
when it comes to automatic file type recognition. E.g. if you want to
append a file to be interpreted as "plain ASCII", select ".t" or ".txt"
extensions (see faxspool source for more information).

By now you can only use the tex-buffer command (C-c C-b) to TeX your
file. The reason is weird: I don't know how to chop the filename
extension which is appended to tex-print-file which in turn is generated
by tex-file (C-c C-f). :-(

After TeX'ing the file, a small Lisp routine (tex-send-fax, called by
C-c C-x) takes the current TeX buffer and picks some items as the
sender's name (for sendfax's verbose_to), the fax number (recognized by
a line starting with "Fax-Nr.:", preferably in the address paragraph
starting with \begin{letter}) and appendices if applicable (in this
version, the found file names are just appended to the faxspool command
line).  The command line for faxspool is composed and fed into the
inferior tex shell, being shown in the tex-shell window just like when
you do C-c C-b.  Some sanity checks are still missing (are all the files
readable etc.)  but everything else works fine for me. The code for
feeding the inferior shell is probably very unelegant but maybe you can
help me with this.

To get a nice header page easily, I chose not to set it up in LaTeX.
Instead, I use a \special command to transparently underlay an arbitrary
postscript page (for available header and footer space, see
README.headerpage).  Thus, you can generate your favourite header page
with any postscript-capable tool (WinWord, Corel Draw, Photoshop, Quark
Express, xfig, you name it) without fuzzing around with TeX. Thus, the
header page layout is decoupled from fax.sty. Plus, you can choose
different header pages for different addressees. You could even assign
certain header pages to specific addressees automagically if you were
urged to do so...  it's just a matter of the file name in the PSFILE
\special. It's advantageous if you know TeX BTW. ;-)

For this reason, you cannot preview the page with xdvi because xdvi
cannot handle \special{PSFILE...} macros.  Instead, a second routine
(tex-send-fax-preview, C-c C-y) calls an external shellscript to dvips
and ghostview the DVI file. If you use xdvi as the tex-preview-command,
you won't see the underlying header page. For intermediate rapid previews
without the header page, xdvi is fine too.

The same problem prevents at least me from printing directly to my
Laserjet II compatible: dvilj2 cannot handle PSFILE \specials either.  A
second external shellscript is called by tex-send-fax-print (C-c C-n) to
dvips and ghostscript the file.  (If you have a postscript printer and
use dvips to directly print to it from tex-mode with C-c C-p, you can
omit this routine.) I know this is somewhat expensive but maybe someone
knows a better and more elegant way.  Maybe I should use direct
shell-command calls to dvips | ghostview etc.

That's all. It's fairly simple and in proper lack of superfluous features
;-)


TODO

- support rfax/in.rfaxd (by Jeff Uphoff <juphoff@tarsier.cv.nrao.edu>)
  as soon as rfax's command line interface is stable and multi file
  capability is there. As of version 0.2, there is already something put
  in (see tex-send-fax.el) but this is yet untested. Press C-c C-m if
  you want to see what happens (if you have rfax/in.rfaxd installed
  properly). 

- add sanity checks to tex-send-fax-process().


INSTALLATION

After customizing several paths in Makefile, simply call "make install"
with super-user privileges, and the files are copied to their appropriate
directories. A short description and manual is in tex-send-fax.el.  You
should include

(load "/usr/local/etc/mgetty+sendfax/tex-mode-hook")

in your .emacs. That's it. 

gert.tex is a sample tex fax source. You can see the \special command to
underlay the postscript header page, the "Fax-Nr.:" token and the
%APPEND command to append several files. Watch how I included my
handwritten subscript .milz.eps. This one was scanned on a Canon CLC-10
with 200 dpi and exported as EPS with the respective Macintosh scanning
software.  It's that easy... (I didn't include the file here for obvious
reasons, but you get the idea :-)

If you try the code, I'd appreciate hints and bug reports. Let's get it
up and running.

Have fun!  

Harald Milz (hm@seneca.ix.de)