Add keyboard shortcut to the DisplayFormula style

Yes, you can do that. You can for all notebooks using a given style by editing the style notebook for that style or you can do it for just one notebook. In either case you do the following:

  1. To make key bindings for styles in a stylesheet, open the relevant stylesheet notebook in Mathematica ; to make bindings restricted to an individual notebook, make that notebook the active one, and choose Format > Edit Stylesheet...
  2. Select a cell in the stylesheet of the style you want to edit. If you don't see it, choose the style from the drop-down menu at top left of stylesheet window.
  3. Open the Options Inspector.
  4. Choose Selection at the top left of Options Inspector.
  5. Search for "menucommandkey" in the search box at top right.

You can bind the selected style to Cmnd+1 through Cmnd+9 and Cmnd+Shift+2 through Cmnd+Shift+0. To assign a Cmnd+Shift shortcut, enter the appropriate shifted character; e.g., enter "@" into the Options Inspector to get Cmnd+Shift+2 (or the appropriate key depending on your keyboard language). If all the bindings are in use, you will have to give up one (override it) to make a new binding.

The following image shows how editing cmnd key assignments in a stylesheet notebook looks.

StyleCmndKey.png

Update

There were mistakes and omissions in my answer when first posted. I hope I have fixed them now.


This already exists in the Articles StyleSheets, both in the JournalArticle and Preprint as well as in the Book StyleSheets both in the TextBook and Monograph. In all these the

DisplayFormula is Alt+5

and the

DisplayFormulaNumbered is Alt+6.

I like these StyleSheets more then the Default one. There is a peculiarity in them, however, which might seem uncomfortable: in all of them the newly-created cell is by default the TextCell, rather than InputCell, which is the case in the Default StyleSheet. This is, however, logic. In everything else these StyleSheets are much richer in features.

Tags:

Keyboard