How to reference item by number in autogenerated ordered list?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to reference item by number in autogenerated ordered list?

jtkorb
I want to be able to refer to an item in an ordered list and have the reference text be the autogenerated item number (similar to the way references to autonumbered sections work).  For example, given the list below, "<<thisone>>" should render as "3".

Is there a way to do this?

.Item List
. Here is the first item.
. This is the second one.
. [[thisone]] This is the referenced item.
. And a final item.
Reply | Threaded
Open this post in threaded view
|

Re: How to reference item by number in autogenerated ordered list?

Andrew Carver
This is somewhat verbose, but it works:
. {counter2:inum}Here is the first item.
. {counter2:inum}This is the second one.
. [[thisone,{counter:inum}]]This is the referenced item. 
. And a final item.

Which one is xref:thisone[{inum}]?
For some reason, I had to use the xref:[] form of cross-reference to make it work.
Reply | Threaded
Open this post in threaded view
|

Re: How to reference item by number in autogenerated ordered list?

jtkorb
Thanks!  That works (but, yes, a bit cumbersome).

Tim

On Thu, Oct 4, 2018 at 1:46 AM Andrew Carver [via Asciidoctor :: Discussion] <[hidden email]> wrote:
This is somewhat verbose, but it works:
. {counter2:inum}Here is the first item.
. {counter2:inum}This is the second one.
. [[thisone,{counter:inum}]]This is the referenced item. 
. And a final item.

Which one is xref:thisone[{inum}]?
For some reason, I had to use the xref:[] form of cross-reference to make it work.


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/How-to-reference-item-by-number-in-autogenerated-ordered-list-tp6447p6491.html
To unsubscribe from How to reference item by number in autogenerated ordered list?, click here.
NAML