<\body> Let us explain on an example how to write a simple style package. First of all, you have to create a new buffer using and select the document style using . Now save your empty style package in your personal style package directory Notice that the button in the file browser corresponds to the directory Consequently, you can go to the style package directory from there, by double clicking on and next on . Similarly, the directory contains your personal style files. After saving your empty style package, it should automatically appear in the menu. Notice that style files must be saved using the file extension. If you save the style file in a subdirectory of , then it will automatically appear in the corresponding submenu of . Let us now create a simple macro which displays ``Hello world''. First type , so as to create an assignment. You should see something like <\tm-fragment> > Now enter ``hi'' as the first argument and type inside the second argument in order to create a macro. You should now see something like <\tm-fragment> >> Finally, type the text ``Hello world'' in the body of the macro. Your document should now consist of the following line: <\tm-fragment> >> After saving your style package, opening a new document and selecting your package in the menu, you may now use the macro in your document by typing and hitting . In a similar way, you may create macros with arguments. For instance, assume that we started entering a macro in a similar way as above. Instead of typing ``Hello world'', we first type inside the macro body so as to create an additional argument on the left hand side of the cursor. We next enter the name of the argument, say ``name''. You should now see something like below: <\tm-fragment> >> In the second argument of the body, we now type ``Hello '', , ``name'', and ``, how are you today?''. After this you should see <\tm-fragment> , how are you today?>>> The shortcut is used to retrieve the macro argument . Instead of typing , ``name'' and , you may also use the hybrid -key and type followed by . After saving your style package, you may again use the macro in any document which uses your package by typing and hitting . From the internal point of view, all macro definitions are stored in the environment of the typesetter. Besides macros, the environment also contains normal environment variables, such as section counters or the font size. The environment variables can either be globally changed using the primitive, or locally, using the primitive. For instance, when including the line <\tm-fragment> > in your package, and using as your major style, then the first section will be numbered . Similarly, the variant <\tm-fragment> >!>>> of the macro displays the name of the person in . Notice that the primitive can also be used to locally redefine a macro. This is for instance used in the definitions of the standard list environments, where the macro which renders list icons is changed inside the body of the list. Yet another variant of the macro relies on the standard macro: <\tm-fragment> >!>>> In order to produce the macro application >>, you first have to start a compound tag using , type the name ``person'', insert an argument , and enter the argument as before. When you are done, you may press in order to change the tag into a tag. Alternatively, you may type , ``person'', and ``name''. By combining the above constructs, an ordinary user should already be able to produce style packages for all frequently used notations. An interesting technique for writing macros which involve complex formulas with some subformulas which may change goes as follows: <\enumerate> Type the formula, say ,\,a)>, in an ordinary document. Create the skeleton of your macro in your style package: <\tm-fragment> >> Copy the formula and paste it into the body of your macro: <\tm-fragment> ,\,a)>>> Replace the subformulas you want to parameterize by macro arguments: <\tm-fragment> ,\,)>>> You may now use the macro in documents which use your package: <\equation*> ,\,)>|=.> <\initial> <\collection>