3

I want to implement a shortcut in LyX that I can use to insert my own itemize environment.

The reason for implementing is the following: because when you want to add a itemize environment the Lemma environment also changes, too. Anybody using LyX knows how annoying that gets.

itemize

At best I just press Ctrl+Alt+i and the environment pops up.

Rasmus
  • 1,270
  • 1
  • 10
  • 25
A.Dumas
  • 211
  • http://latex-community.org/forum/viewtopic.php?f=19&t=25402&p=86510#p86510 – Johannes_B Dec 09 '14 at 17:29
  • What makes the environment "your own"? Would you be satisfied with a shortcut for the normal itemize environment? – Rasmus Dec 09 '14 at 23:05
  • You can have a lot of control over things like this. For creating the shortcut, see http://tex.stackexchange.com/questions/208510/lyx-commands-to-insert-wysiwyg-horizontal-line-for-keyboard-shortcut/208531#208531 . For creating your own itemize environment, see Help > Customization. You probably want to work off of the already implemented itemize layout (which is just an external text file, it is not in the C++ code of LyX). It is defined in stdlists.inc – scottkosty Dec 09 '14 at 23:12

1 Answers1

1

In inserting the Itemize environment, you jump out of the Lemma environment. Yep, that can be annoying.

To push the Itemize environment (or other) into the above environment (Lemma, in this case), press Tab while in your itemized list.

To create a shortcut that does this for you in one go, go to Tools > Preferences > Shortcuts > New and insert as function

command-sequence layout Itemize; command-alternatives completion-accept;cell-forward;tab-insert;depth-increment;outline-in

Assign it a shortcut and you're good to go!

ProTip: I created the function by 1) knowing that one can use the command-sequence in specifying shortcuts -- it is extremely powerful (example). 2) I knew that you had to use Tab to push environments -- I'm pretty sure I found that in the LyX documentation. 3) Finally, I looked up what functions Tab and shortcut to insert Itemize executed in the defined shortcuts, and composed the using command-sequence.

I hope this answers your question. In any case, thank you for the "soduko" :)

Rasmus
  • 1,270
  • 1
  • 10
  • 25