Node: User preamble, Previous: Default preamble, Up: LaTeX preamble



7.2.2 User preamble

You tell PP3 where your own preamble is with the filename parameter `latex_preamble' in the input script, for example:

     filename latex_preamble mypreamble.tex

The file mypreamble.tex contains your LaTeX preamble macros and must reside in the current directory, or in another directory where TeX looks for its files.

The following is the contents of the file wiki.tex of the PP3 distribution. It is the original user LaTeX preamble that was used for the Wikipedia Project, see Successful use of PP3.

     01   \usepackage{amsmath}
     02   \usepackage[T1]{fontenc}
     03   \IfFileExists{eulervm.sty}{\usepackage{eulervm}}{}
     04   \usepackage{relsize}
     05   \IfFileExists{t1pmy.fd}{
     06     \renewcommand*{\sfdefault}{pmy}
     07   }{
     08     \renewcommand*{\sfdefault}{phv}
     09   }
     10   \renewcommand{\Messier}[1]{\footnotesize{\scriptsize M}\,#1}
     11   \renewcommand{\NGC}[1]{\footnotesize{\scriptsize NGC}\,#1}
     12   \renewcommand{\IC}[1]{\footnotesize{\scriptsize IC}\,#1}
     13   \renewcommand{\FlexLabel}[1]{{\bfseries #1}}
     14   \renewcommand{\TicMark}[1]{{\mdseries\scriptsize\mathversion{normal} #1}}
     15   \AtBeginDocument{\sffamily\boldmath}

And this is what it does:

Line 1
includes the AMSMath package which provides additional macros that can be useful in text labels. You can include almost arbitrary LaTeX packages.
Line 2
activates the so-called T1 font encoding. It's not important to know what this means, but it is recommended and doesn't do any harm.
Line 3
activates nicer Greek letters. Well, your taste may be different. This \IfFileExists thing tests whether the package is available on the current computer. The package is included only if it exists.
Line 4
enables the macro \smaller which can be very useful in text labels. It reduces the current font size. For example I can say
          set_label_text LEO 32 "\\smaller Regulus"
     

Lines 5–9
test whether the font Myriad is available on the current computer, and if it does, it makes it the new standard sans-serif font. Else it uses Helvetica for that.
Lines 10–14
re-defines various LaTeX hooks in order to have nicer looking automatic labels, see LaTeX hooks.
Line 15
switches to sans-serif font (Myriad/Helvetica) with \sffamily and to bold Greek letters with \boldmath.