draft Web2c for WIN32

1 Web2c under WIN32

(Email Fabrice.Popineau@supelec.fr to contact the maintainer of this implementation.)

First of all, many thanks to the following people for their patience and good will:

• Karl Berry, for his work on Web2c, and for accepting my WIN32 patches

• Michael Basler and Michael C. Grant for testing the numerous binary beta releases,

• Sebastian Rahtz, also for intensive tests and for integrating this port into the TEX-live CD,

• Phil Taylor, Bernd Raichle and the NTS team for e-TEX which is included in this release,

• Joachim Schrod and Pehong Chen for makeindex, which I have adapted to kpathsea,

• Han The Thanh for PDFTEX which is also included in this release,

• authors of the numerous tools that I have added to the distribution: makeinfo, ps2pk, t1tools, dtl, dviconcat, dvicopy, dvidvi ...

The description of the WIN32 port of Web2c follows: advocating for Web2c, binary distribution, installation, configuration, troubleshooting and compilation.

1.1 Why using Web2c under WIN32

The author of this port takes on it after leaving Linux for NT. Web2c is the most used TEX distribution in the Unix world. Web2c takes you to a high level of TEXnicity : latest versions of TEX, , , use of the high speed search kpathsea library to name only some features. Web2c is highly configurable and should satisfy the most demanding users. Moreover, its wide use makes it well tested.

Web2c has been already ported to a wide variety of OS apart from Unixes: VMS, MVS, Amiga, OS/2, DOS. WIN32 has everything of a high-tech OS, so there was no reason for Web2c not to be ported to it. It would make life easier for administrators who have UNIX, Windows (and maybe others) TEX distributions to maintain. So, the main goal of the port was compatibility with the reference platforms (Unixes): administration of TeX sites should be similar. For further details on the WIN32 adaptation, take look at Section 5.

1.2 What’s in this port

The the binary distribution is made of the following files:

 Directory of e:\Local\TeX\bin\win32
[.]                 [..]                a5bookle.bat        afm2tfm.exe
bibtex.exe          dmp.exe             doubside.bat        dt2dv.exe
dv2dt.exe           dviconcat.exe       dvicopy.exe         dvidvi.exe
dvihp.exe           dvilj.exe           dvilj2p.exe         dvilj4.exe
dvilj4l.exe         dvips.exe           dviselect.exe       dvitomp.exe
dvitype.exe         einitex.exe         elatex.exe          etex.exe
evirtex.exe         gftodvi.exe         gftopk.exe          gftype.exe
gsftopk.exe         inimf.exe           inimpost.exe        initex.exe

kpathsea.dll        kpsewhich.exe       latex.exe           libpng.dll
mag.exe             makeindex.exe       makempx.exe         MakeTeXls-R.exe
MakeTeXmf.exe       MakeTeX-mkdir.exe   MakeTeXnames.exe    MakeTeXpk.exe
MakeTeXtfm.exe      MakeTeXupdate.exe   mf.exe              mft.exe
mltex.exe           mpost.exe           mpto.exe            MSVCIRT.DLL
msvcrt.dll          msvcrt20.dll        msvcrt40.dll        newer.exe
patgen.exe          pdflatex.exe        pdftex.exe          pfb2pfa.exe
pk2bm.exe           pktogf.exe          pktype.exe          pltotf.exe
pooltype.exe        ps2pk.exe           t1ascii.exe         t1asm.exe
t1binary.exe        t1disasm.exe        tangle.exe          tex.exe
tftopl.exe          tie.exe             ttf2afm.exe         unpost.exe
vftovp.exe          virmf.exe           virmpost.exe        virtex.exe
vptovf.exe          weave.exe           zlib.dll
              83 File(s)      3647731 bytes

There are some DLLs : the ones that begin with msvc are the Microsoft C library targeted for multi-threaded applications and the kpathsea dynamic-linked library. There are also zlib.dll and libpng.dll for pdftex.exe. The Microsoft files may be removed if you already have them in your system directory.

There lacks exactly:

xdvi.exe

from the complete distribution.

I am working on xdvi.exe, which has the highest priority on my todo list now.

You will find eTEX and an adaptation of Makeindex in addition to the standard Web2c distribution.

1.3 Binary distribution

A precompiled distribution should be found on CTAN archives in the following directory:

⟨CTAN:⟩systems/win32/web2c

My ftp site is at the following address ftp://ftp.ese-metz.fr/pub/TeX/win32, but is quite slow.

Get the binary package web2c-7.x.y-win32.tar.gz (x and y being the highest ones), without forgetting to set binary mode. If you do not have Winzip, get also tar.exe and gzip.exe.

Choose a directory ⟨prefix⟩ (e.g.: c:\TeX) and do as follows, assuming that you have downloaded everything in ⟨tmpdir⟩:

cd <prefix>
gzip -dc <tmpdir>/web2c-7.0.x-win32.tar.gz | tar xf -

If you do not have a TDS conformant texmf tree (there is one in teTeX for Unix), get the minimal one in: ⟨CTAN:⟩systems/web2c/texmflib-7.2.tar.gz and unpack it with a similar command

in c:\TeX\share.

All implementation-dependent TEX system files (.pool, .fmt, .base, .mem) are stored by default directly in texmf/web2c. The configuration file texmf.cnf is also stored there. All the binaries are in .../bin/win32 for compatibility with other distributions.

Given a root directory ⟨prefix⟩ (g:\Local\TeX was my compile-time default), we have default locations as follows:

⟨prefix⟩/  installation root (g:/Local/TeX compile-time default)

  bin/win32 executables

man/  man pages
info/  info files

  lib/  libraries (kpathsea.*)

share/  architecture-independent files
texmf/  TDS root
web2c/  implementation-dependent files (.pool, .fmt, texmf.cnf, etc.)

This disposition is almost identical to the standard one for Web2c under Unix.

2 Specific WIN32 Configuration

I didn’t make any configuration program. The only things to configure are:

• add the ...\TeX\bin\win32 directory to your PATH

• if the command kpsewhichcmr10.tfm gives you the location of cmr10.tfm, there are chances that it is finished.

• if you have multiple trees, or for any other reason, set TEXMF to anything relevant (I assume you do not use the standard and single ...\TeX\share\texmf tree), by example you can do:

     set TEXMF=c:/TeX/share/{texmf_fr,texmf}

if you want to use two texmf trees.

• if kpsewhich is not able to locate your favorite files, see the Troubleshooting section.

You can play with all variables in $TEXMF/web2c/texmf.cnf, but only after a careful reading of the kpathsea manual.

The configuration through MakeTeX.site is supported. The following variables may be changed in this file :

 MODE           ljfour
 ps to pk        gsftopk
 ecfontdir      $TEXMF/fonts/source/jknappen/ec
 tcfontdir      $TEXMF/fonts/source/jknappen/tc
 sauterfontdir  $TEXMF/fonts/source/public/sauter

Only MakeTeX.site is supported, and not MakeTeXnames.cnf. Permissions on WIN32 do not have the same meaning as on Unix and I didn’t think on a way to mimic them.

There is a difference between WIN32 MakeTeXpk.exe and the standard one. WIN32 MakeTeXpk will try to put pk files in their right texmf trees if you have more than one. This is guessed by finding where the tfm file needed lies.

Another difference is about MakeTeXls-R. Under WIN32, it accepts 0 or 1 argument. No argument stands for generating ls-R db in all the texmf trees, and 1 argument stands for doing it only in the specified texmf tree.

MakeTeX* programs may have too long filenames for the partition on which they are run. In this case, you can rename any of these .exe files, with the following equivalences:

                         MakeTeXls-R.exe   makelsr.exe
                         MakeTeXMF.exe     makemf.exe
                         MakeTeXmkdir.exe  makemd.exe
                         MakeTeXnames.exe  makename.exe
                         MakeTeXpk.exe     makepk.exe
                         MakeTeXTFM.exe    maketfm.exe
                         MakeTeXupdate     makeupd.exe

If doing this, you need to set:

set DVIPSMAKEPK=makepk.exe

in your environment variables otherwise dvips won’t be able to call the right program to generate pk files.

3 Troubleshooting

What to do if kpsewhich or latex do not find your files?

• kpsewhich is the tool of choice to debug any problem. Unfortunately, kpsewhich outputs debug information to stderr, and the Windows console does not know how to redirect stderr to a file. So you will need to play with the ’pause’ key until someone provides me with a better approach.

• assuming the installation has been done in c:/TeX, check the following values:

      kpsewhich-expand-path$SELFAUTOPARENT  c:/TeX
      kpsewhich-expand-path$TEXMF           c:/TeX/share/texmf

      kpsewhich-expand-path$TEXMFCNF        .;c:/TeX/share/texmf/web2c;
                                            c:/TeX/bin/win32;
                                            c:/TeX/bin;
                                            c:/TeX

      kpsewhich-expand-var$TEXINPUTS        .;c:/TeX/share/texmf/tex//

• if you have other TEX-related values already set in your environment, please, remove them. They are overriding the ones in texmf.cnf.

• check the values from:

      kpsewhichcmr10.tfm  c:/TeX/share/texmf/fonts/tfm/public/cm/cmr10.tfm
      kpsewhichlatex.fmt  c:/TeX/share/texmf/web2c/latex.fmt

• at this point, if everything is correct, tex.exe and co. should work. If it is not the case, you will need to play with the -debug=n option from kpsewhich, and check back all the values. Try to identify and report the problem.

4 Filesystems considerations

WIN32 supports multiple filesystems:

• DOS FAT, 8.3 and uppercase filenames

• Protected mode Fat, long filenames, but case-insensitive

• NTFS, long filenames and case-sensitive

• ISO9660 CDROM, 8.3 and uppercase filenames

Moreover, WIN32 calls which refer to filenames are case-insensitive. There are several other features in NTFS that WIN32 can’t use for the moment. Another dimension is the use of different directory separators: / or \, but WIN32 calls accept both.

So what difficulties may arise ?

Most likely, you will have some style files with long filenames. If you are running on a filesystem which supports them, there is no problem and you have nothing to do. Otherwise, you will need to use the alias feature of kpathsea (See it in the kpathsea manual). Say for example you are trying to install texmf on a FAT partition and you have the style file named longtable.sty in you tree. The filename will be truncated to its 8.3 form : longtabl.sty. In this case, you will need to create a file named aliases along to the ls-R file in you texmf tree. This file should contain the following line:

longtabl.sty longtable.sty

There is an example of aliases file in $TEXMF/aliases. All references to longtable.sty will be redirected to longtabl.sty as long as the long filename is not found.

Otherwise, if you think you have trouble with filenames, consider doing the following:

• pathes in config files and environment variables are preferred written with / rather than \;

• ls-R databases should be in lower case, even if you are running on FAT or CD-ROM;

• use the debug feature of kpathsea and kpsewhich to demonstrate you problem and email me the results of your investigations.

5 How to compile Web2c under WIN32

If you feel adventurous, you can try to get the package web2c-7.0-win32-src.tar.gz and

unzip it. Edit the files texk-7.0/win32/nt.make and texk-7.0/win32/paths.make to set the

hardwired pathes. Then the following incantation should compile and install all the stuff:

cd texk-7.0
nmake -f win32/Makefile.root config.status
nmake all
nmake install

You need VC++4.x and a working copy of cat.exe, tr.exe, sed.exe, flex.exe, bison.exe, touch.exe. And I may have forgotten some (like diff.exe, grep.exe, makeinfo.exe) that are not used in the build itself. See the Makefiles and texk-7.0/win32/*.make files for more information.

Generally speaking, I will not support this stuff at the source level. Unix uses autoconf and has only Makefile.in. I have to tweak these Makefile.in by hand to get them working. And I had to compile a lot of GNU stuff to make this running. I will put up a Web page about GNU tools useful under NT. But not yet. I have xdvi.exe to finish before.