Difference between revisions of "Debian installation"

From Wiki
Jump to navigation Jump to search
Line 115: Line 115:
 
If you have already followed the following steps (because you've already upgraded your context installation relative to the default tetex-provided context), then you're done.  Otherwise, read on for the fiddly bits that need fixing.
 
If you have already followed the following steps (because you've already upgraded your context installation relative to the default tetex-provided context), then you're done.  Otherwise, read on for the fiddly bits that need fixing.
  
=== Steps to finish a first context upgrade ===
+
== Steps to finish a first context upgrade ==
  
 
The Debian tetex-3.0 package (and probably the vanilla tetex-3.0) in combination with <tt>texexec</tt> puts user-generated format files in <tt>~/.texmf-var/web2c/<i>engine</i></tt> where <i>engine</i> is typically <tt>pdfetex</tt>.  (If you don't have such a directory, and you are using the default tetex configuration, tell the mailing list so that this installation information can be corrected!)
 
The Debian tetex-3.0 package (and probably the vanilla tetex-3.0) in combination with <tt>texexec</tt> puts user-generated format files in <tt>~/.texmf-var/web2c/<i>engine</i></tt> where <i>engine</i> is typically <tt>pdfetex</tt>.  (If you don't have such a directory, and you are using the default tetex configuration, tell the mailing list so that this installation information can be corrected!)
Line 121: Line 121:
 
The default <tt>tetex</tt> setup doesn't know about such locations (it doesn't know what it should), and it instead knows about other locations (it knows what it shouldn't).  Here is how to fix both problems.
 
The default <tt>tetex</tt> setup doesn't know about such locations (it doesn't know what it should), and it instead knows about other locations (it knows what it shouldn't).  Here is how to fix both problems.
  
==== Older context formats ====
+
=== Older context formats ===
  
 
There may be older context formats lying around, and the path searching code may find these older ones instead of the new ones lovingy made by <tt>texexec</tt>.
 
There may be older context formats lying around, and the path searching code may find these older ones instead of the new ones lovingy made by <tt>texexec</tt>.
  
===== Deleting the older context formats ===
+
==== Deleting the older context formats ====
  
 
So you need delete the older ones.  But where are they?
 
So you need delete the older ones.  But where are they?
Line 133: Line 133:
 
If you cannot find them, use <tt>kpsewhich cont-en.fmt</tt> (and similarly for the other formats).  Run the <tt>kpsewhich</tt> from a 'typical' directory (e.g. your home directory), rather than from <tt>~/.texmf-var/web2c/pdfetex/</tt> (adjust for your engine), otherwise it will find the newly created formats before any others.  
 
If you cannot find them, use <tt>kpsewhich cont-en.fmt</tt> (and similarly for the other formats).  Run the <tt>kpsewhich</tt> from a 'typical' directory (e.g. your home directory), rather than from <tt>~/.texmf-var/web2c/pdfetex/</tt> (adjust for your engine), otherwise it will find the newly created formats before any others.  
  
===== Stopping fmtutil from making context-related formats =====
+
==== Stopping fmtutil from making context-related formats ====
  
 
But how did the older ones get there?  <tt>fmtutil</tt>
 
But how did the older ones get there?  <tt>fmtutil</tt>
Line 151: Line 151:
 
   update-fmtutil
 
   update-fmtutil
  
==== Finding the new formats ===
+
=== Finding the new formats ===
  
 
The path searching code will not find the newer formats because the code doesn't search subdirectories of <tt>web2c/</tt>.  The simple fix, telling it to search all subdirectories, does not work: Context may use several different engines, e.g. <tt>pdfetex</tt> or <tt>xetex</tt>, each with a set of formats, and you want <tt>texexec</tt> to find the correct set.  If it searches all subdirectories, it will use the first set that it happens to run across, which may not match the engine that you use.  Instead the searches should look in the subdirectory chosen according to the <i>engine</i>.   
 
The path searching code will not find the newer formats because the code doesn't search subdirectories of <tt>web2c/</tt>.  The simple fix, telling it to search all subdirectories, does not work: Context may use several different engines, e.g. <tt>pdfetex</tt> or <tt>xetex</tt>, each with a set of formats, and you want <tt>texexec</tt> to find the correct set.  If it searches all subdirectories, it will use the first set that it happens to run across, which may not match the engine that you use.  Instead the searches should look in the subdirectory chosen according to the <i>engine</i>.   
  
To specify this kind of search, you'd normally edit <tt>texmf.cnf</tt> directly, but Debian uses configlets for it.  So edit the <tt>TEXFORMATS</tt> line in <tt>/etc/texmf/texmf.d/45TeXinputs.cnf</tt> to include this magic:
+
To specify this kind of search, you'd normally edit <tt>texmf.cnf</tt> directly, but Debian uses configlets for it.  So edit (still as root) the <tt>TEXFORMATS</tt> line in <tt>/etc/texmf/texmf.d/45TeXinputs.cnf</tt> to include this magic:
  
 
   TEXFORMATS = .;$TEXMF/web2c/{$engine,}
 
   TEXFORMATS = .;$TEXMF/web2c/{$engine,}
 
    
 
    
It says to look first in the <i>engine</i> subdirectory, then in the <tt>web2c</tt> directory itself.  Now generate a new <tt>texmf.cnf</tt> configuration file with (still as root):
+
It says to look first in the <i>engine</i> subdirectory, then in the <tt>web2c</tt> directory itself.  Now generate a new <tt>texmf.cnf</tt> configuration file (still as root):
  
 
   update-texmf
 
   update-texmf
  
That step generates a new <tt>/etc/texmf/texmf.cnf</tt>, which Debian symlinks from its standard tetex location <tt>/usr/share/texmf/web2c/texmf.cnf</tt>.  With luck, you are done.  In the next section you will check whether everything is working by running <tt>texexec --version</tt>.
+
That step generates a new <tt>/etc/texmf/texmf.cnf</tt>, which Debian symlinks from its standard tetex location <tt>/usr/share/texmf/web2c/texmf.cnf</tt>.  With luck, you are done.  In the next section you will check whether everything is working by running <tt>texexec --version</tt> (as yourself, not as root!).
  
 
== Finished! ==
 
== Finished! ==

Revision as of 20:12, 7 April 2006

Install teTeX 3.0

Lucky Debian users can install official packages from testing or from unstable.

Just do:

 # apt-get install tetex-bin tetex-extra

You may verify it with dpkg -l tetex-bin tetex-extra, it should show something like

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name           Version        Description
+++-==============-==============-============================================
ii  tetex-bin      3.0-14         The teTeX binary files
ii  tetex-extra    3.0-14         Additional library files of teTeX

Install a pdfTeX update

Since the Debian tetex-bin package already contains a pdftex program, this update is optional and ConTeXt should work even if the release of pdftex provided by tetex-bin is a little bit old.

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

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

 # unzip pdftex-1.30.6.zip
 # cd pdftex-1.30.6

Edit the build.sh file and add a valid datadir option:

 ...
 ../src/configure \
             --datadir=/usr/share \
             --without-bibtex8   \
 ...

Then run build.sh:

 # sh ./build.sh

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.

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

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

Install a MetaPost update

Update MetaPost is strongly recommended!

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.901. Just download the source tarball from the [project page]

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

 # tar xjf metapost-0.901.tar.bz2
 # cd metapost-0.901
 # ./Build
 # cp texmf/metapost/base/* /usr/share/texmf-tetex/metapost/base
 # cd build/texk/web2c
 # cp -f mpost dvitomp mpware/dmp mpware/mpto mpware/newer mpware/makempx \
   /usr/bin
 # cp -f mp.pool /usr/share/texmf/web2c
 # texhash
 # fmtutil-sys --byfmt mpost

Install a Latin Modern font update

Under Debian, root as just to ask :

 # apt-get install lmodern pts-tetex-cm-super

The configuration/update is handled by apt-get


On newer versions you do

 # apt-get install lmodern cm-super

Install the latest ConTeXt

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

I would advise installing context in ~/texmf (~ refers to the current user home directory), rather than as the system default for every user on the machine. Once you're happy that it works for you, you could install it system-wide (TODO: need to give those instructions for Debian...).

 mkdir texmf
 cd texmf
 wget http://www.pragma-ade.com/context/current/cont-tmf.zip
 unzip cont-tmf.zip
 texexec --make

If you have already followed the following steps (because you've already upgraded your context installation relative to the default tetex-provided context), then you're done. Otherwise, read on for the fiddly bits that need fixing.

Steps to finish a first context upgrade

The Debian tetex-3.0 package (and probably the vanilla tetex-3.0) in combination with texexec puts user-generated format files in ~/.texmf-var/web2c/engine where engine is typically pdfetex. (If you don't have such a directory, and you are using the default tetex configuration, tell the mailing list so that this installation information can be corrected!)

The default tetex setup doesn't know about such locations (it doesn't know what it should), and it instead knows about other locations (it knows what it shouldn't). Here is how to fix both problems.

Older context formats

There may be older context formats lying around, and the path searching code may find these older ones instead of the new ones lovingy made by texexec.

Deleting the older context formats

So you need delete the older ones. But where are they?

When I ran texexec, it made cont-en.fmt, cont-nl.fmt, and mptopdf.fmt in ~/.texmf-var/web2c/pdfetex/ and they were shadowed by the older versions: ~/.texmf-var/web2c/cont-en.fmt, etc. So I deleted the older ones.

If you cannot find them, use kpsewhich cont-en.fmt (and similarly for the other formats). Run the kpsewhich from a 'typical' directory (e.g. your home directory), rather than from ~/.texmf-var/web2c/pdfetex/ (adjust for your engine), otherwise it will find the newly created formats before any others.

Stopping fmtutil from making context-related formats

But how did the older ones get there? fmtutil

And will it happen again? Yes, though perhaps rarely (the most frustrating kind of bug). At the next upgrade of tetex, which happens frequenty on Debian, the installation scripts will rerun fmtutil as root. That probably won't cause you trouble because the formats generated will go in a system-wide format directory (e.g. in /var/lib/texmf/web2c/), and your new ones will override them once you finish these steps.

However, if you, as an ordinary user, run texconfig, say to change your own default paper size from letter to a4, then tetex will regenerate all formats for you and put them in your format location ~/.texmf-var/web2c/ (without using the engine subdirectory). And you're in the soup again.

So stop fmtutil from making any context-related formats, and let texexec handle it. On standard tetex setups, you'd edit fmtutil.cnf (probaby in /var/lib/texmf/web2c/), but on Debian systems, that file is autogenerated from configlets (tiny pieces of a config file) living in /etc/texmf/fmt.d/.

As root:

 emacs -nw /etc/texmf/fmt.d/01tetex.cnf

(or choose your favorite editor). Comment out (with a #!) the lines for mptopdf, metafun, cont-en, and any other cont-* formats not already commented out. Now generate a new system-wide configuration file:

 update-fmtutil

Finding the new formats

The path searching code will not find the newer formats because the code doesn't search subdirectories of web2c/. The simple fix, telling it to search all subdirectories, does not work: Context may use several different engines, e.g. pdfetex or xetex, each with a set of formats, and you want texexec to find the correct set. If it searches all subdirectories, it will use the first set that it happens to run across, which may not match the engine that you use. Instead the searches should look in the subdirectory chosen according to the engine.

To specify this kind of search, you'd normally edit texmf.cnf directly, but Debian uses configlets for it. So edit (still as root) the TEXFORMATS line in /etc/texmf/texmf.d/45TeXinputs.cnf to include this magic:

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

It says to look first in the engine subdirectory, then in the web2c directory itself. Now generate a new texmf.cnf configuration file (still as root):

 update-texmf

That step generates a new /etc/texmf/texmf.cnf, which Debian symlinks from its standard tetex location /usr/share/texmf/web2c/texmf.cnf. With luck, you are done. In the next section you will check whether everything is working by running texexec --version (as yourself, not as root!).

Finished!

That should do it! The output of texexec --version is hopefully like this:

TeXExec 5.4.3 - ConTeXt / PRAGMA ADE 1997-2005
              texexec : TeXExec 5.4.3 - ConTeXt / PRAGMA ADE 1997-2005
              texutil : TeXUtil 9.0.0 - ConTeXt / PRAGMA ADE 1992-2004
                  tex : pdfeTeXk, 3.141592-1.30.4-2.2 (Web2C 7.5.5)
              context : ver: 2005.10.27
              cont-en : ver: 2005.10.27  fmt: 2005.11.1  mes: english

See also the Debian TeXlive install page.