Notes on TeX Live setup: Difference between revisions

From STMDocs
Jump to navigation Jump to search
No edit summary

Revision as of 19:44, 21 September 2008

Introduction

This page describes steps to install TeX Live (TL from now) and needed tweaks to use TL data with non-TL binaries. This is useful if we recompile some program from sources and want it to be able to find TL data. For example, one might want to recompile pdftex with some patch, and use it instead of the binary coming with TL.

This guide was written for Ubuntu linux 8.01 and should work with no or little change for Linux/UNIX systems.

Overview of involved steps

  • we download the whole TL iso image to disk, mount it and run the TL install script.
  • after installation, we adjust the configuration so that non-TL binaries can also use TL data, and also to add some additional texmf trees to the existing installation.

, choose the complele installation. Another option is to mount the TL image permanently and choose the installation method to run TL from directly from media, which is faster but doesn't allow package update.

This approach takes some disk space (~2.5GB for TL2008), but has some advantages:

  • installation is quick: all data are available on disk, no need to copy bunch of files from dvd.
  • installation is complete: everything from TL is installed.
  • upgrade is quick: replace the current TL iso image by the new one, and that's it.

Install TL

  • download latest TL iso image to /opt/iso-images (this is my preference, feel free to use any location you prefer)
  • unpack the image:

<geshi lang="bash"> cd /opt/iso-images unlzma texlive2008.iso.lzma </geshi>

  • mount the image:

<geshi lang="bash"> sudo mkdir -p /mnt/texlive2008 sudo mount -t iso9660 -o loop /opt/iso-images/texlive2008.iso /mnt/texlive2008/ </geshi>

  • run the TL installer:

<geshi lang="bash"> sudo perl /mnt/texlive2008/install-tl </geshi>

  • when the menu is up, choose <V> set up for running from DVD by entering v<Enter>
  • in next menu, change the destination of installation to /opt/texlive/2008 by entering:
d<Enter>
1<Enter>
/opt/texlive/2008<Enter>
r<Enter>
  • start the installation process by entering i<Enter>. When the installation process is done, the last messages should like this:

<geshi lang="bash">

...
See 
  /mnt/texlive2008/index.html 
for links to documentation.  The TeX Live web site (http://tug.org/texlive/) 
contains any updates and corrections.
TeX Live is a joint project of the TeX user groups around the world;
please consider supporting it by joining the group best for you. The
list of groups is available on the web at http://tug.org/usergroups.html.
Add /mnt/texlive2008/texmf/doc/man to MANPATH.
Add /mnt/texlive2008/texmf/doc/info to INFOPATH.
Set TEXMFCNF to /opt/texlive/2008/texmf-var/web2c.
Most importantly, add /mnt/texlive2008/bin/i386-linux
to your PATH for current and future sessions.
Welcome to TeX Live!

/mnt/texlive2008/install-tl: done. Logfile: /opt/texlive/2008/install-tl.log </geshi>

  • adjust some environment variables before we can do some testing:

<geshi lang="bash"> PATH=/mnt/texlive2008/bin/i386-linux:$PATH TEXMFSYSVAR=/opt/texlive/2008/texmf-var/ export PATH TEXMFSYSVAR </geshi>

  • test the installation:

<geshi lang="bash"> cd /tmp pdflatex sample2e </geshi>

  • if things go well, we should get the below log:

<geshi lang="bash"> $ pdflatex sample2e This is pdfTeXk, Version 3.1415926-1.40.9 (Web2C 7.5.7)

%&-line parsing enabled.

entering extended mode (/mnt/texlive2008/texmf-dist/tex/latex/base/sample2e.tex LaTeX2e <2005/12/01> Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, noh yphenation, german-x-2008-06-18, ngerman-x-2008-06-18, ancientgreek, ibycus, ar abic, basque, bulgarian, catalan, pinyin, coptic, croatian, czech, danish, dutc h, esperanto, estonian, farsi, finnish, french, galician, german, ngerman, mono greek, greek, hungarian, icelandic, indonesian, interlingua, irish, italian, la tin, mongolian, mongolian2a, bokmal, nynorsk, polish, portuguese, romanian, rus sian, sanskrit, serbian, slovak, slovenian, spanish, swedish, turkish, ukenglis h, ukrainian, uppersorbian, welsh, loaded. (/mnt/texlive2008/texmf-dist/tex/latex/base/article.cls Document Class: article 2005/09/16 v1.4f Standard LaTeX document class (/mnt/texlive2008/texmf-dist/tex/latex/base/size10.clo)) No file sample2e.aux. (/mnt/texlive2008/texmf-dist/tex/latex/base/omscmr.fd) [1{/opt/texlive/2008/tex mf-var/fonts/map/pdftex/updmap/pdftex.map}] [2] [3] (./sample2e.aux) )</mnt/tex live2008/texmf-dist/fonts/type1/bluesky/cm/cmbx12.pfb></mnt/texlive2008/texmf-d ist/fonts/type1/bluesky/cm/cmex10.pfb></mnt/texlive2008/texmf-dist/fonts/type1/ bluesky/cm/cmmi10.pfb></mnt/texlive2008/texmf-dist/fonts/type1/bluesky/cm/cmmi7 .pfb></mnt/texlive2008/texmf-dist/fonts/type1/bluesky/cm/cmr10.pfb></mnt/texliv e2008/texmf-dist/fonts/type1/bluesky/cm/cmr12.pfb></mnt/texlive2008/texmf-dist/ fonts/type1/bluesky/cm/cmr17.pfb></mnt/texlive2008/texmf-dist/fonts/type1/blues ky/cm/cmr6.pfb></mnt/texlive2008/texmf-dist/fonts/type1/bluesky/cm/cmr7.pfb></m nt/texlive2008/texmf-dist/fonts/type1/bluesky/cm/cmr8.pfb></mnt/texlive2008/tex mf-dist/fonts/type1/bluesky/cm/cmsy10.pfb></mnt/texlive2008/texmf-dist/fonts/ty pe1/bluesky/cm/cmsy7.pfb></mnt/texlive2008/texmf-dist/fonts/type1/bluesky/cm/cm ti10.pfb> Output written on sample2e.pdf (3 pages, 69560 bytes). Transcript written on sample2e.log. </geshi>

Post-installation tuning

After the TL installation process, there are still some issues that have to be fixed:

  • after a reboot, some of the settings we did are gone
  • TL binaries might not find locally installed packages; only following packages are searchable:
    • coming with TL,
    • installed to $HOME/texmf,
    • installed to /opt/texlive/texmf-local.
  • if we use a non-TL binary (eg pdftex compiled from sources), then it won't find TL

packages

So we need to do some further tunings to fix those issues.

Make TL settings permanent

  • to mount the TL image permanently, add to /etc/fstab a line saying

<geshi lang="bash"> /opt/iso-images/texlive2008.iso /mnt/texlive2008 iso9660 defaults,ro,loop 0 0 </geshi>

  • change the TL configuration file to be independent of locations of TL binaries (this is needed so that non-TL binaries work with TL data as well):

<geshi lang="bash"> cd /opt/texlive/2008/texmf-var/web2c sudo cp texmf.cnf texmf.cnf.orig sudo sed -i -e 's:.SELFAUTOPARENT:/mnt/texlive2008:' texmf.cnf </geshi>

  • change some environment variables permanently by adding to /etc/profile the following lines:

<geshi lang="bash"> PATH=/mnt/texlive2008/bin/i386-linux:$PATH TEXMFCNF=/opt/texlive/2008/texmf-var/web2c export PATH TEXMFCNF </geshi>

Add another texmf tree

Suppose we have tetex previously installed to /opt/tetex-3.0. The tetex texmf tree is then located at /opt/tetex-3.0/share/texmf. To add this texmf tree to our setup, we do this: <geshi lang="bash"> sudo sed -i ' /^TEXMFLOCAL/ a\ TEXMFTETEX = /opt/tetex-3.0/share/texmf s/^TEXMF = .*TEXMFLOCAL/&,!!$TEXMFTETEX/ s/^SYSTEXMF = .*TEXMFLOCAL/&;$TEXMFTETEX/ ' /opt/texlive/2008/texmf-var/web2c/texmf.cnf </geshi>

Or, another approach is to make a symlink to this texmf tree in /opt/texlive like this: <geshi lang="bash"> sudo ln -s /opt/tetex-3.0/share/texmf /opt/texlive/texmf-tetex sudo sed -i ' /^TEXMFLOCAL/ a\ TEXMFTETEX = /opt/texlive/texmf-tetex s/^TEXMF = .*TEXMFLOCAL/&,!!$TEXMFTETEX/ s/^SYSTEXMF = .*TEXMFLOCAL/&;$TEXMFTETEX/ ' /opt/texlive/2008/texmf-var/web2c/texmf.cnf </geshi>

We can repeat the above steps to add as many texmf trees as we need. For each texmf tree we must:

  • choose a variable name that it's not used yet (TEXMFTETEX in the above example)
  • locate the path to the texmf tree, and (optionally) make a symlink in /opt/texlive
  • adjust the above commands accordingly.

Maintain packages installed locally

If we keep installing local packages to a texmf tree for some time, we will find out that it's getting difficult to keep track of what has been installed, and how to remove or upgrade a package. This is the place where a package management system is useful. We will use miktex tools to maintain our local packages.

(to be continued)