tsfax-0.42 -- 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.42.

It is still a BETA release.  You must have LaTeX 2.09 and xdvi-18
installed.  The package has been tested successfully with Lucid Emacs
19.10 on Linux 1.1 and with XEmacs 19.11 on Linux 1.2 and AIX 4.1. 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 / XEmacs 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.

I 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>" 
%APPEND '<next-file>'

somewhere in the TeX file. You are limited to the file formats that
faxspool recognizes (well, those are quite a few...). 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).

After TeX'ing the file with tex-buffer (C-c C-b) or tex-file (C-c C-f), 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. If some of the append files
are unreadable, you are warned in the Emacs minibuffer.  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.  

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. To use tsfax, it's advantageous to know something about TeX
BTW. ;-)

To preview the page with xdvi, you need to have xdvi-18 or later because
earlier versions cannot handle \special{PSFILE...} macros. (In case of
doubt, consult the xdvi-18+ installation instructions. If you don't have
Display Postscript or NeWS, you need to have xdvi properly configured to
use ghostscript.) If you haven't installed xdvi-18+ and cannot install
it, merge the file tex-send-fax-preview.el into tex-send-fax.el. In this
case you get a function tex-send-fax-preview (C-c C-y) which calls
ghostview to preview the page. If you can afford it, use xdvi-18+ which
gives a much better picture due to its anti-aliasing
algorithm. tex-send-fax-preview.el and the associated stuff will be
thrown out eventually. Recent xdvi versions can be
found on all CTAN ftp sites, such as ftp.dante.de. 

dvilj2 and some other dvi-to-printer converters cannot handle PSFILE
\specials either; this prevents at least me from printing directly to my
Laserjet II compatible.  An 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.30, 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). rfax-0.2 which is the recent version still doesn't support
  faxing multiple files.


INSTALLATION

After customizing several paths in Makefile, tex-send-fax-preview and
tex-send-fax-print, 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 adjust
the tex-dvi-* commands in tex-mode-hook.el and 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 commands 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)