Description: Changes to the man page to move it into the correct section 
 and to add Debian specific information about embedding LaTeX into a Tgif
 file.  This patch was created from changes made to the source in 2003.
Origin: Adrian Bridgett <bridgett@debian.org>
Author: Carlo Segre <segre@debian.org>
Last-Update: 2010-09-01

--- a/tgif.man
+++ b/tgif.man
@@ -8,7 +8,7 @@
 .\"
 .\"
 .\"
-.TH tgif n "Version 4.2 Patchlevel 2 and Above" "Tgif"
+.TH tgif 1 "Version 4.2 Patchlevel 2 and Above" "Tgif"
 .\"
 .SH NAME
 .\"
@@ -2815,6 +2815,146 @@
 the EPS file must be present at the same place from which it was
 originally imported.
 .\"
+.SH IMPORTING LATEX
+.\"
+.SS Short Version
+.PP
+You can import a LaTeX equation into a \fBtgif\fP object.
+When you select Instantiate from the Special
+Menu (or press <Cntrl>i), you should see \fBeq4.sym\fP.
+Double-click it
+and \fBtgif\fP will ask you to click on the drawing area to place it.
+After you have placed it, you have instantiated an \fBeq4\fP symbol and
+the instantiation is called an \fBeq4\fP object (or the LaTeX equation
+object).  Now you can go into edit text mode (e.g. press <Cntrl>w)
+and click anywhere inside the \fBeq=\fP attribute (i.e. the text of
+the equation) to edit the equation.
+Return to select mode (e.g. press <meta>k) and double click on the
+\fBeq=\fP attribute to run \fBlatex\fP on it and import the resulting
+EPSI file.
+.PP
+If you have a large equation, you can right-click on the equation
+object, select Edit Attribute in Editor, and select \fBeq=\fP and edit
+the equation in an editor of your choice.  You can use the
+\fBTgif.Editor\fP X default to select your editor, for example:
+.nf
+    Tgif.Editor:     xemacs -title '%s' '%s'
+.fi
+.PP
+To declutter your screen, you may select the \fBeq4\fP object and use
+the shortcut key \fBT\fP to hide the \fBeq=\fP attribute.  Type
+\fBT\fP again to make it visible.
+.PP
+Once you import the EPSI file, you may use the left mouse button to
+drag either the \fBeq=\fP attribute or the imported graphic, and the
+other will follow.  If you hold the control key down, you can drag the
+\fBeq=\fP attribute separately.
+.SS Details
+.PP
+Since version 4.1.16, the
+standard distribution of \fBtgif\fP comes with four LaTeX equation symbol
+files:
+.nf
+    eq4.sym
+    eq4-2x.sym
+    eq4-ps2epsi.sym
+    eq4-epstool.sym
+.fi
+.PP
+The Debian package installs these files in
+\fI/usr/share/tgif/latex\fP, and initializes \fBtgif\fP with one
+domain (number 0) called LaTeX.  When \fBtgif\fP starts, the default
+domain should be domain number 0, and \fBtgif\fP should look for *.sym
+files first in the current directory, then in \fI~/.tgif/latex\fP,
+then in \fI/usr/share/tgif/latex\fP.
+.PP
+In order to use \fBeq4.sym\fP, in addition to \fBlatex\fP and
+\fBdvips\fP, you need:
+.TP
+\fBpstoepsi\fP to convert a \fBPS\fP (PostScript) file generated by
+\fBdvips\fP to an \fBEPSI\fP (encapsulated PostScript file with a
+preview bitmap) file
+.TP
+\fBnetpbm\fP
+used by
+\fBpstoepsi\fP to convert a \fBPBM\fP file to a preview
+bitmap for the final \fBEPSI\fP file
+.TP
+\fBghostscript\fP
+used by
+\fBpstoepsi\fP to render a \fBPS\fP file into a \fBPBM\fP file
+.PP
+Once you have these tools properly installed, you can simply instantiate
+\fBeq4.sym\fP and change the value of the \fBeq=\fP attribute.
+.PP
+Just double-click the equation object and \fBtgif\fP will run the following
+commands:
+.nf
+    latex \fItmpfile\fP
+    dvips -N -n 1 -o \fItmpfile\fP.ps \fItmpfile\fP
+    pstoepsi \fItmpfile\fP.ps \fItmpfile\fP.eps
+.fi
+where \fItmpfile\fP is a temporary file generated by \fBtgif\fP (usually in
+\fI/tmp\fP) and the file name starts with \fBTgif\fP.
+.PP
+This should work if everything is installed properly.  In case it does
+not work, you will get an error messagebox.  Do not close the box.
+Change directory into \fI/tmp\fP and look for the latest file
+that starts with \fBTgif\fP and ends in \fB.tex\fP and copy it.
+Then run the above commands manually to debug the problem.
+For example, you can do:
+.nf
+    cd /tmp
+    ls -lrt Tgif*
+
+    -rw-r--r--   1 william     230 Mar 22 11:27 TgifmTaOdC.tex
+    -rw-r--r--   1 william    4636 Mar 22 11:27 TgifmTaOdC.log
+    -rw-r--r--   1 william     324 Mar 22 11:27 TgifmTaOdC.dvi
+    -rw-r--r--   1 william       8 Mar 22 11:27 TgifmTaOdC.aux
+    -rw-r--r--   1 william   18561 Mar 22 11:27 TgifmTaOdC.ps
+    -rw-r--r--   1 william   18561 Mar 22 11:27 TgifmTaOdC.eps
+.fi
+(Please note that in the above listing, TgifmTaOdC.ps and TgifmTaOdC.eps
+have the same file size, this means that \fBpstoepsi\fP did \fInot\fP
+work.)
+.nf
+    cp TgifmTaOdC.tex foo.tex
+    latex foo
+    dvips -N -n 1 -o foo.ps foo
+    pstoepsi foo.ps foo.eps
+    more foo.eps
+.fi
+At this point, you should see that the first few lines of
+\fIfoo.eps\fP look like:
+.nf
+    %!PS-Adobe-2.0 EPSF-1.2
+    %%BoundingBox: 258 634 354 653
+    %%BeginPreview: 97 20 1 20
+    % 00000000000000000000000e00
+    % ...
+    % 00000000000000000003c00000
+    %%EndImage
+    %%EndPreview
+    ...
+.fi
+These lines are added by \fBpstoepsi\fP.
+The numbers in the \fB%%BoundingBox:\fP and \fB%%BeginPreview:\fP
+depends on your equation and the \fBPS-Adobe\fP and \fBEPSF\fP
+versions in the first line may vary depending on your setup.
+.PP
+If you get errors when you run \fBlatex\fP, \fBdvips\fP, or
+\fBpstoepsi\fP manually, there is something wrong with the setup of
+these tools.  If they all do the right thing but \fBtgif\fP still
+shows errors, please send e-mail to me!
+.PP
+\fIeq4-2x.sym\fP can produce a higher (2x) resolution preview
+bitmap, but you will need the \fIspecial\fP netpbm-20may1999 version of
+\fBnetpbm\fP.  It may not work with
+a newer version of \fBnetpbm\fP.
+\fIeq4-ps2epsi.sym\fP is not recommended.
+\fIeq4-epstool.sym\fP is like \fIeq4.sym\fP but uses
+\fBepstool\fP instead.
+.\"
 .SH ADDITIONAL FONTS
 .\"
 In addition to the Times, Courier, Helvetica, NewCentury, and Symbol fonts,
