TeTeX 3.0 installation

From ConTeXt wiki

Jump to: navigation, search

This page explains how to get the latest ConTeXt up and running on a Unixy system, using the teTeX 3.0 source distribution.

Contents

[edit] Warning

teTeX is being decommissioned. Its author, Thomas Esser, has declared that v3.0 is the last version he'll be making, and he recommends that people use TeXLive instead. So we recommend switching to your distribution's TeXLive packages if possible, rather than spending a lot of effort on making ConTeXt work with teTeX 3.0. See for example the Debian_installation page.

[edit] De-install any existing teTeX

You have to make sure that any system-supplied tetex's are removed. See the page Linux Installation on how to achieve that using rpm. Non-linux users can probably come up with their own solutions.

This step is very important, because the distribution-supplied packages usually use a different prefix like /usr or </usr/local> instead of /usr/local/teTeX, and, more importantly the distribution-supplied teTeX packages are often retrofitted to behave like teTeX 2.0.2, and that simply will not work.

[edit] Install teTeX 3.0

For this, you need to fetch the two source files from CTAN :

You can simply follow the [QuickInstall] instructions. Don't forget to make sure that the PATH settings remain in effect after reboot (by editing one of your shell's configuration files)!

[edit] Checking

When the installation of teTeX 3.0 is done, texexec --version should report:

 TeXExec 5.2.4 - ConTeXt / PRAGMA ADE 1997-2005
              texexec : TeXExec 5.2.4 - ConTeXt / PRAGMA ADE 1997-2005
              texutil : TeXUtil 9.0.0 - ConTeXt / PRAGMA ADE 1992-2004
                  tex : pdfeTeX, 3.141592-1.21a-2.2 (Web2C 7.5.4)
              context : ver: 2005.01.31
              cont-en : ver: 2005.01.31  fmt: 2005.6.5  mes: english

There are two important other files to test. The command kpsewhich texmf.cnf should report

/usr/local/teTeX/share/texmf/web2c/texmf.cnf

and kpsewhich context.tex should report

/usr/local/teTeX/share/texmf-dist/tex/context/base/context.tex

It is important that both files can be found, and are in this exact location.

[edit] Install a pdfetex update

You probably want to install the latex pdfetex for use with ConTeXt. Luckily, it is quite easy to update the pdftex parts of teTeX.

Pdftex distribution packages come in three types

  • official releases
  • beta releases
  • bleeding-edge snapshots

[edit] Installing an official release

Fetch the 1.40.0 release (tar or zip archive) from [sarovar].

From within the directory where you downloaded the archive file, execute the following series of commands:

 # tar -xvf pdftex-1.40.0.tar.bz2
 # cd pdftex-1.40.0
 # sh ./build.sh

Before runnig build.sh, you may need to edit it, for example changing line 56 to ../src/configure --prefix=/usr \

If the build went OK, then the last four lines of terminal output are the actual binaries and pool files for pdftex and pdfetex. These have to replace their existing counterparts in the teTeX installation.

FreeBSD note: This process fails with the system make. Install gmake (ports/devel/gmake) and change build.sh to have MAKE=gmake.

Note: The next commands assume that `which pdfetex` can actually find the executables from teTeX. If it doesn't work, then your PATH does not include the teTeX binaries directory yet, and you should fix that first. Likewise for `kpsewhich pdfetex.pool`. Make sure, pdftex is symlink to `which pdfetex`

 # cp -f build/texk/web2c/pdfetex `which pdfetex`
 # cp -f build/texk/web2c/pdftex.pool `kpsewhich pdftex.pool`
 # fmtutil-sys --all

[edit] Installing a beta release

This is not needed at the moment, because the official release is the latest

[edit] Installing a snapshot

This is not needed at the moment, because the official release is the latest

[edit] Install a MetaPost update

The included MetaPost in teTeX is a bit outdated. If you want, you can fetch and install the latest MetaPost from sarovar. The current release is 0.993. Just download the source tarball from the [[1]]

From the directory where you downloaded the archive file, execute the following series of commands:

 # tar xjf metapost-0.993.tar.bz2
 # cd metapost-0.993
 # ./build.sh [or ./build.linux]
 # mkdir -p /usr/local/teTeX/share/texmf-local/metapost/base
 # cp texmf/metapost/base/* /usr/local/teTeX/share/texmf-local/metapost/base
 # cd build/texk/web2c
 # cp -f mpost dvitomp mpware/dmp mpware/mpto mpware/newer mpware/makempx \
   /usr/local/teTeX/bin/i686-pc-linux-gnu
 # texhash
 # fmtutil-sys --byfmt mpost

FreeBSD Note: The build fails in texk/web2c/mpware/dmp_ffile.c when it tries to declare sprintf() incorrectly. Add this line to Build to fix things:

 export CFLAGS="-D_POSIX_SOURCE -pipe -O"

Only the _POSIX_SOURCE is required; the other options are niceties.

[edit] Install a Latin Modern font update

The Latin Modern fonts are still in development, so teTeX has a hard time catching up. To get a stable system, you have to manually download the [Latin Modern distribution] from ctan and install the package according to the[instructions in the FAQ].

The ConTeXt-specific support files are included in Cont-tmf.zip, so it is just a matter of installing the actual font files.

[edit] Install the latest ConTeXt

Fetch the current distro from Pragma ADE: [cont-tmf.zip] [mirror1] [mirror2]

[edit] Fix texmf.cnf

Now first you have to fix texmf.cnf as supplied with teTeX:

 # vi /usr/local/teTeX/share/texmf/web2c/texmf.cnf 

You have to add an engine path to the TEXFORMATS line, so that it reads:

 TEXFORMATS = .;$TEXMF/web2c/{$engine,}

While at it, you probably want to set

 shell_escape = t

if it isn't already.

[edit] Cleanup fmtutil

Optionally, you can remove ConTeXt support from teTeX's configuration, because ConTeXt does not use fmtutil.

Using

 # fmtutil-sys --edit

you can comment out the lines for metafun,cont-en, and mptopdf

And you can use

 # cd /usr/local/teTeX/share/texmf-var/web2c && rm -f cont-en.* metafun.* mptopdf.*

to remove the old (fmtutil-generated) formats.

[edit] Install the zip archive

Now you have to execute the following series of commands (I assume you downloaded the archive file to /tmp. If you used another location, you have to change the unzip command):

 # cd /usr/local/teTeX/share/texmf-local/
 # unzip -o /tmp/cont-tmf.zip
 # texexec --make --all

In teTeX 3.0, formats will end up in a local directory only accessible to the user that generated them, so you have to copy the newly generated formats in the global location to make them useful for other people than 'root'.

The last lines of the texexecs output will look like this:

used engineformatpath : /root/.texmf-var/web2c/pdfetex/


           TeX binary : pdfetex
            format(s) : en nl metafun mptopdf


       total run time : 35 seconds

The top line indirectly tells you where the directories are where texexec has stored the local formats that need copying. With the output above, the final two commands to run are:

 # cp -a /root/.texmf-var/web2c/* /usr/local/teTeX/share/texmf-var/web2c
 # texhash

If the engineformatpath does not start with /root/.texmf-var/web2c/, you have to replace the first path with the right one. You do that by removing the pdfetex/ suffix from the 'used engineformatpath'.

[edit] Ruby scripts

The recent version of ConTeXt uses new Ruby scripts instead of the old Perl scripts. So first remove the old script:

 cd /usr/local/teTeX/bin/i686-pc-linux-gnu
 rm texexec

Then, in the same directory, create two scripts:

texmfstart:

 #!/bin/sh
 
 exec ruby `kpsewhich --format=texmfscripts texmfstart.rb` "$@"

texexec:

 #!/bin/sh
 
 SCRIPTNAME=`basename $0`
 
 if [ "$SCRIPTNAME" = "texexec" ]; then
     exec texmfstart texexec.rb "$@"
 else
     exec texmfstart $SCRIPTNAME "$@"
 fi

Then give them execute permissions:

 chmod a+x texmfstart texexec

[edit] Finished!

That should do it! End result is hopefully like this:

 texexec --check
 
 TeXExec | current distribution: web2c
 TeXExec | context source date: 2006.11.29 09:55
 TeXExec | format path: <list of paths>
 TeXExec | start of analysis
 TeXExec | end of analysis
 TeXExec | 
 TeXExec | TeXExec | version 6.2.0 - 1997-2006 - PRAGMA ADE/POD
 TeXExec | TeXUtil   | version 9.1.0 - 1997-2005 - PRAGMA ADE/POD
 TeXExec | CtxTools | version 1.3.3 - 2004/2006 - PRAGMA ADE/POD

If you have enough disk-space, you can try to install TeX-live instead of teTeX.

Personal tools
Toolbox