7 Windows maintenance and post-installation

7.1 What’s different in Windows?

The Windows version of Web2C has some specific features that should be pointed out.

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 subprograms is 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 options 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)2 . For this reason, you can combine the -multiple-occurrences 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 in Unix Web2C, and one option with a different behavior:

7.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 TeXSetup.exe in maintenance mode. The steps are almost the same as in the initial installation.

We’ll discuss differences below, but first, whatever changes you make, do not forget to rebuild the ls-R database files. Otherwise, your new files will not be found. You can do this either via the GUI (Start-->Programs-->TeXLive-->Maintenance-->Rebuild ls-R), or manually running the mktexlsr command.

The main difference is in 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 TeX Live 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 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, for example, you want to add the support file for the Maple symbolic computation program, 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\

7.3 Uninstalling TeX Live

The uninstall procedure is available either from the TeXLive.exe program, from the TeXLive menu or from the control panel (Start-->Control Panel, Add/Remove Programs). 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.

7.4 Running TeXSetup.exe from the command line

The TeXSetup.exe program has a number of other useful 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;
--with-xemtex
selects the XEmTeX bundle;
--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, so you will need to use this option to specify the root of the CD;
--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, which means there can be files left if you added style files or format files, and also that supplementary tools will not be removed. This option is still a bit crude in this release;
--help
this option opens up a box with the list of options.

7.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:

7.6 Personal configurations

7.6.1 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 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 Type 1 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

The current TeX Live distribution implements the procedure of making always up-to-date fontmaps files for Dvips and Pdftex. This is done by the 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.

7.6.2 Pdftex

If you use the program pdflatex to write PDF format directly, and you are using US letter-size paper, edit the file C:\Program Files\TeXLive\texmf-var\pdftex\config\pdftex.cfg and change ‘page_width’ and ‘page_height’. These entries should read:


page_width 8.5 true in
page_height 11 true in
Save the file and exit the editor.

7.6.3 GSView

GSView is now distributed under the Aladdin License, and therefore is no longer included in TeX Live.

If you may want to change the page size to US letter size. If so, open GSView from the Start menu, and select Media-->Letter.

Also, there are menu settings that are supposed to give you the most readable screen image. On Media-->Display Settings, set both Text Alpha and Graphics Alpha 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 7.8 below.

7.6.4 WinDvi

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

Open it with Start-->Programs-->TeXLive-->DVI Viewer.

You can set it for US letter-size paper by going to View-->Options-->Papertype and selecting US (8.5" x 11") (and then OK. Exit windvi.

You can change other parameters from there as well, such as the ability to execute system commands specified by the document (disabled by default for security reasons). 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 configuration settings for Windvi are stored in a file named 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.

7.7 Testing

For generic verification procedures, see section 4.2 on p. 30. This section describes Windows-specific tests.

Open the file sample2e.tex in your editor (Xemacs, WinShell), found in C:\Local\TeX\texmf\tex\latex\base. The LaTeX source should appear on the screen. Process it by clicking on the Command-->LaTeX menu (XEmacs) or LaTeX icon on the toolbar (WinShell), then view it by clicking on the Command-->View DVI menu (XEmacs) or Preview (Windvi) icon (WinShell).

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.

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

7.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 7.6.4), 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. In GSview, select File-->Print. . . . A Print window will appear.

If you are using a PostScript printer, be sure to select PostScript Printer. 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. 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.)

7.9 Tips and tricks for Win32

7.9.1 Different flavors of Win32

What we call Win32 is not an operating system by itself. It is a large set of functions (around 12,000 in the header files of the Microsoft SDK) 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.

7.9.2 Command line prompt

You may 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 they are independent of any GUI problems, and GUI tools can be designed to interface to the command line tools. This is the case for TeX, where you will mostly interact with it through a GUI text editor.

However, you may need to use the command line prompt in a number of situations. One is when you are having difficulties and want to debug your setup.

Win9x
You can open a command line prompt by looking either for the MS-DOS icon in the Start-->Programs menu, or by choosing Start-->Run menu typing in command.com as the progrm name.
NT, 2K, XP
You can open a command line prompt by looking for Command Prompt in the Start-->Accessories menu. You can also choose Start-->Run and type in cmd.exe, which is the name of the brand new command interpreter for NT (thus, it is untrue to call this a DOS box!).

These locations may change across different Windows versions.

7.9.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 ‘/’ 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.

7.9.4 File systems

The worst feature of Win9x with regard to TeX is probably the so-called FAT file system. TeX uses very many small files, with size around 1–3kB. The FAT file system is old, and predates by decades the multi-gigabytes hard disks we have today. As a result, it cannot manage efficiently the tens of thousands of TeX files found in TeX Live. The FAT file system allocates 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, FAT32 and NTFS, do not have this drawback. They manage clusters of 4kB only. (You can lower the limit to 512 bytes on NTFS.)

7.9.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 latter 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.

7.9.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.

7.10 In case of problems

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

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

Here are several questions to investigate:

  1. Is tex.exe in 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? You can find this by searching for the string ‘Error’.
  4. Are there any relevant bug fixes at http://tug.org/texlive/? (Unlikely, but it doesn’t hurt to check.)
  5. Check the web pages at http://www.fptex.org/, or consider subscribing to the fpTeX mailing list, via http://tug.org/mailman/listinfo/fptex.

The TeX Live software consists of hundreds and programs and tens of thousands of files, all from varying sources. So it is quite difficult to predict all possible causes for problems. Nevertheless, we will do our best to help you. (see section 1.2 on p. 8.)

7.11 Compiling the source files

You have the whole set of source files, in the source/source.tar.bz2 archive available in the distribution together with a patch file for Win32. 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.

7.12 Where to get more information

The Windows TeX system included on TeX Live is also known as fpTeX. The packaging differs, but fpTeX is no more no less than the current TeX Live release for Windows.

The fpTeX home page is http://www.fptex.org.

The current fpTeX release is available from any CTAN site in htp://www.ctan.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 all CTAN sites at systems/win32/fptex.

The TeX Users Group is kindly hosting a mailing list dedicated to fpTeX. It is used for announcements, bug reports, enhancement requests, and general discussion about fpTeX. To subscribe, visit http://tug.org/mailman/listinfo/fptex. The mailing list address is fptex@tug.org.