Boost logo

Boost :

Subject: Re: [boost] [quickbook] Controling the layout of table columns in docbook/fo output
From: Andreas Pokorny (andreas.pokorny_at_[hidden])
Date: 2012-03-18 12:29:33


Hi,

Am 18. März 2012 14:09 schrieb Daniel James <dnljms_at_[hidden]>:
>>> [...]
>>> Is there a yet undocumented way to control column sizes?
>
> No, if you want greater control over tables you need to write them in
> docbook, which can be embedded in quickbook:
>
> http://www.boost.org/doc/libs/1_49_0/doc/html/quickbook/syntax/phrase.html#quickbook.syntax.phrase.escape
>
> If you can suggest changes to the generated table that avoids this
> warning, it might be possible to improve the output, but we don't use
> fop nowadays (the pdfs are generated using xep) so supporting it isn't
> a priority.

We are kind of locked with fop for now. I played around with something like:

[template col_width[number width]'''<colspec colname="c'''[number]'''"
colnum="'''[number]'''" colwidth="'''[width]'''"/>''']

[table:id A Simple Table
    [col_width 1..3*]
    [col_width 2..*]
    [col_width 3..4*]
    [[Heading 1] [Heading 2] [Heading 3]]
    [[R0-C0] [R0-C1] [R0-C2]]
    [[R1-C0] [R1-C1] [R1-C2]]
    [[R2-C0] [R2-C1] [R2-C2]]
]

Which is a terrible syntax, and does not work either. Depending on
where I put the template invocation, it ends up in the table title or
as a separate row. Or causes a parse error. It orrucred to me that I
cannot write something like:
[mytable:id A clumsy table with size specs
   [[3] [1] [4]]
    [[Heading 1] [Heading 2] [Heading 3]]
    [[R0-C0] [R0-C1] [R0-C2]]
    [[R1-C0] [R1-C1] [R1-C2]]
    [[R2-C0] [R2-C1] [R2-C2]]
]

[template mytable[title colspec ...]
'''<table '''[if id ['''id="'''[id]'''"][]'''>
   <title>'''[titlte]'''</title>
   <tgroup cols="''[count [arg_0]]'''"/
   [foreach [item] in [colspec] '''<colspec colname="c'''[index]'''"
colnum="'''[item]'''" colwidth="'''[item]'''"/>''']
   [unrollrows [args]]
  </tgroup>
   </table>''']
[template unlrollrows[] ]
[template unlrollrows[row ...]
  '''<row>[foreach [item] in [row] '''
<entry>'''[item]'''</entry>''']'''</row>'''
  [unrollrows [args]]
]


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