def get_latex_table(self, get_stats=None):
"""Get LaTeX code string for group-by table of stats values
:param list get_stats: same as ArrayStats.get_latex_table get_stats key word.
:returns str: LaTeX code snippet
"""
# Explicitly strip the tables of their LaTeX headers and footers, concatenate the strings with a group-header
# and reattach the LaTeX header and footer so that it parses to proper LaTeX.
self.table = []
for group_key in sorted(self.stats_obj.keys()):
s = self.stats_obj.get(group_key).get_latex_table(get_stats=get_stats, latex=False)
self.table = self.table + [[group_key]] + s # The double list is needed for proper latex parsing
if len(self.table) > 25:
self.log().warning('The table is longer than 25 rows, the latex file will overflow.')
return tabulate.tabulate(self.table, tablefmt='latex')
评论列表
文章目录