On 14.07.08, Steve Litt wrote:
> Hi all,
> I'm trying to make a simple clone of the Enumerate environment. Once I
> can do that, I'll make a few changes. But I've not been able to clone
> it.
You need to clone both, LyX layout::
Style Questions
CopyStyle Enumeration
and LaTeX environment::
\newenvironment{questions}{\begin{enumerate}}{\end{enumerate}}
> Here's my layout file:
> #% Do not delete the line below; configure depends on this
> # \DeclareLaTeXClass[book]{quizbook}
> Input stdclass.inc
> Preamble
> \let\questions = \enumerate
> \let\oldquestions = \oldenumerate
> EndPreamble
I am not sure if this works well, as enumerate is an environment, not a
command. Use the latex \newenvironment instead.
> Style Questions
...
> End
With CopyStyle, you get all the definitions of the copied style and
need to change only thing that should differ.
> The preceding layout produces the output shown in the attached
> screenshot_questions.gif. However, if I change the LatexName in the LyX
> environment from "questions" to "enumerate", it outputs as shown in the
> attached screenshot_enumerate.gif.
Describing the difference in words helps (while pics might augment
this, they cannot always replace a description, e.g. while browsing
this mail to see if I can help at all, I do not see the attachments.)
> Can somebody explain to me why the two don't output the same?
no.
>Can somebody explain how I can truly clone the Enumerate environment?
see above.
> NOTE: In order to toggle the output when switching between LatexType
> questions and LatexType enumerate, you must Tools->reconfigure and then
> terminate and restart LyX. Trust me on this -- I tried without
> reconfiguring and the output didn't toggle.
You could define 2 Styles in your layout file (one QuestionsTest, say)
and switch between them in the document.
Günter