Create new paragraph style in LyX

in the file stdlayouts.inc you can copy the definition for quotation to a part called "myquotation". In the file stdlists you can see at the end how additional preamble commands can be made which are hided from the normal user. After changing your layout file run reconfigure and restart lyx, there should now be a "myquoation" in all styles which support this kind of environment.

Here is an example for an LyX environment MyQuotation

Style MyQuotation
    Category              MainText
    Margin                Static
    LatexType             Environment
    LatexName             myquotation
    NextNoIndent          1
    LeftMargin            MMM
    RightMargin           MMM
    ParIndent             MM
    ParSkip               0
    ItemSep               0
    TopSep                0.5
    BottomSep             0.5
    ParSep                0
    Align                 Block
    AlignPossible         Block, Left, Right, Center
    Preamble
    \usepackage{mdframed}
    \usepackage{xcolor}
    \newenvironment{myquotation}
      {\begin{mdframed}[linecolor=red]\quotation}
      {\endquotation\end{mdframed}}
    EndPreamble
End

insert it into the file stdlayouts.inc and save the file in your local .lyx/layouts/ directory (don't know how it shopuld be on windows). Then run reconfigure and you shouöld see the paagraph layout MyQuotation which then gives a framed output. alt text