Boost logo

Boost :

Subject: Re: [boost] [quickbook] Template problems
From: Edward Diener (eldiener_at_[hidden])
Date: 2016-04-20 23:00:25


On 4/20/2016 8:14 PM, Nat Goodspeed wrote:
> On Wed, Apr 20, 2016 at 5:35 PM, Edward Diener <eldiener_at_[hidden]> wrote:
>
>> I am seeing these template problems with quickbook using the 'develop' branch:
>>
>> 1) I have a cxxd_templates.qbk file which has this template:
>>
>> [template power[x y] '''[x]<superscript>[y]</superscript>''']
>>
>> I include it first in my main .qbk file as:
>>
>> [include cxxd_templates.qbk]
>>
>> In another .qbk file, which is also included in my main .qbk file after the cxxd_templates.qbk I have:
>>
>> "Despite the fact that there are [power 2..n] possible ..." etc.
>>
>> but this shows up as is:
>>
>> "Despite the fact that there are [power 2..n] possible ..." etc.
>>
>> If I just put the template at the top of that other .qbk file instead the expansion actually takes place. Why is this ? Is not the template global to all sections of the doc after it is defined somewhere ?
>
> Are template definitions scoped to the containing file? In a project
> to which I'm contributing, global QuickBook template definitions are
> in the top-level file, the one that includes all the rest of the
> sections.

You are right. I thought Quickbook template definitions were global to
the entire Quickbook source which comes after them, but that is not the
case. They are only global to what comes after them within the .qbk file
in which they reside.

>
>> 2) The template above when expanded via [power 2..n] shows x with y superscripted rather than 2 with n superscripted. Why is this and how do I get it to work properly ?
>
> My guess would be that you escaped to DocBook too quickly: the [x] and
> [y] are in the DocBook section rather than being expanded by
> QuickBook.

You are right again.
[template power[x y] [x]'''<superscript>'''[y]'''</superscript>''']
works. Thanks for your help !


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk