Recent Changes - Search:

WikiDoc

# Electrics Primer

## FAQ.ElectricsPrimer History

January 23, 2006, at 03:07 PM by 212.180.15.164 -

(:title Electrics Primer:)

An Alpha user asked on one of the AlphaTclMailingLists?:


> I would like some method to replace \su with \subseteq and \ri with \rightarrow.
> Is there any way to facilitate math symbology without trying to remember
> lots of keyboard shortcuts or wade through the LaTeX menu?  Thanks.



Yes. Alpha is shipped with several different 'electric' features that are ideal for these sorts of tasks. The term "electric" is used throughout Alpha in the sense of

• automatic, power assisted behavior

which is intended to save time, keystrokes, and brainpower. The "Electric Completions" and "Electric Expansions" features are very useful for typing in a 'hint' and turning that into some pre-defined text that you really want.

This wiki page is a quick and dirty introduction that addresses

• Invoking electric completions/expansions
• How do electric completions work?
• How do electric expansions work?
• Defining personalized completions/expansions

Note that Alpha uses several different methods to determine what the completion/expansion should be as explained in the file

Help > Electrics Help

Config > Mode Prefs > Completions Tutorial

Invoking electric completions/expansions

These packages are be turned on by default, but you need to adjust your FAQ.SpecialKeys using the

Config > Special Keys

dialog to set your "complete" and "expand" shortcuts. These functions operate on the text immediately preceding the cursor, by determing an initial "hint" and then performing a series of tests to determine the proper text to insert.

How do electric completions work?

It is really very simple. For example, if you are in TeX mode and you type


\sub



and then press your "complete" key you'll be offered a set of completion options -- completing


\subs



will reduce the number of choices.

(Tip: the Config > Preferences > Interface > Completions dialog includes a checkbox for "List Pick For Mult Cmps " -- this toggles the display of choices in a dialog vs the status bar.)

How do electric expansions work?

Expansions behave in a similar way, but the initial "hint" is an acronym rather than the start of a word. For example (again in TeX mode), if you "expand"


\ra



you will be offered choices for


\rightarrow



(Tip: the Config > Preferences > Interface > Completions dialog includes a checkbox for "List Pick For Mult Expns " -- this toggles the display of choices in a dialog vs the status bar.)

Defining personalized completions/expansions