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.


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

  • latex-community.org/forum/…
    – Johannes_B
    Dec 9 '14 at 17:29
  • What makes the environment "your own"? Would you be satisfied with a shortcut for the normal itemize environment?
    – Rasmus
    Dec 9 '14 at 23:05
  • You can have a lot of control over things like this. For creating the shortcut, see tex.stackexchange.com/questions/208510/… . 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 9 '14 at 23:12

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" :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.