# CERN Accelerating science

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

Next: Questions and Answers from the UCO Up: cnl225.html Previous: Garfield Version 5.36 - Overview of Modifications

## The LaTeX Version on UNIX

Michel Goossens CN/ASD

### Introduction

As announced in CNL 224, the latest version of the TeX suite of programs and the June 1996 Release of LaTeX were installed at the beginning of November and have become the default TeX set-up on all UNIX platforms. The main difference with the previous set-up is that the directory structure is TDS-based and that we follow the GNU convention to store the machine-independent files in the directory /usr/local/share rather than /usr/local/lib. The vast majority of the files comes straight from the teTeX distribution, and we have only added a few CERN-specific extensions, which are described below. It is anticipated that the standard part will be regularly updated, while the CERN extensions will be kept unaltered as far as possible

At present this set-up is available only on UNIX (including Linux). As soon as the same functionality (including an efficient recursive directory searching strategy) becomes available on VMS, Windows 95/NT or Mac, it will be installed immediately.

### Visible Changes with respect to the Previous Version

#### Pure LaTeX2e Behaviour

The latest version of LaTeX2e no longer permits the mixing of the LaTeX 2.09 declaration \documentstyle and the LaTeX2e \usepackage command. You should use the pure LaTeX2e syntax \documentclass.

Note that the REVTeX package (of the American Physical Society) currently works only in the old LaTeX 2.09 mode, so you cannot use LaTeX2e commands with that package and you must use the old syntax \documentstyle[..]{revtex}.

#### LaTeX 2.09 CERN styles no longer available

The only supported CERN classes are those compatible with LaTeX2e. For instance, the style cernlett.sty is no longer available, and is replaced by cernlett.cls. This means that when in the past you wrote: \documentstyle[cernlett]{letter} you now simply specify: \documentclass{cernlett}

The same holds true for the other CERN layouts. Moreover, as explained in CNL 223 there is now a class cernsem which is based on seminar for making slides containing the CERN logo and an easy way to specify author, title, etc. This class is more powerful than cernfoil, and should be preferred to the latter for new applications.

### New "lighter" fonts

Knuth's Computer Modern (CM) fonts have been developed for use on high resolution typesetters and are characterised by quite thin stems (i.e., they seem quite "light" with respect to Times or Helvetica). As Computer Modern fonts are, by default, loaded as bitmap images generated for a particular printer from the Metafont sources, we had previously optimised the bitmaps for the 300 dots-per-inch (dpi) LaserWriters, which were, until recently, the most widely used printer at CERN. However, today, most printers have a resolution of at least 600 dpi, and we have installed fonts which are optimised for the Hewlett Packard LaserJet printers which are now standard at CERN. Nevertheless, as many users at CERN grew accustomed to the lower precision "fat" versions, I have installed on the central systems (CERNSP and HPPLUS) a script fatfonts.sh, which will load the 300 dpi fatter version of the Computer Modern fonts in your document.

As an alternative to using specific bitmapped versions of the Computer Modern fonts, you can load the publicly available PostScript Type 1 renderings developed by our colleague Basil Malyshev of IHEP (Protvino, Russia). These are included in your document by the command:

dvips -Pbkm filename

### Multiple Languages and the babel Package

A whole set of LaTeX formats have been generated where, besides hyphenation patterns for English, also those for a second language are included. The default latex command will run a version of TeX which contains English and German hyphenation patterns. The table below shows the two-letter code you have to prepend to the latex command to gain access to a given language-pair combination.

 ca Catalan cz Czech de German dk Danish es Spanish fi Finnish fr French bg G.B. English hr Croatian hu Hungarian it Italian nl Dutch no Norwegian pl Polish sk Slovak sv Swedish

Thus, the command frlatex will load LaTeX with the French (and English) hyphenation patterns, itlatex with Italian and English, etc. Also, the preamble part of a typical job using these languages should look something like (in the case of French):

\documentclass{article}
\usepackage[francais]{babel}% NOT \usepackage[french]{babel}
...
\begin{document}


#### A Word of Caution for French

As stated above, for French the declaration \usepackage[french]{babel} should not be used, since the french package of Bernard Gaulle is not correctly interfaced to the standard version of Babel (3.5) which we are running at present. This will be fixed in the next release.

### 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 (La)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 scan topdir and all its subdirectories to resolve undefined file references.

### 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. It is enough to deposit a file called .dvipsrc in your home directory. This files 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 your current directory, as is now the default at CERN).

### Handling Encapsulated PostScript Files in LaTeX

Almost every day LaTeX users come to see me because they have problems including 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, like HIGZ, convert or Adobe Illustrator, Coral Draw on Macs and PC's 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.

### Preparing Articles for Springer Verlag

Springer Verlag is a publisher that publishes (amongst many other journals) "Zeitschrift für Physik". However, like the APS with REVTeX, they still use a version of LaTeX style files which work with a non-standard old set-up, so special formats had to be created at CERN to allow users to prepare articles for submission to Springer journals. This procedure is available on both the CERNSP and HPPLUS central systems, and is called springer.sh. It is a shell script with two parameters: the first is the format (cljour2 for Computer Modern fonts and pljour2 for PostScript fonts) and the second is the name of your file. A sample run with a demonstration file for the journal "Zeitschrift für Physik" is shown below. You can try this on the central systems yourself (note that you will have to run the script twice to resolve the cross-references). > springer.sh pljour2 zphysc.dem This is TeX, Version 3.14159 (C version 6.1) (/afs/cern.ch/user/g/goossens/public/zphys/zphysc.dem LaTeX Version 2.09 <25 March 1992> This is pljour2. (zphysc.aux) [59] 390 author names and 36 institutes processed [60] [60] [61] [62] [63] Underfull \vbox (badness 10000) has occurred while \output is active [64] Underfull \vbox (badness 2088) has occurred while \output is active [65] [66] (zphysc.aux) ) (see the transcript file for additional information) Output written on zphysc.dvi (9 pages, 64536 bytes). Transcript written on zphysc.log.

### Documentation

Most of the packages come with documentation written by their respective authors. This is available in the directory tree /usr/local/share/texmf/doc. In particular the subdirectories .../doc/latex/... contain (mostly) compressed dvi files describing the packages in question.

### Submitting Electronic Copies to the Publishers

Many publishers now accept electronic submissions of articles, and promise a faster turnaround if they do not have to (re)type your article themselves. However, some of these publishers just provide a page or two of printed instructions about which layout should be used, and leave it up to the authors to write the necessary LaTeX code to implement their design. As most CERN authors are not TeX gurus, they are usually unable to develop themselves the necessary class file.

As I have stated several time before, it is up to the publishers to provide the tools to submit articles to the journals they manage. It is they who benefit financially and otherwise from electronic submission, so it is only logical that they should invest the effort to develop the necessary support files to implement their house styles. It cannot be considered CERN's task to write such files, since not only would this be an extremely inefficient duplication of effort, but also no resources are available in this area.

Another point to watch is that most publishers allow you to use only vanilla-flavoured LaTeX, possibly augmented with a few of their journal-specific extensions. Just as an example, the REVTeX family of journals comes with the following explicit instructions:

The use of author-created macros is strongly discouraged. The REVTeX macro set is intended to represent completely the tagging needs for a physics manuscript. Non-standard tags will probably disqualify a manuscript file from a compuscript program because most journal compositors cannot translate them cost-efficiently.

The time and effort required to massage compuscript files that do not follow these standard formatting guidelines will eliminate any cost savings and/or time savings in production, and will eliminate any proofreading time savings for the author.

Therefore, authors who use their own custom macros to save keystrokes in preparing their manuscript should remove them before generating the manuscript output for submission.