Referring to a numbered table

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Referring to a numbered table

jgallimore
Hi

I have a document where tables are automatically numbered with markup like this:

This table shows the results of the test.

.Results
[options="header"]
|====
| Users | Errors | Tests
| 8 | 0 | 1639
|====

What I'd like to be able to do is refer to the actual table in the text. So instead of saying "This table shows..." I'd like to be able to say "Table (x) shows..." and refer to the specific table without hardcoding the table number in.

Is there any way to do this?

Many thanks

Jon
Reply | Threaded
Open this post in threaded view
|

Re: Referring to a numbered table

Jeremie Bresson
The best you can do for the moment is to define a xref and to refer to it in your text.

-------------------------------------------------------------------------------------
[[tbl-results, Table 1]]
.Results
[options="header"]
|====
| Users | Errors | Tests
| 8 | 0 | 1639
|==== 

The <<tbl-results>> shows something important.
-------------------------------------------------------------------------------------

The problem is that the number is hardcored in your anchor definition.

The issue 858 is open to be able to use "{refnum}".

-------------------------------------------------------------------------------------
[[tbl-results, Table {refnum}]]
.Results
[options="header"]
|====
| Users | Errors | Tests
| 8 | 0 | 1639
|==== 

The <<tbl-results>> shows something important.
-------------------------------------------------------------------------------------

or
-------------------------------------------------------------------------------------
[[tbl-results]]
.Results
[options="header"]
|====
| Users | Errors | Tests
| 8 | 0 | 1639
|==== 

The <<tbl-results, Table {refnum}>> shows something important.
-------------------------------------------------------------------------------------