LaTeX

Introduction

On this page you'll find links to documentation, document templates, and some of my own software tools.

My personal document template: template.tex.

If you are going to use LaTeX seriously, it is very useful to have the 'official' manual Leslie Lamport, LATEX: A Document Preparation System . I keep a list of my personal errata of this book.

There is also an internet reference guide.

Having hyperlinks in your reference list

Latex is capable of generating citations and a list of literature references from a bibtex file. With help of a couple of tools, you can add hyperlinks to the references. Hyperlinks are only possible in HTML here. We assume that you are using latex2html to convert a Latex document to HTML. Latex2html has a special style file with commands for including hyperlinks in a document. These are only understood by latex2html, and are ignored when not converting to html.

By augmenting the .bbl file (the file containing the pre-compiled list of references) with hyperlink tags, we get clickable references. I wrote a little tool for doing this: addhyperlinkstobbl.pl. Docs are included in the source. It looks for hyperlink information in the bibtex entries, and adds them to the bbl file. After generating the bbl file with bibtex, and then running addhyperlinkstobbl over it, latex2html generates the proper html code.

The following bibtex attributes designate hyperlinks:

Generating indexes

The procedure is as follows: put a \makeindex in the preamble of your LaTeX document, and a \printindex in the body where you want your index to appear. Now, you can put \index{word} statements in your document in the places where you want the index to point to. Now run latex to generate a .idx file, then run makeindex to generate a .ind file, then run latex again to include the index in your document.

Because it is too cumbersome to put in all the \index{...} statements by hand, I have written a program that does this automatically. You have to specify an [ENTER]-separated list of concepts you wish to appear in the index, and the program will be able to generate a new file with \index statements inserted next to all occurrences of the concepts.

Example usage: list2idx.pl < yourfile.tex > generatedfile.tex.

Including syntax coloured code in a LaTeX document using Vim

Vim supports syntax highlighting for many programming languages; it is easy to add highlighting definitions of your own as well. Vim is also able to convert a syntax highlighted source to HTML, so the colouring as is normally shown on screen is converted to a HTML page using colour tags.

By converting this HTML to LaTeX, it is possible to include highlighted source in a LaTeX document. This is what vimhtml2latex.pl does. Example usage:

Making Slides

My personal slide template, using documentclass slides: slidetemplate.tex

If you like landscape (computer screen shaped) slides, for example for use with a videobeamer, you can use the standard seminar.sty style.

LaTeX and WYSIWYG: the LaTeX assistant

It may be useful to have a preview of your typeset document handy at all times in order to see whether your typesetting or formulas have turned out quite right. This way, you have the advantages of both WYSIWYG and proper control over your typesetting (compare this to the control-character view as used in WordPerfect). The LaTeX assistant helps in this. It is a very small Perl script--it is hardly more than an idea, thanks to the powerful Unix programs already available.

xdvi uses antialiased fonts and can display inline postscript figures (unlike most WYSIWYG editors I know), so xdvi is as WYSIWYG as it can get. It's also faster than most postscript viewers, and automatically rereads the dvi file when its window is refreshed.

However, one would still have to compile one's document(s) and figure(s) by hand to postscript and dvi formats. This is where the LaTeX assistant comes in: it runs in the background, recompiling the dvi/ps files as soon as you save one of your source files. It simply relies on make to check dependencies and recompile.

By putting the dvi viewer and your favourite editor in adjacent windows in your virtual desktop, it is then possible to switch between source and the automatically-updated preview using something as simple as the cursor keys.

The programs
The assistant
sample Makefile