Using TeX with xtem

by Evelyn Mitchell

One of the first things you notice about TeX or LaTeX is that neither have a good user interface. In order to run either program, you must type in commands at the prompt line. While running, error and status messages are written to your terminal. The process is more like compiling a program than using a word processor. Just as you would compile, link and then test with a C compiler, so in TeX you compile and preview.

Running TeX or LaTeX is only part of what you need to do to create a good-looking document. TeX compiles your source into a dvi file (DeVice Independent), which is conceptually similar to an object file produced from a C source file. In order to view or print a dvi file, you must use a viewer like xdvi or convert the dvi to a PostScript or a Portable BitMap (pbm) file. This is a completely different process than when a word processor is used—there you get to see how your words will look when they are printed as you type and format them. With a word processor, you can usually print without the extra step of converting between print formats.

Writing documents in a way similar to writing programs is not what most writers are familiar with today. The advantage of this style of production cycle is that it is easier for the writer to focus on the task at hand. That is, while writing, you don't have to worry about hyphenation or page breaks. Also, while formatting, you can concentrate on applying a consistent structure to your document without worrying about how that structure will show up on the printed page. Finally, when you are working with how the structure is displayed, you can be more sure that your formatting will be applied consistently throughout the document, than when you are using Words for Windows, for example.

I use a menu interface to TeX/LaTeX and associated programs called xtem that I found on the Internet at the Comprehensive TeX Archive Network (CTAN). CTAN has a WWW page at O'Reilly and Associates (jasper.ora.com/ctan.html), and is the place to go for fonts, filters, style sheets, back issues of the TeX Users Group newsletter, TUGboat and all the other things you may want in order to use TeX more effectively.

Without xtem, I'd still be trying to get all the pieces together. With xtem, I am creating complex documents in just a few hours. It helps me manage all the tasks I need to accomplish to write and format letters, articles and longer documents. For example, I can manage my bibliography database with BibTeX, check spelling with ispell and even check my TeX syntax with texchk.

The name xtem comes from X11-TeX-menu. It is a Tcl/Tk program written by G. Lamprecht, W. Lotz and R. Weibezahn of Bremen University in Germany (weibezahn@lrw.uni-bremen.de). It requires version 7.4 of Tcl and version 4.0 of Tk. The latest version of xtem is version 4, and I'll be describing this version.

xtem provides on-line help for LaTeX syntax. The LaTeX commands are illustrated with sample output, which is handy for things like demonstrating LaTeX commands with sample output for both LaTeX 2.09 and LaTeX2e. The on-line help very useful when I was first learning LaTeX, but finding it was a little confusing for me. The help window is supposed to come up automatically when you open a .tex file to edit or when you select the “help” button with the middle mouse button. I suspect there was some problem with my installation, because I couldn't get the “right mouse button for help on a menu item” to work.

xtem was easy to install. I picked up the file xtem_texmenu.tar.gz off the Internet via ftp from ftp.lrw.uni-bremen.de in the directory /pub/tex/xtem/. The file is about 1.2MB compressed. It decompresses to about 3MB.

I first decompressed it:

$ gunzip xtem_texmenu.tar.gz

Then I checked whether I would have to create a directory for the archive with:

$ tar tf xtem_texmenu.tar

All the files in the archive are under /xtem, so I de-archived them with:

$ tar xf xtem_texmenu.tar

To use xtem, according to the xtem/README file, I needed Unix, Tcl/Tk, XWindows (X11R4 or R5 or R6) and a three button mouse, as well as TeX/LaTeX, an editor and a viewer. You'll also need a spell checker, BibTeX for handling bibliographies, makeindex for creating an index, etc.

Most of these programs, e.g., TeX/LaTeX and Tcl/Tk, were already installed on my system as they come with the Slackware distribution of Linux, so I didn't have to install them. [They come with all major Linux distributions as well—ED] The instructions to install Tcl/Tk, if necessary, are included in the xtem/README file.

xtem comes with an English and a German version, and it is easy to add support for other languages. I installed only the English version. Deleting the German version files in xtem/help_german and xtem/locals_german saved about 1.2MB. It also comes with an HTML page that describes all the included files, and their links.

The README instructions were thorough, and the descriptions of the steps to install xtem were in the order I needed them.

The most complex step, and it wasn't very complex, was modifying the /xtem/locals_english/mkcommand.vst file. I deleted where indicated, and chose the high performance option, (mkcommand.3_tcl7.3) because it will work under Linux and Tk7.3. I discovered that I could choose another option while actually running the program, so I didn't worry about picking the wrong one while doing the installation.

I then had to modify the shell script xtem/xtem to tell it where the programs that it manages are located. To discover where they are on your system use the command:

$ which programname

if you use a C shell, and the command:

$ type -path programname

if you use the bash shell.

For example, the wishx Tk Shell is installed in /usr/bin/wishx on my system, so I changed the wishcall line in the shell script. I also had to add a line to set the environment variable XTEMPATH which contains the directory path where I installed xtem. This will vary depending on your system. On my system the line I added was:

$ XTEMPATH=/tmp/xtem

Then I uncommented the line which set the default language to English:

defaultlanguage="english"

by removing the pound sign (#) at the beginning of the line.

The rest of the xtem configuration options can be set while the program is running, just by selecting any of the menu buttons with the middle mouse button.

Once I had checked to see that it worked, I moved the xtem application to /users/local/bin, and the rest of the xtem directory to /users/local/lib, changing the XTEMPATH when I did so.

About the only thing I don't use xtem for is printing, even though there is a print option available. Once I have formatted a file in Tex/LaTeX, I take a look at it with either xdvi or Ghostview, depending on whether I'm going to be printing it or not. xdvi looks closer to the printed output than Ghostview, but viewing in Ghostview automatically invokes the dvi to PostScript filter, and saves the PostScript file. My printer is connected to a different computer and I use Ghostscript to print, so when everything looks perfect in xdvi, I view the file in Ghostview and print from the .ps file.

xtem is a program that makes it easier for someone new to TeX to manage all of the different programs. It provides a complete on-line help system with formatted examples of the different LaTeX commands. However, xtem is more than training wheels. It has a couple of essential features I use regularly, since they make TeX file management much easier. The first is cleanup, which allowed me to delete all of the .log, .aux and other files created in a TeX session from one window. The second is that xtem tries to catch “conflict” situations. This means it warns me if I'm spell-checking a file I am already using in an open edit session. stem doesn't prevent me from getting into trouble; it just lets me know that I may be making changes that won't be saved.

I recommend xtem because of the detailed help files for LaTeX syntax, and because it makes managing all the different programs I use with LaTeX easy. It is also easy to customize for different installations, even for someone without a lot of Unix experience. Essentially, xtem has made using LaTeX clearer to me.

Evelyn Mitchell (efm@tummy.com) is a partner in tummy.com, ltd., an Omaha, Nebraska-based Linux consulting and development company. See: http://www.tummy.com.

Load Disqus comments

Firstwave Cloud