9

Whenever I try to create two environments of the same type in a row, LyX unites them as if they were one. I write a definition, press ENTER for a new line, and then want to write another definition on that new line, LyX ignores my intention and moves me back to the previous definition ...

What shall I do?

2
  • Just to add that --Separator-- can be found under the drop-down menu (near the top-left, under File and Edit). Took me another 10 minutes to figure out after reading the answer below.
    – user45727
    Mar 16, 2016 at 2:17
  • See tex.stackexchange.com/a/632952/193546 for LyX 2.3 Feb 6, 2022 at 21:10

5 Answers 5

8

This answer is outdated for versions 2.2 and higher of LyX. See the answers of nth and Rodolfo for updated information.


The "proper" way of doing seems to be to add a "Separator" environment after the first definition1.

enter image description here

1 http://www.lyx.org/trac/ticket/5689

10
  • Hey Torbjørn , thanks for all the effort with the screenshot and all, but I think I didn't explained myself clearly enough. what I meant was that if a wrote a definition, pressed ENTER for a new line, and then wanted to write another definition on that NEW line, Lyx ignore my intention and moved me back to the previous definition...
    – dave
    Jan 1, 2012 at 14:38
  • @dave Please add that to your question. Jan 1, 2012 at 14:43
  • @dave Did I get it right this time? Jan 1, 2012 at 16:12
  • 1
    @RodolfoOviedo Sure (would also have been fine if you did that yourself :) ). Is there any change between 2.2 and 2.3 by the way? Feb 6, 2022 at 21:18
  • 1
    @TorbjørnT. Yes, Edit→Start new environment is no longer available in version 2.3. Another reason why I wrote a full answer is that the quote cited by nth suggests an alternative method, but it does not explain how to apply it to the current problem, so it can confuse the reader. I applied it to the current problem in the alternative method explained in my answer. Feb 6, 2022 at 21:40
7

The existing answers are now out of date. In LyX 2.2, the separator environment has been replaced by a separator inset. To quote the changelog,

This new separator is introduced with Edit→Start new environment (shortcut Alt+P Enter) or by pressing Enter in an empty Standard paragraph that immediately follows a non-standard one (e.g. enumerate environments).

3

Just press TAB. It will place another "definition" mark on the follow line.

1
  • 2
    This is not a good idea, because if you look at the source code, the second definition is "nested" in the first one.
    – Herr K.
    Dec 10, 2013 at 23:45
1

LyX version: 2.3

Problem. You cannot create a new environment of the same type (theorem or lemma or any other) right after the current one.

Solution. Place the cursor at the end of the current environment. Press Alt+P and then Enter. You will see a separation inset in a line between the current environment and the new one. (Credit: @nth's answer for version 2.2).

If you don't remember the shortcut, you can write at least one character of the text of the following environment, place the cursor before it and press Enter three times. Explanation: If you don't have something written after the point where you press Enter three times, you will get a Standard paragraph after the inset, which forces you to select the environment again from the drop-down menu. The first two presses of the Enter key produce a Standard paragraph below the current environment. The third press creates the separator inset and places the cursor on the following line.

0

Say you want to insert several different definitions in a row without writing any text between them. All you need to do is to write your definitions between \begin{defn} and \end{defn} commands. Then you can insert as many definitions in a row as you want.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .