Esempio n. 1
0
 def get_text(self, client, node, replaceEnt):
     mf = math_flowable.Math(node.get('latex', ''))
     w, h = mf.wrap(0, 0)
     descent = mf.descent()
     img = mf.genImage()
     client.to_unlink.append(img)
     return '<img src="%s" width=%f height=%f valign=%f/>' % (img, w, h,
                                                              -descent)
Esempio n. 2
0
 def gather_elements(self, client, node, style):
     mflow = math_flowable.Math(node.get('latex', ''),
                                node.get('label', None))
     n = node['number']
     if n is not None:
         number = '(%s)' % node['number']
         return [Table([[mflow, number]], )]
     return [mflow]
Esempio n. 3
0
 def gather_elements(self, client, node, style):
     if not node.fontsize:
         node.fontsize = style.fontSize
     if not node.color:
         node.color = style.textColor.rgb()
     return [
         math_flowable.Math(node.math_data, node.label, node.fontsize,
                            node.color)
     ]
 def get_text(self, client, node, replaceEnt):
     #get style for current node
     sty=client.styles.styleForNode(node)
     node_fontsize=sty.fontSize
     node_color='#'+sty.textColor.hexval()[2:]
     mf = math_flowable.Math(node.math_data,label=node.label,fontsize=node_fontsize,color=node_color)
     w, h = mf.wrap(0, 0)
     descent = mf.descent()
     img = mf.genImage()
     client.to_unlink.append(img)
     return '<img src="%s" width=%f height=%f valign=%f/>' % (
         img, w, h, -descent)
Esempio n. 5
0
 def gather_elements(self, client, node, style):
     return [math_flowable.Math(node.math_data,node.label)]