Login  Register

How to reference item by number in autogenerated ordered list?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options Options
Embed post
Permalink
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

How to reference item by number in autogenerated ordered list?

jtkorb
10 posts
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
| More
Print post
Permalink

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

Andrew Carver
48 posts
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
| More
Print post
Permalink

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

jtkorb
10 posts
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