Non-obvious keyboard shortcuts

These are generally for use in math mode only.

Writing Macros

Macros are very useful for binding often-used structures to a name in order to save time when writing. Choose the menu item Document->View->Edit Source Tree. Place the cursor near the top. Type "\assign<enter>" It should now look like this:

<assign| | >

In the first box, put the name of your macro. For the example, I will use abs. In the second space, type "\macro<enter>". Your macro will have 0,1,2, or N arguments. For each argument, hit "Alt-Rightarrow" to create a space. The macro should now have N+1 spaces. The first N spaces will be the names that your arguments will be bound to. The last space will specify how your macro should be evaluated. For the abs example, only one argument is needed. I will be unoriginal and call it x.

<assign|abs|<macro|x| >>

Now I'm ready to write my content. To insert the value of one of your arguments hit "\" followed by the argument name, followed by enter. The argument name should show up in an altered font after you hit enter.

<assign|abs|<macro|x|<left||>x<right||>>>

You can use the Document->View->Edit Source Tree menu item to return to the usual WYSIWYG view. To use your new macro, position the cursor, then type "\abs<enter>". Absolute value bars should pop up. You can type whatever you want in them and they will expand to cover their contents. Type "\frac<enter>" to try it out.

A word of caution: there is only one namespace (per document), so be careful about name clashes. Note also that in almost all places above, <tab> does the same thing as <enter>.

DebianNotes/Texmacs (last edited 2008-03-10 01:38:24 by localhost)