On 29 July 2015 at 04:10, Gary Funck <[email protected]> wrote:
>
> Asciidoc version: asciidoc-8.6.8-3.fc20.noarch
>
> See attached.
>
> I tried to define a conditional attribute, {td},
> that would expand as a period ('.') when using the PDF backend.
> My purpose for doing this was to add a '.' after
> a <block title>, because the generated HTML had them,
> but the generated PDF (dblatex backend) did not.
>
> The file, sciidoc-backend-conditional.png, shows the expected output.
>
> The only difference between the two files is the
> placement of the definition of {td}.
>
> It seems that this definition of {td} which is conditional
> on the backend did not set {td} if that definition is in
> the document header. Moving it into the beginning of
> a section did work, however.
>
> - Why didn't it work in the document header?
The {basebackend} attribute is defined in the configuration for the
backend, eg xhtml-11 defines basebackend=html.
But to allow the user to define the backend in the file, the
configuration for the backend is not loaded until after the header is
parsed and attributes calculated, so basebackend is not set during the
header.
>
> - Is there a better way to handle this?
The "official" way is to teach your toolchain to add the dot, so you
don't have to remember it. If you find teaching the toolchain too
much of a pain and want to continue this way you could test backend,
it should be defined in the header. Or define td on the command line
as empty or dot in your makefile/build script.
Cheers
Lex
>
> thanks,
> - Gary
>
> --
> 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.
> For more options, visit https://groups.google.com/d/optout.
--
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.
For more options, visit https://groups.google.com/d/optout.