[Tex/LaTex] Creating LyX Layouts – No indents for first paragraphs

indentationlyxlyx-layoutsparagraphs

Based on article.cls, I created my own Document Class with a new Environment, called "Body." It shows up right when compiled, but it doesn't appear in LyX correctly. It's supposed to have the same indenting style as "Standard" (i.e. the first paragraph is not indented, all following ones are). But I can only get all indented paragraphs or none! Here is the (abbreviated) code for Body in its .layout file:

Style Body
    Category        MainText
    Margin          Static
    LatexType       Environment
    LatexName       Body

    NextNoIndent    1
    ParIndent       MM
    TopSep          0.5
    BottomSep       0.5
End

Am I missing something? It's impossible to find documentation on layouts for LyX!
How do I make only the first paragraph not indent in LyX?

Best Answer

The Layout format is relatively well documented under Help-->Customization:

ParIndent [string=""] The indent of the very first line of a paragraph. The Parindent will be fixed for a certain style. The exception is the default style, since the indentation for these paragraphs can be prohibited with NextNoIndent. Also, Standard style paragraphs inside environments use the Parindent of the environment, not their native one. For example, Standard paragraphs inside an enumeration are not indented.

and:

NextNoIndent [1, 0] If set to true, and if DefaultStyle (usually Standard) paragraphs are being indented, then the indentation of such a paragraph following one of this type will be suppressed. (So this will not affect the display of non-default paragraphs.)

As I read it, a differentiation between the first and the following paragraphs regarding indentation is only possible for the Layout's DefaultStyle, which usually is (and should be) Standard. So you are probably out of luck here. I would suggest to forward this question to the LyX Users list, the developers are pretty responsive there. They might suggest you to add a feature request into the LyX bug tracker.