Login  Register

Alternative table numbering

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

Alternative table numbering

rhattersley
4 posts
Hi,

I'm trying convert a document  but have hit a problem with table numbering. When I assign a title to a table the HTML output automatically acquires a "Table <N>. " prefix. These automatic numbers don't match those of the source document (which behave more like section numbers, e.g. "Table 3.1" for the first table in the third section). So either I need a way to redefine the automatic numbering technique, or I need a way to turn off the automatic numbering and do it by hand. Are either of these possible?

Thanks for any help!
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Alternative table numbering

rhattersley
4 posts
I've found I can use the "caption" attribute to replace the prefix. For example:
.Supported units
[caption="Table 3.1 "]
|===
... some stuff ...
|===
renders in HTML5 and PDF as:
Table 3.1 Supported units
... table here ...

I don't know if that's the "correct" way to get this result, but at least it works. Any suggestions for improvement welcome!
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Alternative table numbering

rhattersley
4 posts
In the O’Reilly Getting Started with Atlas documentation the image labels seem to have exactly the kind of behaviour I'm after. Chapter 2 is a good example.

But I can't find anything in the AsciiDoc source which controls that behaviour.
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Alternative table numbering

mojavelinux
Administrator
2681 posts
> I need a way to turn off the automatic numbering and do it by hand.

Just turn off the table-caption by adding the following to the document header.

:table-caption!:

We are discussing options for getting section-based numbering for objects like tables in the following issue:

https://github.com/asciidoctor/asciidoctor/issues/979

> In the O’Reilly Getting Started with Atlas documentation the image labels seem to have exactly the kind of behaviour I'm after. Chapter 2 is a good example.

That's because O'Reilly uses a completed custom backend for Asciidoctor (which is perfectly acceptable and encouraged for maximum customization).

See https://github.com/oreillymedia/asciidoctor-htmlbook

Remember, you can output any HTML you want in Asciidoctor. You just have to create a custom template file for the node in the tree you want to customize (or write your own custom converter to override everything).

Cheers,

-Dan

On Thu, Jan 15, 2015 at 5:37 AM, rhattersley [via Asciidoctor :: Discussion] <[hidden email]> wrote:
In the O’Reilly Getting Started with Atlas documentation the image labels seem to have exactly the kind of behaviour I'm after. Chapter 2 is a good example.

But I can't find anything in the AsciiDoc source which controls that behaviour.


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Alternative-table-numbering-tp2673p2675.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Alternative table numbering

rhattersley
4 posts
Thanks for clarifying my options. Depending on how long before I need this all working I might be better off waiting for the behaviour in that PR to be released, but at least I have a manual workaround for now.

On 19 January 2015 at 07:50, mojavelinux [via Asciidoctor :: Discussion] <[hidden email]> wrote:
> I need a way to turn off the automatic numbering and do it by hand.

Just turn off the table-caption by adding the following to the document header.

:table-caption!:

We are discussing options for getting section-based numbering for objects like tables in the following issue:

https://github.com/asciidoctor/asciidoctor/issues/979

> In the O’Reilly Getting Started with Atlas documentation the image labels seem to have exactly the kind of behaviour I'm after. Chapter 2 is a good example.

That's because O'Reilly uses a completed custom backend for Asciidoctor (which is perfectly acceptable and encouraged for maximum customization).

See https://github.com/oreillymedia/asciidoctor-htmlbook

Remember, you can output any HTML you want in Asciidoctor. You just have to create a custom template file for the node in the tree you want to customize (or write your own custom converter to override everything).

Cheers,

-Dan

On Thu, Jan 15, 2015 at 5:37 AM, rhattersley [via Asciidoctor :: Discussion] <[hidden email]> wrote:
In the O’Reilly Getting Started with Atlas documentation the image labels seem to have exactly the kind of behaviour I'm after. Chapter 2 is a good example.

But I can't find anything in the AsciiDoc source which controls that behaviour.


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Alternative-table-numbering-tp2673p2675.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--



If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Alternative-table-numbering-tp2673p2680.html
To unsubscribe from Alternative table numbering, click here.
NAML