[OS X TeX] Standard preamble

Bruno Voisin bvoisin at mac.com
Tue Jul 18 12:07:15 EDT 2006


Le 18 juil. 06 à 17:43, Chris Goedde a écrit :

> On Jul 18, 2006, at 10:26 AM, Alain Schremmer wrote:
>
>> As I am working on the "magnum opus", because my knowledge of  
>> LaTeX is extremely limited, I keep modifying the preamble. But  
>> because the magnum opus is made of more and more files, I am  
>> having an increasingly terrible time keeping all the preambles the  
>> same.
>>
>> Is there a way each file could have a minimum preamble, say with  
>> just a command to use the stuff in a "central" file which would  
>> then be the only file I would modify?
>
> An alternative to the previous suggestions is to put your preamble  
> in a style file (i.e. mypreamble.sty) and then include it via the  
> \usepackage{} command (i.e. \usepackage{mypreamble}). I think that  
> this is much cleaner than using \input or \include. You can stick  
> the style file in a place where TeX will find it (mine is in ~/ 
> Library/texmf/tex/latex) and then you can use it for anything you TeX.

You can even write a custom class mybook.cls say, loading the  
standard book class and adding customizations to it. The procedure  
for doing this is described in clsguide.pdf or clsguide.dvi (try  
"texdoc clsguide" in Terminal).

For example, in ~/Library/texmf/tex/latex/ I have a custom academic  
letter class that loads the letter class then customizes it. The  
class starts with (to simplify):

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{legiletter}[2002/02/15 v5.0 LEGI letter class]
\DeclareOption*{%
   \PassOptionsToClass{\CurrentOption}{letter}%
   \PassOptionsToPackage{\CurrentOption}{graphics,color}}
\ProcessOptions\relax
\LoadClass[a4paper]{letter}
\RequirePackage{ifthen,graphics,color}

Bruno Voisin




------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
          & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/




More information about the MacOSX-TeX mailing list