Making a Macro

OK, so you want to make a macro for putting in the \usepackage{graphics}, and another macro for a general header that you use that looks like:

\documentclass[12pt]{article}

\begin{document}

 

\end{document}

which places a cursor in the middle of the \begin and \end. Let's start off with the format that comes with an easy installation of Textures. First, create a new document. In the right hand side, you should see a box around a + symbol that looks like: . Pressing down on it brings up a pop-up menu that looks something like the following when you click on it:

Getting the Menu Source Code

Next, we want to get the code that makes up the macro menu, and edit it. Go into the Edit menu, and under the Macro sub-menu, you will find "Copy Program", like so:

This copies the source into the Clipboard. Next, paste the source code into your new document using either the shortcut, or going into the edit menu and picking Paste, like so:

This puts a bunch of source code onto your new document. Next, we want to edit the source code.

Editing the Code

We want to add the command \usepackage{graphics} to the end of the menu, and want it to have the shortcut. Scrolling to the end of the code, we enter in:

To make the right arrow symbol, press <option-shift-\>. To get the delta character at the end, press <option-d>.

Now that we have put in the code, we want to be able to put it back in.

Saving the Code

To save the code, we first select the entire text (either using the "Select All" feature in the Edit menu, or the shortcut ). We then copy the text using "Copy" from the Edit menu (or ), which puts it in the Clipboard. Finally, we paste the clipboard source over the old source by selecting "Paste Program" from the Macros sub-menu in the Edit menu, like so:

And you have that particular macro in correctly.

Back to Tips Page


If this solution doesn't work, write to us: help@bluesky.com.

© Blue Sky TeX Systems