TeX Live

From TeX on Mac OS X wiki

Jump to: navigation, search

Contents

Installing

  • If you install TeX Live (MacTeX) to Mac first time it creates directory
/usr/local/texlive/

with two subdirectories

/usr/local/texlive/2009/
/usr/local/texlive/texmf-local

and installs all its staff into /usr/local/texlive/2009/ and creates few subdirectories in /usr/local/texlive/texmf-local/ but puts no files there

  • If you install TeX Live (MacTeX) to Mac where there already is an earlier version of TeX Live (say 2007) then it only adds /usr/local/texlive/2009/ to /usr/local/texlive/ without touching /usr/local/texlive/2007/ and /usr/local/texlive/texmf-local/ (so you would have two installations):
/usr/local/texlive/2007/
/usr/local/texlive/2008/
/usr/local/texlive/2009/
/usr/local/texlive/texmf-local

Later you may delete /usr/local/texlive/2007/ and/or /usr/local/texlive/2008/

  • If you reinstall TeX Live (MacTeX) to Mac where there already is TeX Live 2009 install, then it completely replaces the content of /usr/local/texlive/2009/ but does not touch other subdirectories of /usr/local/texlive/texmf-local

Binaries

  • In particular, binaries are installed into
/usr/local/texlive/2009/bin/universal-darwin/
  • Directory
 
/usr/texbin 

is an actually alias (symbolic link) to the "real" directory. If you have also TeX Live 2008 installed and want to use it systematically instead of TeX Live 2009, you type in terminal

 % cd /usr/
 % sudo rm texbin
 % sudo ln -s /usr/local/texlive/2008/bin/universal-darwin/ texbin

TDS

TDS (Tex Directory Structure)

  • Packages, documentclasses, fonts are installed in TDS tree with a root at
/usr/local/texlive/2009/texmf-dist
    • So files of LaTeX package foo will go to
/usr/local/texlive/2009/texmf-dist/tex/latex/foo/

but its documentation will go to

/usr/local/texlive/2009/texmf-dist/doc/latex/foo/

and there are places for fonts, sources, scripts, etc.

(some software (f.e. asymptote) installs LaTeX packages. Authors must avoid installing them into /usr/local/texlive/2009/texmf-dist).

However you can browse this either through terminal command ls or just open it

% open /usr/local/texlive

Adding extra packages

To add extra packages which are not the part of TeXLive you have three options


Local installation

/usr/local/texlive/texmf-local/

is its root. It is owned by root (so one needs to use sudo to change it. This directory and some subdirectories are created by MacTeX installer but not populated. Installing packages and fonts there makes them available for everyone.

 
% cd /usr/local/texlive/texmf-local

and put LaTeX .sty and .def files into directories created in

/usr/local/texlive/texmf-local/tex/latex

while document files for them into corresponding directories in

/usr/local/texlive/texmf-local/doc/latex

(but you need to understand what you are doing, read instructions, especially if distribution is not in tds form). Finally run

% sudo texhash

(actually texhash is an alias to mktexlsr)

    • If you can get package foo from CTAN in tds form - usually from

ftp://ctan.org/pub/tex-archive/install/macros/latex/contrib

just move foo.tds.zip into /usr/local/texlive/texmf-local/ and unzip there

User installation

  • As an ordinary user for yourself: (Exactly as a root but into your personal TDS; again you need partially reconstruct it) into
~/Library/texmf

Here ~ is a UNIX notation for your home directory (and ~someone is for home directory for user someone.

  • a symbolic link
~/texmf -> ~/Library/texmf

(some general Unix software compiled for MacOSX may want it):

% cd 
% ln -s ~/Library/texmf texmf

You do not need to run texhash.

  • Example: customizing how texdoc works for yourself:

Create a directory ~/Library/texmf/texdoc and a file texdoc.cnf in it. Edit this file to put your personal settings in. You may want to look at /usr/local/texlive/2009/texmf/texdoc/texdoc.cnf for inspiration (it should be pretty self-explanatory).

Custom TDS

One can add extra TDSs either by editing /usr/local/texlive/2009/texmf/web2c/texmf.cnf or by adding and editing ~/Library/texmf/web2c/texmf.cnf but one should be very careful. Do not do it unless you have a really good reason!

Personal tools