5 Maintenance and other aspects of the TeX Live installation under Windows

5.1 What’s different under Win32 from the standard Web2c?

The Win32 version of Web2c has some specific features that need to be noticed.

Kpathsea
the hash-tables that Kpathsea builds are quite large for the TeX Live. In order to cut down the starting time of any Kpathsea-enabled program, these hash-tables have been put in shared memory. This way, when you chain the execution of several such programs, like tex calling mpost calling tex, the overhead when starting each of the programs but the first will be reduced. This change is hidden to the user, except if you set the debug flag of kpathsea to the -1 value: you will then trace access to the shared memory, which is not what you want (it is accessed very often!). What is useful in a log trace of the shared memory access is still to be defined, so the situation might evolve in the future.
kpsecheck
this command provides some option that did not fit well into kpsewhich. It will allow you to list all the files that occur multiple times across your texmf trees. This could be handy, but most of the time you will also get unwanted output (like dozens of README files)3. For this reason, you can combine the -multiple-occurences with 2 other options for including or excluding any filename that match some pattern (you can request for several patterns).

The kpsecheck command will also report the status of shared memory: in use or not used. That might be useful to know because if the status reported is “in use”, that means one or several processes are working, and the effect of any mktexlsr command will be delayed until the next time where no Kpathsea linked process will be running.

Last, this same command will report about the location it thinks Ghostscript can be found. Under Win32, for many programs, it is easier to use the Ghostscript dll, and find it by using the Ghostscript registry key than to change the PATH, which has a limited length anyway.

Web2c
the engines have a few more options than the ones from regular Web2c, and one option with a different behaviour:

5.2 Adding packages to your installation

You will find an option in the TeXLive menu (or go to Start -> Programs -> TeXLive -> Add TeX package menu) to run again TeXSetup.exe, but in maintenance mode this time. The steps you will go through are almost identical to the ones the first time you run it.

The only different step is about the packages selection page. In maintenance mode, the list of installed packages is compared to the list of packages available from your source directories. Packages that are not installed will be displayed in green, out of date packages will be displayed in red and up to date, installed packages are displayed in black.

This way, you can choose to add or upgrade components, either from your CD-ROM or from the Internet, where you are likely to find some more recent version of your packages.

It is up to you to select which ones of the packages you want to install. The rest of the process is similar to the first installation.

If you want to add files that are not provided by the TeX Live (or fpTeX) distribution, it is recommended to put them in the $TEXMFLOCAL directory. This way, you will be safe against upgrades of the TeX Live software.

The directory pointed to by $TEXMFLOCAL is initially empty. If you want to add there the support file for Maple (symbolic computation program) for example, you will have to put the style files in:
c:\Program Files\TeXLive\texmf-local\tex\latex\maple\
and the documentation files in:
c:\Program Files\TeXLive\texmf-local\doc\latex\maple\

Next, do not forget to rebuild the ls-R databases files, either by using the right menu (Start -> Programs -> TeXLive -> Maintenance), either by manually running the mktexlsr command.

5.3 Removing TeX Live from your hard disk

The uninstall procedure is available either from the TeXLive.exe program, from the TeXLive menu or from the control panel (Start menu -> Control Panel, Add/Remove Programs option). This procedure will cleanup your hard disk of most of the TeX Live files. However, TeX is a system that is creating files and there is no mechanism to keep track of all of them. Moreover, Win32 support packages have their own uninstall procedure, which you will have to run separately (provided you want to get rid of them). Last, the files you may have stored in $TEXMFLOCAL won’t be removed. So, even if the vast majority of files are automatically removed by the uninstall procedure, you will have to do some manual cleanup to actually remove all of them.

5.4 Running TeXSetup.exe from the command line

The TeXSetup.exe program has a number of other interesting options. You can get the list by running:


  c:\>TeXSetup --help

Here is the description:

--automatic-reboot
reboot without waiting user confirmation once installation is over;
--dry-run
do nothing, just log everything that will be done without this option;
--quick
use the recommended installation and default directories, ask nothing up to rebooting;
--net-method (=ie5/direct)
enable to download components with restricted licenses from the Internet (either using direct connection of Internet Explorer 5 DLLs): you need to have an available network connection and some of the packages are huge;
--remote-source-directory <url>
this is the base url for the remote packages;
--local-source-directory <dir>
by default, TeXSetup.exe will guess the root directory of the set of files you want it to act on, if you ever upgrade TeXSetup.exe, you won’t be able to copy the new version onto your CD-ROM, so you will need to use this option to specify the root of the CD-ROM;
--installation-directory <dir>
this is the root of your installation, all files will be copied under this location. The default value is c:\Program Files\TeXLive;
--texmfmain-directory <dir>
--texmflocal-directory <dir>
--texmfextra-directory <dir>
--texmfhome-directory <dir>
--vartexmf-directory <dir>
--vartexfonts-directory <dir>
these are the directories used to configure the location of your files. They map directly to the texmf.cnf variables.
--with-source-files(=yes/no)
copy the source files for TeX packages, default value is no;
--with-documentation-files(=yes/no)
copy documentation files for TeX packages. Default value is yes. Beware: this is only documentation about specific packages, general documentation will be installed anyway;
--program-folder <folder>
the name of the folder under which you will find the menus;
--add-package <pkg>
this is used to add or update a specific package after a first regular installation;
--scheme <pkg>
install the named scheme instead of the default texlive-recommended scheme;
--maintenance
mostly the same as --add-package without specifying a package to add;
--uninstall
this option will remove anything TeX related coming from the CD-ROM, which means there can be files left if you added style files or format files, and also that supplementary tools will not be removed4;
--help
this option opens up a box with the list of options.

5.5 Network installation

Kpathsea knows about UNC names, so you can use them to get your TEXMF tree from the network. But there is better than this. All the support files and configuration files, everything except the files in the bin/win32 are shareable with a teTeX or Unix TeX Live installation. That means you can use Samba either to mount from an NT server to a Unix workstation or the converse. Several strategies are possible:

5.6 Personal Configurations

5.6.1 WinShell

Start this program from the Start menu or from the Desktop shortcut. Go to Options -> Program Calls.

Click OK.

Note that the install process sets all files with the .tex extension to open with WinShell. Unless you plan to use another editor (such as WinEdt or Emacs), this is appropriate.

Unfortunately, WinShell does not have a spell-checking feature. However, if you have installed the tex-extrabin collection, your installation includes Ispell (a spell checking program found on most Unix systems). The executable is in your PATH so ispell.exe will be found if you invoke it from a DOS window. If you installed documentation, look at
C:\Program Files\TeXLive\texmf\doc\html\manpages\ispell.html
for information on Ispell. (Otherwise, you can find ispell.html on the CD.) If you rely on spell checking, you may want to add an Ispell icon to WinShell. See subsection 5.9.4 of this document for how to do that.

For an excellent commercial (but inexpensive) spelling checker, see http://www.microspell.com.

WinShell also has on-line help, which you can access via the ? on the menu bar.

Other information about using WinShell can be found in section 5.9 on p. 50.

5.6.2 Dvips

The configuration file for dvips can be found in
C:\Program Files\TeXLive\texmf-var\dvips\config\config.ps
You may open it with any editor (WinShell will do fine) and change some parameters:

fonts
you can change the default printer METAFONT mode or printer resolution in case dvips needs to generate PK fonts. By default it is configured to use type1 versions of the CM fonts, so it should not call mktexpk too often;
printer
you can tell dvips where you want to print by default. If the ‘o’ option is not followed by a printer name, then a .ps PostScript file is written. You can give dvips a printer name such as:

  o lpt1:
  % o | lpr -S server -P myprinter
  % o \\server\myprinter
paper
Next, you might want to change the paper size from European (A4) to US letter by making the US letter the first paper size mentioned in the file. Scroll to the group of lines beginning with “@”. Move the appropriate lines so that this section begins with the lines:
@ letterSize 8.5in 11in
@ letter 8.5in 11in
@+ %%BeginPaperSize: Letter
@+ letter
@+ %%EndPaperSize

Note: The current TeX Live distribution has implemented (for the first time!) the procedure of making always up-to-date fontmaps files for Dvips and Pdftex. This is done by updmap program during installation, as well as during any font package addition. If you add new packages by hand, edit the file updmap.cfg in $VARTEXMF/web2c.

5.6.3 Pdftex
If you want to use the program pdflatex to convert directly to pdf format, and you are using US letter file, edit the file
C:\Program Files\TeXLive\texmf-var\pdftex\config\pdftex.cfg
and change “page_width” and “page_height” to specify letter-size paper. These entries should read:
page_width 8.5 true in
page_height 11 true in
Save the file and exit the editor.

5.6.4 GSView
Starting from versions compatible with Ghostscript 6.50, GSView is not free anymore, but shareware. So it is not on the CD-ROM anymore.

You may want to change the papersize to US letter size. If so, open GSView from the Start menu.
From the Media menu, select Letter.

Also, there are menu settings that are supposed to give you the most readable screen image:
From Media -> Display Settings, set Text Alpha and Graphics Alpha both to 4 bits.

Note that the installation process has set all .ps and .eps files to automatically open with GSView.

For printing instructions, see section 5.8 below.

5.6.5 WinDvi

The TeXSetup.exe program takes care of associating the files with the .dvi extension with Windvi.

Open it from the Start menu (Programs -> TeXLive -> DVI Viewer). You can set it for US letter paper by going to View -> Options and next to Papertype, selecting US (8.5" x 11"). Click OK. Exit Windvi. You can change other parameters from there, like the ability to execute commands included in path\special{}. Also, the first time you view any .dvi file, you may find the magnification too large. Zoom out until you get an appropriate size.

All the configuration for Windvi is stored in the $HOME/windvi.cnf file. You can find it by running this command at the prompt:


  c:\>kpsewhich --expand-var $HOME/windvi.cnf

Should you have problems with Windvi, please remove the configuration file and test your problem against a vanilla configuration.

5.7 Testing

You can test WinShell by opening the file sample2e.tex, found in C:\Local\TeX\texmf\tex\latex\base. The LaTeX source should appear on the screen. Process it by clicking on the LaTeX icon on the toolbar, then view it by clicking on the Preview (Windvi) icon.

At first, when you preview files with Windvi, it will create fonts because screen fonts were not installed. After a while, you will have created most of the fonts you use, and you will rarely see the font-creation window. Return to WinShell and try dvips, then GSView.

Hint for the future: If a LaTeX run stops because LaTeX cannot find a file, you can press Ctrl-z to quit.

5.8 Printing

It is possible to print from Windvi. In this case, printing will be done using the Windows unified printer driver. By definition, it is compatible with all printers. However, there is some drawback: it can generate some huge spool files, and some (older) versions of Windows just don’t like them. The advantage is that you can use features like embedding BMP or WMF images. You also need to make sure that the printer parameters are correctly set (subsection 5.6.5), else you will get scaled printing (printing at 600dpi on a 300dpi printer will give you only one quadrant of your page).

Printing is faster and more reliable if you run dvips to make a .ps file and then print from GSView. To print from GSView, first select Print... from the File menu. A Print window will appear.

If you will be using a PostScript printer, be sure to select PostScript Printer. In the newer version this is done in the “Print Method” box at the bottom left of the Print window. You can then select any of the printers that you have previously installed on your PC. If you fail to check the box for PostScript Printer, printing will not work.

If you will be using your own non-PostScript printer, select Ghostscript device in the “Print Method” box, then click on the button to the right labelled djet500 and select your printer type from the list that pops up. (In the older version of GSView, make sure PostScript Printer is not selected, then select your printer type from the “Device” list.)

If you use WinShell and a PostScript printer, probably the most convenient way to print is to add an icon to the WinShell toolbar that invokes dvips in a way that sends the output directly to a default printer. For detailed instructions on how to do this, see 5.9.3 on p. 51 (More About WinShell).

5.9 More About WinShell

5.9.1 Installing Bug Fixes

WinShell’s author (Ingo de Boer, thanks to him) sometimes releases beta versions of the next WinShell version which are also bug fixes. You can grab them from http://www.winshell.de. Usually they are .zip files that only require to be unpacked in WinShell directory (c:\Program Files\WinShell by default), either using WinZip or a similar tool, or by using unzip on the command line. If you got some winshellbugfix.zip file and that you saved it in the WinShell directory, then you need to run:


  c:\>cd c:\"Program Files"\WinShell
  c:\>c:\local\bin\unzip winshellbugfix.zip

Say ‘yes’ if you are asked if some files should be overwritten. The unzip.exe programme can be found in the support/gnu-utils package. If you do not have it on your machine, you can use any archiver tool like WinZip to achieve the same effect.

5.9.2 Using the Project Feature
If your document is split into several files (for example a thesis), look into WinShell’s “Project” feature. From the Project menu, you give the project a name (e.g., Thesis), supply the name of the main (or root) file, and then “add” other files. These filenames display on the left of the screen where you can double click the names to view and switch between them. Clicking the LaTeX icon always processes the main file.

Note the icons on the toolbar for toggling the project space (on the left) and the log space (at the bottom). If you are not using the Project feature, you may want to toggle off the space on the left, using the full screen width to display your file.

5.9.3 Printing from WinShell to a PostScript Printer

The Dvips icon on the WinShell toolbar puts the PostScript output in a file, which you can then view with GSView and print from there if you choose. However, it’s convenient to add a WinShell “program call” to dvips which sends the output directly to a designated PostScript printer. The steps below show how to do this for the printer vclw; you should substitute the name of your most frequently-used printer for vclw.

  1. Make the program aware of the printer:

  2. Add Print to the toolbar:

Now, to print a LaTeX document, just click on the Print icon to send to your selected printer. To use a different printer, you will need to click on the Dvips icon to print to a file. Then click on the GSView icon and use GSView to send to any printer you have installed on your PC.

5.9.4 Adding Ispell to WinShell
  1. Add Ispell to User Tools:

  2. Add Ispell to the toolbar:

Now, when you have a LaTeX document open, you can click on Ispell to perform spell checking. Ispell will open another window and display the first misspelled word on the left with the filename on the right. Below that you will see the context in which the misspelling appears; often several suggestions for replacements are also displayed. To replace the word, enter the number corresponding to the desired replacement. Other possible responses are listed below; for example, you can press the space bar to ignore the misspelled word. For more information on Ispell, read the manual page: C:\Program Files\TeXLive\texmf\doc\html\manpages\ispell.html.

Note that when you replace a word, you will not see the correction in your WinShell window until you close the file (click the X in the upper right corner) and then open it again (use the File menu).

5.10 Tips and tricks about the Win32 platform

5.10.1 Different flavors of Win32

What we call Win32 is not an operating system by itself. It is a set of functions – and a large one5 – that you can use to write programs for different operating systems of the Windows family.

Windows comes in different flavors:

Win9x are able to run 32 bits programs and 16 bits programs concurrently. But the operating system by itself is not entirely written in 32 bits mode, and does not support memory protection: 16bits applications can overwrite parts of the operating system memory! Some parts of the system like the GDI (Graphical Device Interface) manage limited resources like bitmaps, fonts, pens and so on for the set of all programs that run concurrently. All the bitmaps headers available at the same time can’t amount for more than 64kb. This explains the performance tool and the fact that you can put your system on his knees by making intensive use of graphic objects for example.

NT, 2K and XP do not suffer from these limitations, and neither from other Win9x limitations. They are true multitasking environments, with protected memory. They are much more responsive than Win9x because of better memory management, better file system and so on.

5.10.2 Command line prompt

You will wonder: “why would I need to use a command line prompt when I have Windows?”.

Good question. The problem is of very general nature. Not all operations can be done easily using only a GUI. Command line gives you programming power – assuming a clever command interpreter.

But the problem here is more fundamental: TeX is a batch tool. Not an interactive one. TeX needs to compute the best layout for each page, resolve cross-references and so on. This can be done only by a global processing of the document. It is not (yet) a task that can be done interactively.

This means that you should use TeX from a command line. In fact the situation is not so bad. There is an advantage to write command line tools for complex processing: they are better debugged, because not tied to GUI problems, and GUI tools can be designed to interface the command line tools. This is the case for TeX where you will interact with it most of the time through a GUI text editor – see section 5.6.1 for example.

However, you may need to use the command line prompt in a number of situations, by example in case of problems and you want to debug your setup – see section 5.11.

Win9x
You will open a command line prompt by looking either for the MS-DOS icon in the “Start->Programs” menu, either by choosing “Start->Run” menu and typing in command.com
NT, 2K, XP
You will open a command line prompt by looking for the “Command Prompt” in the “Start->Accessories” menu6. You can also choose the “Start->Run” menu and type in cmd.exe, which is the name of the brand new command interpreter for NT7.

5.10.3 Path separators

The Win32 API understands both / and \ characters as PATH separators. But the command interpreters do not! So whenever a path name is used programmatically, you can use both separators, and even mix them up in the same path name. But on the command line, you must type \ as path separator. The reason is compatibility: the command processor used the / to introduce arguments to commands.

All this to say: do not be surprised to read path names written using the Unix convention; fpTeX is a port of Web2c, and aims to be compatible across platforms. For this reason, all the configuration files that need to specify path names use the Unix convention.

5.10.4 File systems

The worse feature of Win9x with regard to TeX is probably the so-called FAT file system. TeX uses many many small files, with size around 1kb – 3kb. The FAT file system is old, and predates by far the multi-gigabytes hard disks we have today. It means it can’t manage efficiently the 30000 TeX files found on the CD-ROM. The FAT file system will allocate a minimum of 32kb for any file on a huge partition. It means that TeX will use much more disk space than it actually needs.

The other, more modern, file systems available – namely FAT32 and NTFS – do not have this drawback. They manage clusters of 4kb only8.

5.10.5 How to add some directory to your PATH

There are pairs of variables and values which behave much like global variables inside your programs. The set of those variables is called the environment. Each program is initialized with a copy of the environment when it is run. It can request and change the value of any variable. The changes happen in the copy of the environment, and is not at all propagated to the other running programs.

Your PATH is a special environment variable used to search for programs you want to run. There is a different procedure to change it for Win9x, WinME and NT/2K/XP:

Windows 95/98
Edit your autoexec.bat. In this file should be a line starting with PATH= and followed by a list of directories separated by ;. Please add the directory with the executables in this line. After this, this line could look as follows:

  PATH=c:\windows;c:\windows\system;c:\"Program Files"\TeXLive\bin\win32
Windows ME
You need to run the special program c:\windows\system\msconfig.exe to be able to change any environment variable. From this program, select the ‘Environment’ tab, and then add or modify the variable you want. You will be asked to reboot the machine upon any change.
Windows NT/2K/XP
Click left on Start > Settings > Control Panel. Now the window with the control panel icons opens. Double click on System. The System Properties window opens. Click on the tab Environment or look for a button named ‘Environment Variables’ among the dialog boxes. Now you can change the environment variables for your user account. Note: There are also displayed the environment settings for the system. Normally, you can’t change the system variables unless you have administrator rights on your machine. If you want to change the PATH for all users, you will have to contact your system administrator or be the system administrator yourself–in the later case you should know what you are doing.

If there is already a PATH setting for your user account, left click on PATH. In the field Variable appears PATH while the field Value shows the current setting of PATH as a list of directories separated by ;. Add the directory where the executables are located (e.g. c:\Program Files\TeXLive\bin\win32). If there isn’t a PATH variable for your user account, simply click in the field Variable and type in PATH, click in the field Value and type in the directory with the executables. Important: Click on the Apply button before clicking Ok, otherwise the changes to PATH won’t apply to your system. Be careful when changing the environment settings.

The best way to be sure that a variable has been properly set is to open a console and type:


  set VARIABLE

which should return the corresponding value.

5.10.6 TeX engines

If you have a look at the Web2c documentation, you will read that all the various TeX derived programs use the same base engine. For example, tex.exe and latex.exe are exact copies of the same program, but each one will use a different format file, based on its calling name.

Under Unix, this feature is implemented through symbolic links. It saves up a bit of disk space, because some engines are used with many different format files.

The Win32 API does not know about file links. So to save up almost the same amount of memory, all the TeX base engines have been put in DLLs (Dynamic Linked Library). This means that you will have the following layout:


13/05/2002  17:06                3 584 latex.exe
13/05/2002  17:06              266 240 tex.dll
13/05/2002  17:06                3 584 tex.exe
and the latex.exe file is nothing but a rough copy of tex.exe using the same core tex.dll. The same trick has been used for the mktex*.exe family of programs which are linked to the mktex.dll library.

In fact, a generic tool called lnexe.exe is provided to build the equivalent of Unix hard links for executable files only under Win32.

5.11 In case of problems

5.11.1 What to do if latex does not find your files?

5.11.2 What to do if your setup still does not work as expected?

There are several questions to ask about:

  1. Is tex.exe on my PATH?
  2. Is the TEXMFCNF variable correctly set to c:/Program Files/TeXLive/texmf-var/web2c (default value)?
  3. Are there any errors in the log file generated by the TeXSetup.exe program? Errors are flagged with the sequence Error.
  4. One can also go to http://www.tug.org/tex-live.html and check for any bug fix.
  5. The Windows distribution on the CD-ROM is no more no less than the fpTeX distribution, so you can also go to the Web pages at http://www.fptex.org, or consider subscribing to the fpTeX mailing-list by consulting http://www.tug.org/mailman/listinfo/fptex .

The TeX Live software is complex and made of more than 250 programs and around 40000 files from various sources. It is quite difficult to predict all possible causes for problems. Nevertheless, we will do our best to help you in every case.

5.12 Compiling the source files

You have the whole set of source files, comprised for Windows in the source/source.tar.bz2 archive available on the CD-ROM. To be able to compile the whole distribution for Windows, you will need:

There is a lot of work to do to make this process easier and cleaner.

5.13 Where to get more information?

The Win32 TeX distribution on the CD-ROM is also known as fpTeX. Only the packaging differs, but fpTeX is no more no less than the current TeX Live release for Windows.

The fpTeX home on the Web is at:
http://www.fptex.org/

The current fpTeX release is available from any CTAN site in the directory :
ftp://ctan.tug.org/tex-archive/systems/win32/fptex/.

The main ftp site for fpTeX is ftp://ftp.dante.de/pub/fptex/ from where beta versions of fpTeX and additionnal tools are available. This main site is (partially) mirrored daily by the CTAN backbones in their systems/win32/fptex directory.

The TeX Users Group is kindly hosting a mailing-list dedicated to fpTeX. This is a very low volume one. It is used for announcements, bugs reports or as well to discuss about improvements or various users problems. To subscribe, read the page at http://www.tug.org/mailman/listinfo/fptex. The mailing list address is fptex@tug.org.