# CERN Accelerating science

This website is no longer maintained. Its content may be obsolete. Please visit http://home.cern/ for current CERN information.

Next: Informatics Training Up: cnl232.html Previous: Software Development Tools Service

## TeX-Related Developments

Michel Goossens IT/ASD

## The CERN LaTeX setup

In CNL 222 the TDS (TeX Directory Structure) for TeX systems was described. One of the first developers to implement this structure was Thomas Esser, whose teTeX distribution was installed at CERN in the autumn of 1996.

Since then, TUG, the International TeX User's Group, together with most other national TeX User Groups, has decided to fully support and sponsor the TeXLive CD-ROM initiative, which is based on TDS and the Web2C 7.2 TeX engine. Therefore, I decided to take advantage of the availability of this CD-ROM to harmonize the TeX distribution at CERN with the latest TeXlive (version 3). This will make further upgrades and updates easier, since we can separate in a straightforward way the common files available on the CD-ROM from CERN-specific ones, thus making maintenance (and export to other sites) very easy.

The change to the new system is foreseen around the 20th of October, to allow some time for testing. Those who have a good knowledge of the TeX system, and have their own machine (you need root privilege to (de)install packages), are invited to copy the new system to their machine using the ASIS procedures as documented in the ASIS Primer. Below I just show the basic steps.

The user should start by typing the command tkwsm, which will show you the following screen:

Push the Configuration button at the top, and this will take you to the next screen:

Start by selecting TeX in the Family window in the left-hand lower corner, then <All> in the Product window at the right of the Family window, check the Ignore button in the Access column, then press the Add button at the bottom. You will see the line

TeX/<All>       InProduction    Ignore     None     None


appear in the top window.

Now that you have deselected the old distribution, you should choose the new one. Therefore, select TeXlive in the Family window, <All> in the Product window, Latest in the State column, then push the Add button. You will see the following line appear in the top window:

TeXlive/<All>   Latest          Default    None     None


You can then proceed to install this new configuration. Please inform me as soon as possible if you find problems with files that worked before on the old system

In principle the same installation can be set up on Windows 95/NT (32 bits), so once we are sure that the system is working reliably we can install it on Nice.

### Handling legacy files

We keep on RSPLUS (only!) a pre-LaTeX2e system alive for those of you with very old files, which they want to run as-is (old theses, reports, etc.). You can try and run the script oldlatex.sh on such files, and if you are lucky (for instance, you only use standard style files and Computer Modern fonts), your file might generate a dvi file that you can print with the latest dvips program.

### Language support

Support for various languages (hyphenation patterns and the Babel system) is compiled into the formats and is available on top of English. The table below shows the command for the main supported languages. (If you need another language, please let me know so that we can see how we can make it available).

 delatex German dklatex Danish eslatex Spanish filatex Finnish frlatex French gblatex G.B. English hulatex Hungarian itlatex Italian nllatex Dutch nolatex Norwegian pllatex Polish ptlatex Portuguese

The default LaTeX format has support for the (American) English, French, and German languages via the babel package. For instance, if you want to use German as your principal language, then you should start your LaTeX job with something like:

\documentclass{article}
\usepackage[german]{babel}
...
\begin{document}


For the moment there is no support for Russian or Greek (both often requested). I am in contact with representatives of these user-communities and I hope to install something useful soon. The problem is not just with LaTeX, but also with the editors and the browsers, which must also be able to deal with Cyrillic and Greek (and other) character sets.

### Searching supplementary Directories

If you, your Experiment, Group, University, etc. have a repository containing supplementary TeX-related files, and you would like LaTeX, dvips, etc., to also automatically search that directory (tree), then you should append a pointer to that directory to the relevant TeX environment variables. For instance, in the case of the TEXINPUTS variable, which controls the search for input files by TeX, you could add the new directory newdir to the end of TeX's search path as follows:

TEXINPUTS=:newdir export TEXINPUTS  # bash, sh, ksh
setenv TEXINPUTS :newdir            # csh, tsh


This will first search the standard directory tree, and only then the specified directory. If you point to the top of a directory tree, and you want the complete hierarchy to be searched, then you should append a double slash to the end of the name, for instance

TEXINPUTS=.:topdir//: export TEXINPUTS  # bash, sh, ksh
setenv TEXINPUTS .:topdir//:            # csh, tsh


In this case TeX will first scan the current directory, then topdir and all its subdirectories, and finally the usual TeX directory tree. Please note that in the first examples we put the colon (:) in front of the path, meaning that we want that TeX first looks in the usual (standard) TeX hierarchy, and only afterwards in the additional directory specified, while in the second examples we appended the colon to the end of the path, meaning that we want TeX to search the new directory tree first, and only afterwards the usual one.

### Customising the dvips Program

The DVI-to-PostScript conversion program dvips, which is used at CERN to take the output of TeX and transform it into (Encapsulated) PostScript, can be easily customised to suit your preferences. By default, the generated Postscript files are written to the local directory, and Computer Modern fonts are included as a Type1 font outlines. If you want to change that, you can deposit a file called .dvipsrc in your home directory. This file specifies runtime options for dvips. For example, a file containing the line:


o | xprint


instructs dvips to pipe the PostScript output it generates directly into xprint (without writing a persistent PostScript output file to the current directory).

### Handling Encapsulated PostScript Files in LaTeX

Almost every day LaTeX users contact me about problems when they want to include PostScript files in their LaTeX documents. And, almost invariably, the problem is due to the fact that they are dealing with PostScript files, which are generated for a printer, and not encapsulated for inclusion inside a document. Most printer drivers on MS Windows, Apple, or UNIX will add all kinds of printer-specific commands into the PostScript file, thus upsetting the encapsulation. In fact, the Adobe standard is quite explicit about this (Appendix H of the PostScript Reference Manual).

Thus, every time you use a graphics tool for generating images that you want to include in a LaTeX (or Word, FrameMaker, PageMaker, etc.) document, make sure that you save it as an Encapsulated PostScript (EPS) file. Many public domain and commercial tools and programs, such as PAW (HIGZ), convert, Adobe Illustrator, Corel Draw can generate EPS files.

If you have a PostScript file and you cannot regenerate it easily as a bona fide EPS file, then you could try to run it through Adobe Distiller. This program will turn your PostScript file into the PDF (Portable Document Format) format, which can be read into Adobe Illustrator, and then saved as an EPS file. This means some work, but the investment in time will allow you to minimize probable problems downstream.

### The Text Companion font for LaTeX

Often one needs to use a non-text character inside a paragraph, and, with LaTeX, such characters are mostly only available in mathematics mode. Therefore, Jörg Knappen decided to group a set of such symbols in the Text Companion Encoding. It contains symbols designed to be used in text, as opposed to mathematical formulas, and some accents designed for uppercase letters. It is currently supported by the tc fonts, which match the T1 encoded ec text fonts. By default, these symbols are not available with LaTeX, therefore you must load the textcomp package to access them. The table below shows the characters and their names.

An example of how you can use these commands follows:

\documentclass{article}
\usepackage{textcomp}
\begin{document}
At LEP the $\mathrm{Z}^0$ mass and width are determined with a
precision of about 0.5\textpertenthousand, or 2-3 MeV. For the width
of the $\mathrm{W}\pm$ bosons, we shall have to settle for a precision
of some 30 MeV, or about .4\textperthousand. Even a basket full of
\texteuro{} will not help us much to improve upon this.
\end{document}