TeX, LaTeX, Metafont, and friends — RCG Handbook

TeX, LaTeX, Metafont, and friends

What are TeX, LaTeX, Metafont, and friends?

TeX is a mathematical typesetting system invented by Donald Knuth in the late 1970’s. Metafont is a font description language and interpreter that Donald Knuth invented along with TeX. LaTeX is a TeX macro package written by Leslie Lamport in the 1980’s, which made TeX easier to use, and which subsequently became the dominant method of using TeX. LaTeX is still the international standard for mathematical and scientific typesetting.

What is TeX Live?

TeX Live is a free software distribution of TeX, LaTeX, Metafont, and their associated programs (amstex, bibtex, dvips, latex, mf, pdflatex, pdftex, tex, xdvi, etc.), as well as various macro packages and fonts. It is actively maintained, and a new distribution usually comes out in the spring of every year. The Research Computing Group makes TeX Live available on most of the Linux computers that it manages.

Where is TeX Live on RCG-Managed Linux Computers?

TeX Live is the default TeX/LaTeX distribution on most Linux platforms, and so you’ll probably find it locally installed, with executables such as latex and pdflatex in /usr/bin. However, the locally installed version has some limitations in that it usually isn’t a full installation, and also it doesn’t have any of the custom SFU classes and fonts.

The Research Computing Group supplies a centrally-maintained and configured installation of TeX Live (TeX Live 2020, at the time of this writing in March, 2021). It is a full installation (currently 8.5 Gigs), including custom SFU classes and fonts. We used to make this available via an NFS mount, but we’ve recently switched to CVMFS for performance reasons. The location of the CVMFS mount is:

/cvmfs/rcg.sfu.ca/sw/texlive/latest

Environment

Most of the linux systems managed by the Research Computing Group are set up with environment modules. By default, these environment modules will adjust your $PATH and other environment variables so that commands such as latex and pdflatex will run the centrally-maintained versions rather than the locally installed versions.

However, some older accounts may still have .mylogin or .mycshrc files that interfere with the environment modules. If you’re not sure, just type:

which pdflatex

The response should be:

/cvmfs/rcg.sfu.ca/sw/texlive/latest/bin/x86_64-linux/pdflatex

Previously, older environments would also set the $TEXMFCNF environment variable. This is no longer needed and, in fact, if this variable is set, it will most probably mess up the functioning of TeX Live. If you’re not sure, just type:

echo $TEXMFCNF

The response should be:

TEXMFCNF: Undefined variable.

If you get any other response, you may need to fix your old .mylogin or .mycshrc file. (Or maybe your .login or .cshrc file.)

Custom SFU Classes and Fonts

Our centrally-maintained installation of TeX Live contains the Bembo and DINPro fonts that are a part of SFU’s “Common Look and Feel”, which is used for various depmartmental letterhead LaTeX classes, such as csletter, enscletter, and statletter. If you want to view the details of one of these classes, you can use the kpsewhich command, as in:

kpsewhich csletter.cls

If your environment is configured properly, kpsewhich will tell you that these classes are located within:

/cvmfs/rcg.sfu.ca/sw/texlive/latest/texmf-local/tex/latex/sfu/

Examples of how to use these LaTeX classes can be found here:

  • /cvmfs/rcg.sfu.ca/sw/texlive/latest/texmf-local/doc/latex/sfu/csletter.tex
  • /cvmfs/rcg.sfu.ca/sw/texlive/latest/texmf-local/doc/latex/sfu/enscletter.tex
  • /cvmfs/rcg.sfu.ca/sw/texlive/latest/texmf-local/doc/latex/sfu/statletter.tex

along with corresponding .pdf files showing what the output of pdflatex looks like.

Our centrally-maintained installation of TeX Live also contains the sfuthesis LaTeX class. Information about this can be found here:

  • /cvmfs/rcg.sfu.ca/sw/texlive/latest/texmf-local/doc/latex/sfu/sfuthesis/

Personal TeX/LaTeX Classes, Fonts, and Include Files

TeX Live will look in two places within your home directory for your personal LaTeX classes, fonts, and include files, namely:

  • ~/.texlive[yyyy]/
  • ~/texmf/

where [yyyy] is the year in which the current version of TeX Live was released. Given that this changes with every version of TeX Live, it is best to use ~/texmf/.

Within your ~/texmf/ directory, you should build a texmf tree of directories with a structure similar to what can be found in:

/cvmfs/rcg.sfu.ca/sw/texlive/latest/texmf-dist/

You only need to create the parts of the tree you use. If you only use LaTeX, then you probably only need to create:

~/texmf/tex/latex/

and then put your personal LaTeX classes and include files in there. Once you have done this, you should run:

mktexlsr ~/texmf

in order to build the ls-R database that kpsewhich uses. And, of course, you need to rebuild ls-R using mktexlsr every time you change the contents.

For more information on where TeX Live looks for all of its bits and pieces, take a look at the master config file:

/cvmfs/rcg.sfu.ca/sw/texlive/latest/texmf-dist/web2c/texmf.cnf

TeX/LaTeX on Non-linux Platforms

TeX Live for Mac comes as a package called MacTeX. You can download it here:

http://tug.org/mactex/mactex-download.html

If you are a Windows user, you probably want MiKTeX. You can download it here:

https://miktex.org/download