Node: LaTeX hooks, Previous: LaTeX preamble, Up: PP3 and LaTeX



7.3 LaTeX hooks

First of all – what is a hook? A hook in general is a macro or command that can be re-defined by the user, and that is called implicitly. Thus, by re-defining a hook, the user can modify the behaviour of the program at certain points.

In PP3, hooks are called for printing text of various kinds. For example, every implicit (i.e. automatically generated) star name is printed by \Starname as in \Starname{$\gamma$}. By default, this macro does nothing more than printing its argument:

     \newcommand*{\Starname}[1]{#1}

But if you re-define it, you can make every (implicit!) star label a little bit larger:

     \renewcommand*{\Starname}[1]{\larger #1}

Notice that the macro \larger is provided by the `relsize' package that must be loaded before, see User preamble. So, just write the lines

     \usepackage{relsize}
     \renewcommand*{\Starname}[1]{\larger #1}

in the file mypreamble.tex, say

     set latex_preamble mypreamble.tex

in the PP3 input script, and voilà – all star labels are larger.

PP3 knows nine hard-wired LaTeX hooks:

\Label
Argument: the label text. It applies to all labels except for flexes.
\TextLabel
Argument: the label text. It applies to all labels that the user creates with text.
\FlexLabel
Argument: the label text. It applies to all flexes.
\Starname
Argument: the star name. It applies to all automatically generated star names, in particular not to user-defined names given by set_label_text.
\Messier
\NGC
\IC
Argument: the respective catalogue number. This generates the labels for nebulae. Notice that you must provide the catalogue name, or you can leave it as well. For example, many people prefer NGC numbers as plain numbers without an `NGC' before it. You achieve this effect with
          \renewcommand*{\NGC}[1]{#1}
     

\TicMark
Argument: the tic mark label text. It applies to all tic mark labels, see Tic labels.
\DP
No argument. This generates the decimal point. By default, it's a `.', however in many countries a `,' is used instead. You get this with
          \renewcommand{\DP}{,}