Part II
Installation and Testing

4  Getting Started
5  Get the Software
     5.1  TeX4ht
     5.2  ImageMagick
     5.3  GhostScript
6  Install the Software
     6.1  Set up TeX4ht
     6.2  Set up ImageMagick
     6.3  Set Up GhostScript
7  Set Up the SWP Support
     7.1  Notes to upgraders
     7.2  Installing the SWP support
     7.3  Installing the TeXConverter
8  Testing TeX4ht/SWP
9  Finishing the Installation

4 Getting Started

Recapitulation of the instructions on my support web page: you should already have done all this.

  1. Obtain the distribution file swp-ht.zip from here
  2. Start a DOS session.
  3. Decide where you want to put the TeX4ht system. This must be in a directory (folder) whose name (path) does not contain spaces: I recommend c:\tex4ht. In what follows I will refer to this top-level TeX4ht folder as <tex4ht>
  4. Create this directory: md <tex4ht> (for example, md c:\tex4ht).
  5. Change to this directory: cd <tex4ht>
  6. Create the directory temp under this: md temp
  7. Unzip the distribution file swp-ht.zip to the temp directory you just created.
  8. SWP 2.5 only: unzip swp25.zip and allow it to over-write any exisitng files.

Now proceed with the rest of the installation.

5 Get the Software

5.1 TeX4ht

Note: the Bug Fixes page of TeX4ht contains a reference to the basic files, in an archive whose name incorporates the issue date (eg tex4ht-20040211.zip). If you get this one, just rename it to tex4ht.zip before running the installation program.

5.2 ImageMagick

You should upgrade your ImageMagick to at least version 6.0; otherwise the GIFs which the system will produce may not be readable by Mozilla-based browsers. To get the latest version of ImageMagick:

5.3 GhostScript

You can continue to use Aladdin GhostScript 5.50 or later if you have already installed it (but since GhostScript is now at version 8, you might want to upgrade). To get the latest version:

6 Install the Software

We now install the components of the TeX4ht system.

6.1 Set up TeX4ht

Copy tex4ht.zip and, if you retrieved them, newt4ht.zip and htf.zip to <tex4ht>/temp

6.2 Set up ImageMagick

ImageMagick’s installation routine offers to install to c:\Program Files. You should not do this: because we will be using IM in batch files, the included space will cause problems. Instead, install to a folder whose name (path) does not contain spaces. One possibility is c:\ImageMagick-win2k; another, if you like the “Program Files” idea, is to create, say “ProgramFiles” or “DOSProgramFiles”without the space, and install there.

6.3 Set Up GhostScript

Run the executable for the distribution, gsmnnw32.exe, which contains a built-in setup routine. You are asked where to install: I recommend that you accept the defaults, which will put the executables in c:\gs\gsm.nn\bin. If you don’t like the default, you can choose another location as long as the path to it does not contain a space . Do not uncheck the box for GhostScript’s fonts: you may need them.

7 Set Up the SWP Support

We now configure and install the SWP-specific support.

7.1 Notes to upgraders

If you are currently using any of the component parts of the TeX4ht/SWP system, you need to be aware that the installation is set up to automatically over-write some files without warning. If you have customized any of the files, you will need to make copies of these files before running the installation.

Very important : as of July 2003, the location of TeX4ht’s LaTeX files has changed: they used to be in \tcitex\tex\latex\tex4ht; following Eitan’s revision, they will now be installed into \tcitex\tex\generic\tex4ht. The installer will automatically and without warning delete the old directory and its files (we do not want to have multiple versions accessible). You may want to copy your current TeX4ht files (ie, the place where the *.4ht files are kept) to the new location before running this installer.

7.2 Installing the SWP support

Before you setup TeX4ht/SWP, you should close all non-essential programs before doing the installation, or you may run out of memory. This appears to be particularly important for Win 95/98/ME setups.

Installing the support is now a 4-step process.

  1. Gather some information. You will need to know two things:

    1. What is your SWP LaTeX format?

      Start SWP and click Typeset -> Expert Settings -> Format Settings. If the box says TrueTeX Multilingual, your format is latex_ml. If it says TrueTeX, your format is latex. If it says something else, you’re on your own (though chances are everything will still work as long as you’re still using TrueTeX).

    2. Where should the batch files go?

      TeX4ht/SWP depends on a series of batch files, which will be created and configured by the installation. Those files need to be found by the operating system, which means that they must be in some directory “in your path”. Many users will already have created a “utility” directory for batch files and programs like this; if not, you should create it now (eg md c:\utility) and see Appendix E for instruction on how to add it to your path before running the tests in section 8. In swpinstall.ini you provide the name of this utility directory in the variable PathDir.

  2. Configure the installation program. Open swpinstall.ini in a text editor like Notepad, and fill in the details.
  3. Run swpinstall.exe

    This checks that you have provided the necessary information and prints a series of messages telling you if it finds the files it’s looking for. When swpinstall is successful, it writes two batch files, top.bat and tinstall.bat. If it isn’t successful, it tells you that too, and tinstall.bat will be a zero-length file, and not usable; in this case, just correct any problematic entries in swpinstall.ini and try again.

    When swpinstall.exe completes successfully, proceed to the final step.

  4. If you’re using WinNT4, Win2k or WinXP, you can run tinstall.bat directly. Otherwise, run top.bat, which sets up a suitable environmen and calls tinstall.bat to do the real work. tinstall pauses at major points, asking you to press any key to continue. There’s not much you can do if something goes wrong (besides aborting, for which you can press Ctrl+C), but at least you can write down any messages on screen, and try to diagnose the problem later. 

    For Win95/98/ME only: If you see a message saying Out of environment space, then either edit top.bat and increase the integer after /e: or else add a line in the [integers] section of swpinstall.ini saying envsize=4096 (or some other large integer), and re-run swpinstall.

7.3 Installing the TeXConverter

Steve Mayer has produced a very nice GUI interface to TeX4ht (as well as some other TeX/LaTeX utilities) called the TeX Converter. Here is a link to his web site. The TeX Converter supports all features of TeX4ht/SWP Version 2. But I recommend that you get the TeX4ht system working as a command-line utility before installing the TeX Converter. See Appendix D for an introduction to the TeXConverter.

8 Testing TeX4ht/SWP

TeX4ht/SWP is now set up and ready to go. The distribution installed a simple document, swphttestA.tex, located in <tex4ht>\test, which you can use to test that the setup is working correctly. This document generates small HTML files each of which contains one glyph-gif — the Greek lower-case phi — produced by glyphgif.bat, and one equation graphic, so you can get a feel for how that works. The equation is the formula for the least-squares estimator in linear regression and should read:

^b = (X'X) -1X'y

To run the tests, start a DOS session and switch to c:\tex4ht\test. We begin with a test in which you explicitly tell the system which batch file to use to do the translation.

The second test uses the htrun utility, which decides on its own which batch file to call.

If you get errors, turn to section 19 for some hints on what you should check and how you can get help. If you think you may need to use the explitic-package approach to TeX4ht, see Appendix C, which describes equivalent tests for that setup.

9 Finishing the Installation

When the tests run without errors, you can return to c:\tex4ht\temp and remove unneeded files. The files there include swpht.html, (and sub-files) and swpht.css (the present document): you may wish to keep this, since later sections contain useful reference material. Otherwise you can delete all this material.