def gather_elements(self, client, node, style):
# Either use the figure style or the class
# selected by the user
st_name = 'figure'
if node.get('classes'):
st_name = node.get('classes')[0]
style=client.styles[st_name]
cmd=getattr(style,'commands',[])
image=node.children[0]
if len(node.children) > 1:
caption = node.children[1]
else:
caption=None
if len(node.children) > 2:
legend = node.children[2:]
else:
legend=[]
w=node.get('width',client.styles['figure'].colWidths[0])
cw=[w,]
sub_elems = client.gather_elements(node, style=None)
t_style=TableStyle(cmd)
table = DelayedTable([[e,] for e in sub_elems],style=t_style,
colWidths=cw)
table.hAlign = node.get('align','CENTER').upper()
return [MySpacer(0, style.spaceBefore),table,
MySpacer(0, style.spaceAfter)]
评论列表
文章目录