Next: Basic operations Up: Installation Previous: Variables

## Tips and tricks

A useful installation trick that you might want to put in your `prefs.tcl` file (opened by choosing Edit Prefs on the Global submenu of the Config menu) is the following key binding:

    bind 'n' <cs> {newMode TeX; newLaTeXDocument}

With this binding, it's easy to bring up a new LaTeX document no matter where you are or what you're doing. Regardless of the file you're currently editing, simply press <SHF CMD N> to open a new LaTeX document (see the New Document command in section 2.1.2 for details).

Alpha is completely customizable, but it's not a good idea to modify its Tcl files directly. Instead, put your modifications in preferences files designed specifically for this purpose. Besides the global preferences file `prefs.tcl` mentioned above, there are also mode-specific preferences files. TeX mode, for instance, has its own prefs file called `TeXPrefs.tcl`. To edit this prefs file, open a `.tex` file and choose the command Edit Prefs on the Current Mode submenu of the Config menu. All TeX-related modifications should be placed in this preferences file.

Note: All preferences files are stored in the Preferences folder in the System Folder. They are not touched when you upgrade your version of Alpha.

It's relatively easy to modify the LaTeX menu to suit your needs. Suppose, for example, you've written a handy Tcl proc called myUtility that you'd like to put on the LaTeX menu. To do this, copy the proc latexUtilitiesSubmenu and its helper proc `latexUtilsSubmenuFilter` from `latexMenu.tcl` to `TeXPrefs.tcl` and add your new utility to the definition of the LaTeX Utilities submenu:

      proc latexUtilitiesSubmenu {} {
        return {menu -M TeX -n {LaTeX Utilities} -m -p latexUtilsSubmenuFilter {
          {<U<O/CChoose Command...}
          "(-"
          {<I/cInsert Literal Tab}
          {Insert Tab Stop}
          "(-"
          {<O/cDelete Tab Stops}
          {Delete Comments}
          "(-"
          {My Utility}
          "(-"
          {Convert Quotes}
          {Convert Dollar Signs}
          "(-"
          {Short LaTeX Menu}
          }
        }
      }

      proc latexUtilsSubmenuFilter {submenu item} {
        switch $item {
          {Choose Command}  {set func {chooseCommand [getLaTeXMenu]}}
          {Insert Literal Tab}  {set func "insertLiteralTab"}
          {Insert Tab Stop}  {set func "insertTabStop"}
          {Insert Reference}  {set func "insertReference"}
          {Delete Tab Stops}  {set func "deleteTabStops"}
          {Delete Comments}  {set func "deleteComments"}
          {My Utility}  {set func "myUtility"}
          {Convert Quotes}  {set func "convertQuotes"}
          {Convert Dollar Signs}  {set func "convertDollarSigns"}
          {Short LaTeX Menu}  {set func "toggleLaTeXMenus"}
          default {set func $item}
        }
        eval $func
      }

Finally, add the line

      eval [latexUtilitiesSubmenu]

to `TeXPrefs.tcl`, which rebuilds the LaTeX Utilities submenu. That's all there is to it!

Next: Basic operations Up: Installation Previous: Variables