Defining shortcuts in LyX

One way that might help is to define a math macro for often used symbol combinations. You can define a math macro using Insert > Math > Macro. After you type a name for your macro and the contents of the macro, you can use the new macro throughout your document (as long as it is in math mode). You can read more about math macros in LyX here.


Since I use various editors on different platforms I got used to work with shortcut managers

  • Autohotkey on Windows
  • Autokey on Linux
  • Textexpander on Mac OS X

All these tools allow you to define a shortcut like e.g. 's#' that expands to \section{} with the cursor between the curly braces. Since I started using them my TeXing speed greatly increased.


You can define a keyboard shortcut to insert the desired.

Go to Tools > Preferences > Editing > Keyboard Shortcuts, then Add New. In the command field, type math-insert \mathbb{R} and assign that a key combination.

Update based on comment below: If you find it annoying that you remain in the mathbb box, you can bind the keyboard shortcut to the function

command-sequence math-insert \mathbb{R}; char-forward; char-forward

If you want to also jump out of the math box, add an additional ; char-forward

Tags:

Lyx