Search:   Help

Navigation

Groups

LyX documentation

Edit

Shared groups

Links

UsingLyXWithTgif

Categories: Category tgif
<< | Page list | >>

Tips for using LyX with Tgif....

Table of contents (hide)

  1.   1.  Description
  2.   2.  Files
  3.   3.  Contributors

1.  Description

Tgif is an interactive drawing tool that allows the user to draw and manipulate objects in the X Window system. It is similar to the xfig program. Tgif can also be used on Windows but you need to install Cygwin.

Like in xfig, you can insert LaTeX equations in images but, unlike xfig, you can see the final result directly in the image being edited. This means that you can have an idea of the space occupied by the equation without the need to postprocess it.

The interesting bit is that tgif allows using LyX for editing equations. By default it uses ps2epsi for generating an encapsulated postscript (eps) file with an embedded bitmap preview used by tgif itself for displaying the final result. Here you find a .sym (symbol) file adapted from the one distributed with tgif that instead uses epstool for embedding a bitmap preview, a couple of Bourne shell scripts, and a C program to be used only with certain versions of epstool.

You can open a file in tgif and double-click on an equation object to launch LyX. Edit the eqaution in LyX, then save the file and close LyX. The scripts should take the lyx file and convert it to an eps with bitmap preview and then import the eps file back into tgfif. This conversion process can take a few seconds in some cases.

2.  Files

Here is a list of the relevant files with some explanation:

  • eq4-lyx-epstool.sym - This is the symbol file to be placed in one of the tgif domains (collection of library symbols). You can use the .Xdefaults file to specify a path where tgif should look for symbol files. Here are some lines you can put in .Xdefaults to this end:
    Tgif.MaxDomains: 1
    Tgif.DomainPath0: LaTeX:.:/home/<your login id>/.tgif/latex:/usr/X11R6/lib/X11/tgif
    Tgif.DefaultDomain: 0
    
The Tgif.DomainPath0 specifies both the name of the domain (the first string before the first ':' symbol) and a list of directories where symbol files are to be searched (the rest of the string after the first ':' symbol) in the same format as the PATH environment variable.
  • tgif-lyx - This a script invoked by the symbol file to edit an equation. It must be in the PATH such that tgif can locate it. In its current form it is suited to Cygwin. You must edit it to adjust the path to the lyx executable and, if you are not using it on Cygwin, you must change the definition of the CYGWIN_ROOT variable as CYGWIN_ROOT="".
  • tgif-epstool - This a script invoked by the symbol file to embed a bitmap preview in an eps file. It must be in the PATH such that tgif can locate it. In its current form it is suited to Cygwin. You must edit it to adjust the path to the epstool executable and, if you are not using it on Cygwin, you must change the definition of the CYGWIN_ROOT variable as CYGWIN_ROOT="".
  • ps2eps.diff - This is a patch to be applied to the ps2eps perl script. You need to apply this patch only if you are using Cygwin.
  • tgif-fixepsi.c - Some epstool versions produce an embedded bitmap which shows on tgif with inverted colors. If your epstool produces inverted colors, you should compile and put in the PATH this small C program. You also need to uncomment the last line in the tgif-epstool script (remove the '#' character at the beginning of the line).

Vista- If you have issues with cygwin and vista, files.zip is a zip with file versions that may work for you. Install cygwin, compile and install tgif, soft link your LyXLauncher.exe file to your path, and copy the needed files above into your path.

Category tgif

3.  Contributors

  • Enrico Forestieri
  • Ed Gatzke
Edit - History - Print - Recent Changes - All Recent Changes - Search
Page last modified on 2008-07-16 11:12 UTC