I posted a version of this at Stack Exchange, too.
On 07/19/2015 12:29 PM, Jürgen Spitzmüller wrote:
Am Sonntag 19 Juli 2015, 02:34:26 schrieb C. Fuhrman:
I posted quite a detailed question on the tex stack exchange here:
http://tex.stackexchange.com/q/255936/17868
The short version is that I'm using LyX 2.1.3 on Windows with the
Exam.cls and a layout file I've customized.
In the context of a \begin{questions} environment (defined in a Flex
Inset), I'd like to know if it's possible for LyX to automatically
repeat a certain style within. For example, it's intuitive within this
environment to repeat the Question style (which is a LatexType Command
that maps to \question[]{}). LyX always gives me 'Plain Layout' within
the inset to start. When I set it to Question, type the question and
press return, I get again a 'Plain Layout'. I would like Question to be
the "style for next paragraph" within this inset.
I can *almost* do this with an LatexType Item_Environment which gives me
Enumerated (\item) styles. However, I'd like to state which LyX style to
repeat within my custom environment.
You can use the ItemCommand layout option for this task:
Style Questions
Margin Static
LatexType Item_Environment
LatexName questions
ItemCommand question
Argument item:1
MenuString "Point Value"
LabelString "Points"
EndArgument
LeftMargin MMN
LabelSep xx
LabelType Enumerate
End
Jürgen