[posted and mailed]

"Rudi van der Linde" <[EMAIL PROTECTED]> wrote in
news:[EMAIL PROTECTED]: 

> Hi All,
> 
> I am sure this question has been answered before but I am unable to
> surf the net at the moment to search the archives.
> 
> I have got an enumerated list e.g.
> 
> 1. Item 1
> 2. Item 2
> 3. [Label1]Item 3
> 4. Item 4
> 
> Where [Label1] is a label to an item of interest.
> 
> What I want to do is have another enumerated list after the first one
> which contains one item only, such that the item in the list has the
> same number as the one with [Label1] in the first list e.g.
> 
> 3. Item 5
> 
> The solution I need must not affect the numbering for any other
> enumerated lists.
> 
> Any ideas on how to do this would be much appreciated.
> 
> Thanks in advance.
> Rudi van der Linde
> [EMAIL PROTECTED]

The only way I know to do this requires Evil Red Text. It's a bit clunky, 
because LyX automatically issues the first \item command as soon as you 
start an enumeration.

In your document preamble, add the line

\newcounter{MyCounter}

(feel free to customize the name MyCounter).

Precede the text of item 3 (after the 3. that LyX displays) with the 
following ERT:

\setcounter{MyCounter}{\value{enumi}}\addtocounter{MyCounter}{-1}

Note that you can avoid the \addtocounter command if you put the 
\setcounter ERT in item *2* (the item preceding the one you want to 
reference), so pick your poison.

Now when you're ready to add item 5, use a *standard* environment (*not* 
enumerate), precede the text of item 5 with an ERT box containing

\begin{enumerate}\setcounter{enumi}{\value{MyCounter}}\item 

and follow item 5 with an ERT box containing

\end{enumerate}

If you need to refer back to more than one enumerated item, you'll need 
to define separate counters for each.

Two things pertaining to the enumeration counter.  I used "enumi" here on 
the assumption that you're referring back to items at the outermost 
enumeration level; if not, you'll need to change the counter name.  As 
far as screwing up other enumerations, each time you start an enumeration 
list in LyX, I'm pretty sure the counter gets reset to 1.

-- Paul

*************************************************************************
Paul A. Rubin                                  Phone:    (517) 432-3509
Department of Management                       Fax:      (517) 432-1111
The Eli Broad Graduate School of Management    E-mail:   [EMAIL PROTECTED]
Michigan State University                      http://www.msu.edu/~rubin/
East Lansing, MI  48824-1122  (USA)
*************************************************************************
Mathematicians are like Frenchmen:  whenever you say something to them,
they translate it into their own language, and at once it is something
entirely different.                                    J. W. v. GOETHE

Reply via email to