+ def texi (self, string):
+ return (self.texi_header
+ + self.html ('''
+<style type="text/css"><!--
+th { border: 1px solid black; text-align: center; }
+td { border: 1px solid black; text-align: center; }
+!--></style>
+''')
+ + self.columnfraction_disaster (self.itemtab_disaster (string))
+ + self.texi_footer)
+ def itemtab_disaster (self, string):
+ return string.replace ('''item \n@tab ''', '''item
+''')
+ def columnfraction_disaster (self, string):
+ if False:
+ # nice trick for html-only
+ return string.replace ('@multitable', '@multitable @columnfractions 0 0 0 0 0 0 0 0 0 0')
+ tables = re.findall ('(?s)(@multitable)(.*?)(@item)', string)
+ for t in tables:
+ columns = len (re.findall ('(?s)(\n@tab)', t[1])) + 1
+ columnfractions = '@columnfractions ' + (' ' + str (1.0/columns)) * columns
+ string = string.replace ('@multitable\n',
+ '@multitable %(columnfractions)s\n' % locals (), 1)
+ return string