Re: How to make a clone of the Enumerate environment?
On Wednesday 23 July 2008 00:54, Dirk Markert wrote: > 2008/7/22 Steve Litt <[EMAIL PROTECTED]>: > > Günter (and everyone else), > > > > Your response contains one of the most useful LyX idioms I've ever seen, > > limiting my biggest objection to LyX. It will lead to vastly improved > > productivity for me. > > > > Can anyone guess which part of Günter's email is so useful? I'll reveal > > it in > > another email, coming up shortly. > > CopyStyle? > > Dirk Yes! It looks like my subsequent message didn't go through, but it was CopyStyle. Let me look into what happened to my second post. STeveT Steve Litt Recession Relief Package http://www.recession-relief.US
Re: How to make a clone of the Enumerate environment?
2008/7/22 Steve Litt <[EMAIL PROTECTED]>: > Günter (and everyone else), > > Your response contains one of the most useful LyX idioms I've ever seen, > limiting my biggest objection to LyX. It will lead to vastly improved > productivity for me. > > Can anyone guess which part of Günter's email is so useful? I'll reveal it > in > another email, coming up shortly. CopyStyle? Dirk
Re: How to make a clone of the Enumerate environment?
Günter (and everyone else), Your response contains one of the most useful LyX idioms I've ever seen, limiting my biggest objection to LyX. It will lead to vastly improved productivity for me. Can anyone guess which part of Günter's email is so useful? I'll reveal it in another email, coming up shortly. On Wednesday 16 July 2008 07:34, G. Milde wrote: > 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 -- Steve Litt Recession Relief Package http://www.recession-relief.US
Re: How to make a clone of the Enumerate environment?
Steve Litt wrote: Gunter -- your solution is exactly right. I confirmed it, and even changed the font of the Question environment without affecting Enumerate, which is why I wanted a clone in the first place. Like you said, I have no idea why the TeX based idiom (using \let) didn't work, but it didn't. Your LaTeX based solution works perfectly. \let clones COMMANDS, whereas you were trying to clone environments. There are, of course, commands that correspond to the environments, and you could probably use \let to do it that way. But Gunter's version is definitely preferable. rh Thanks very much. SteveT On Wednesday 16 July 2008 07:34, G. Milde wrote: 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
Re: How to make a clone of the Enumerate environment?
Gunter -- your solution is exactly right. I confirmed it, and even changed the font of the Question environment without affecting Enumerate, which is why I wanted a clone in the first place. Like you said, I have no idea why the TeX based idiom (using \let) didn't work, but it didn't. Your LaTeX based solution works perfectly. Thanks very much. SteveT On Wednesday 16 July 2008 07:34, G. Milde wrote: > 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
Re: How to make a clone of the Enumerate environment?
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