On 24 May 2013 11:11, Dan Allen <[email protected]> wrote:

> Ah, I think I understand what's going on now.
>
> As Lex mentioned, when you omit the title, it's still making an example
> block, it's just not getting labeled as an example block (so it might
> appear like it's just a regular paragraph). If you look at the source code
> generated, you'll see it does use an example element variant in both cases.
>

Well, to be exact its making an <informalexample> entity if there is no
title.  If I read the docbook schema right <example> must have a <title>,
<informalexample> must not have a <title>.  Hence the distinction.  An
example without a title is illegal docbook and should make xmllint complain.

Your trick below of using a zwsp as the title is fine if you still want the
"Example." visible, or you could figure out how to get the PDF toolchains
to not produce it.  In which case it might just as well be possible to
format <informalexample> instead.



>
> What this really seems to be about is having an example *caption* without
> an example *title*. AsciiDoc (and the DocBook toolchain) only adds a
> caption (e.g., Example 1) when the example block has a title (the same goes
> for other types of blocks).
>
> There are a few approaches to getting the caption without a title.
>
> Approach #1: Trick AsciiDoc/DocBook into thinking there is a title using a
> space character
>
> .{zwsp}
> ====
> example block content
> ====
>
> This should appear as:
>
> *Example 1.*
> example block content
>
> Approach #2: Use the title to output the caption
>
> .{example-caption} {counter:example-number}.
> ====
> example block content
> ====
>
> This should also appear as:
>
> *Example 1.*
> example block content
>
> These workarounds are necessary because you are working around the
> convention that a caption (e.g., Example 1) should only be used when there
> is also a title.
>
> The final option is to customize the template in the backend so that it
> always uses the caption even in the absence of a title. See the html5.conf
> or docbook45.conf files for the template you need to customize.
>

Unless you embed your {zwsp} trick there is not much you actually can do
whilst still generating legal docbook due to the annoying restrictions on
the use of <title>.

There should be no need to modify either xhtml11.conf or html5.conf since
(at least for me) they both render untitled examples fine.  Unless you want
to generate the "Example 1." dropping, so HTML and PDF look more similar
(ie both bad IMHO :).

Cheers
Lex




>
> -Dan
>
>
>
> On Thu, May 23, 2013 at 5:13 PM, Eduardo Santana 
> <[email protected]>wrote:
>
>> Hi Dan,
>>
>> I know the title is optional, but when I don't use it, it doesn't turn
>> into an example block.
>>
>>
>> ====
>> Qui in magna commodo, est labitur dolorum an. Est ne magna primis
>> adolescens.
>> ====
>>
>> .This box turns into an example because it has a title.
>> ====
>> Qui in magna commodo, est labitur dolorum an. Est ne magna primis
>> adolescens.
>> ====
>>
>>
>> My question is, how can I create an example box without using the title...
>>
>> It should be only Example 1...
>>
>> Em quinta-feira, 23 de maio de 2013 19h03min30s UTC-3, Dan Allen escreveu:
>>>
>>> Yep, that's allowed. The block title is optional on all delimited blocks.
>>>
>>> -Dan
>>>
>>>
>>> On Thu, May 23, 2013 at 2:19 PM, Eduardo Santana <[email protected]>wrote:
>>>
>>>> At  
>>>> http://www.methods.co.nz/**asciidoc/userguide.html#X48<http://www.methods.co.nz/asciidoc/userguide.html#X48>we
>>>>  can see how to create example blocks.
>>>>
>>>> But how can we create it without having to put a title?
>>>>
>>>> .An example
>>>> ==============================**==============================**=========
>>>> Qui in magna commodo, est labitur dolorum an. Est ne magna primis
>>>> adolescens.
>>>> ==============================**==============================**=========
>>>>
>>>> Not an example:
>>>>
>>>> ==============================**==============================**=========
>>>> Qui in magna commodo, est labitur dolorum an. Est ne magna primis
>>>> adolescens.
>>>> ==============================**==============================**=========
>>>>
>>>>
>>>>  --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "asciidoc" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to asciidoc+u...@**googlegroups.com.
>>>> To post to this group, send email to [email protected].
>>>>
>>>> Visit this group at 
>>>> http://groups.google.com/**group/asciidoc?hl=en<http://groups.google.com/group/asciidoc?hl=en>
>>>> .
>>>> For more options, visit 
>>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>>> .
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Dan Allen | 
>>> http://google.com/profiles/**dan.j.allen<http://google.com/profiles/dan.j.allen>
>>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "asciidoc" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at http://groups.google.com/group/asciidoc?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>
>
> --
> Dan Allen | http://google.com/profiles/dan.j.allen
>
> --
> You received this message because you are subscribed to the Google Groups
> "asciidoc" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/asciidoc?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"asciidoc" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/asciidoc?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to