Unnumber the preface section in xhtml

67 views
Skip to first unread message

Lionel

unread,
Jul 26, 2010, 5:56:37 AM7/26/10
to asciidoc
Hi everyone,

I'd like to know what's the best way to get the preface section un-
numbered using xhtml backend. I tried to add ":numbered!:" before it
and ":numbered:" back after the section, but the numbered sections
still start at 2., where I'd like them to start at '1.'. Is there any
solution ? Make the preface as [float] when xhtml backend is used ?

Thanks for suggestions,
Lionel

Stuart Rackham

unread,
Aug 2, 2010, 8:51:41 PM8/2/10
to asci...@googlegroups.com
Hi Lionel

Yes, using [float] is going to be the easiest way. Sections like preface and
abstract shouldn't be numbered though and the problem with the 'numbered'
attribute is that it suppresses the numbers from being displayed but does not
stop them from incrementing.

I've just committed a patch to the trunk that inhibits section numbers
incrementing when the 'numbered' attribute is not defined, this is better than
[float] because it does no affect the DocBook outputs:

http://code.google.com/p/asciidoc/source/detail?r=75fc6db5716a737ed7b13e2bcc6518856e8f70cd


Cheers, Stuart


>
> Thanks for suggestions,
> Lionel
>

Lionel

unread,
Aug 3, 2010, 7:59:33 AM8/3/10
to asciidoc
> http://code.google.com/p/asciidoc/source/detail?r=75fc6db5716a737ed7b...

Great! This is exactly the functionality I was looking for. In the
meantime, here is what I did so that, indeed, docbook was not
affected:

:numbered!:

ifdef::basebackend-docbook[]
[preface]
endif::basebackend-docbook[]
ifdef::basebackend-html[]
[float]
endif::basebackend-html[]
== Introduction

// ... Some text...

ifdef::basebackend-html[]
[float]
endif::basebackend-html[]
=== A word on build systems

// ... This section content...

:numbered:

// And here go the numbered chapters

----------------

I will try out this asap.

Thanks,
Lionel

Lionel

unread,
Aug 4, 2010, 10:42:36 AM8/4/10
to asciidoc
Hi Stuart,

it works perfectly, thanks a lot.

regards,
Lionel

On 3 août, 02:51, Stuart Rackham <srack...@gmail.com> wrote:
> http://code.google.com/p/asciidoc/source/detail?r=75fc6db5716a737ed7b...
Reply all
Reply to author
Forward
0 new messages