3

While using LyX, I usually have to define some new theorem environments. For example, I define a new environment rst to state "Restriction".

\newtheorem{rst}{Restriction}

In LyX, I need to type \begin{rst} and \end{rst} to use this environment. Is it possible to define a snippet in LyX to type these for me?

semibruin
  • 224

1 Answers1

4

The best would be to create a module or use the local layout. See the current LyX modules for example.

But if you do really just want a keyboard shortcut, go to Tools > Preferences > Editing > Shortcuts, click on "New" and choose a shortcut for the following:

command-sequence ert-insert; self-insert \begin{rst}; char-forward
scottkosty
  • 13,164
  • 1
    Good. Out of curiosity, where did you learn the function command-sequence ert-insert; self-insert \begin{rst}; char-forward? Any reference to look at? – semibruin Sep 20 '15 at 03:31
  • 2
    @semibruin see Help > LyX Functions and for how to know which LFUN corresponds to something you do manually, see the answer here: http://tex.stackexchange.com/questions/208510/lyx-commands-to-insert-wysiwyg-horizontal-line-for-keyboard-shortcut/208531#208531 – scottkosty Sep 20 '15 at 05:44