Go to the previous, next section.

A Simple Style File

Here is a simple example of a style file.

;;; book.el - Special code for book style.

(TeX-add-style-hook "book"
 (function (lambda () (setq LaTeX-largest-level
                            (LaTeX-section-level ("chapter"))))))

This file specifies that the largest kind of section in a LaTeX document using the book document style is chapter. The interesting thing to notice is that the style file defines an (anonymous) function, and adds it to the list of loaded style hooks by calling TeX-add-style-hook.

The first time the user indirectly tries to access some style specific information, such as the largest sectioning command available, the style hooks for all files directly or indirectly read by the current document is executed. The actual files will only be evaluated once, but the hooks will be called for each buffer using the style file.

Function: TeX-add-style-hook style hook

Add hook to the list of functions to run when we use the TeX file style.

Go to the previous, next section.