On Jan 28, 2007, at 12:26 PM, Richard Heck wrote:



Bruce Pourciau wrote:

On Jan 28, 2007, at 11:45 AM, Paul Smith wrote:

On 1/28/07, Bruce Pourciau <[EMAIL PROTECTED]> wrote:
According to the documentation for the enumitem package, to make the counter continue from the previous enumerate rather than reset to 1,
we just write

\begin{enumerate}[resume]

in the LaTeX file. But in a LyX document, what ERT do I insert and
where exactly do I insert it? Also, if I generally want my enumerate
environments to resume counting -- as I do with exams and problem
sets, for example -- is there a way to make this the default behavior
by putting a line in the preamble?

A nice solution together with an example LyX file is at:

http://wiki.lyx.org/LyX/Numbering

Paul

Thanks, Paul. Yes, I know how to resume a particular enumerate
environment using mdwlist, but I have other reasons for using the
enumitem package, so I'd like to be able to resume enumerates with
enumitem, both locally and globally.

Bruce


I don't think there's any way to do this, short of modifying your layout
file. I believe I filed an enhancement request on this very matter a
while back. You might want to file another one, just in case. Basically, what one wants is a way to add optional arguments to environments. This
can actually be done with non-list environments already: Just just put
"[argument]" in ERT immediately after you invoke the environment. But it won't work with lists, because the \item for the first item intervenes.
But there ought to be a neat way to do it, generally, anyway.

That said, the solution is to modify the layout file. I haven't tested
this, but something like the following ought to work:

Style Renumerate
        Margin                Static
        LatexType             Item_Environment
        LatexName             renumerate
        NextNoIndent          1
        LeftMargin            MMN
        LabelSep              xx
        ParSkip               0.0
        ItemSep               0.2
        TopSep                0.7
        BottomSep             0.7
        ParSep                0.3
        Align                 Block
        AlignPossible         Block, Left
        LabelType             Enumerate
        Preamble
\newenvironment{renumerate}{\begin{enumerate}[resume]}{\end {enumerate}}
        EndPreamble
End

Basically, we're creating a new environment, renumerate, that is just
enumerate with the optional argument we want. Everything else is simply
stolen from the stdlists.inc definition for Enumerate. The counters in
LyX won't display appropriately, but they should be right when you compile.

Richard


Thank you, Richard. I'll try your suggested modification of the layout file for resuming enumerates globally. But in the meantime, suppose I wish to use the package enumitem to resume enumerates _locally_, for a particular enumerate environment. With the mdwlist package, you can write in ERT

\suspend{enumerate}
\resume{enumerate}

with a standard flush left paragraph in between. I'm looking for a similarly simple way to use the enumitem package to resume enumerates.

Bruce


Reply via email to