def generateReport(tableGenerator): report = reporting.ReportPDF() report.add(reporting.color_scheme_gray_light.toBlockLatex()) verticalBorder_list = [0, 1, 2] horizontalBorder_list = [0, 1, 2] useBooktabs_list = [False, True] for ub in useBooktabs_list: sec1 = reporting.SectionRelative("useBooktabs={0}".format(ub)) report.add(sec1) # report.add(reporting.BlockLatex(r"\bigskip")) for hb in horizontalBorder_list: sec2 = reporting.SectionRelative("horizontalBorder={0}".format(hb)) sec1.add(sec2) report.add(reporting.BlockLatex(r"\bigskip\bigskip")) for vb in verticalBorder_list: subsec = reporting.SectionRelative("verticalBorder={2}".format( ub, hb, vb)) subsec.add( tableGenerator(verticalBorder=vb, horizontalBorder=hb, useBooktabs=ub)) subsec.add(reporting.BlockLatex(r"\bigskip")) sec2.add(subsec) return report
def get_content_of_subsections(subsects): content = [] vspace = reporting.BlockLatex(r"\vspace{0.75cm}"+"\n") for title, table, cs in subsects: if isinstance(cs, reporting.ColorScheme3): cs = cs.toBlockLatex() sub = reporting.SectionRelative(title, contents=[cs, reporting.BlockLatex(table + "\n"), vspace]) content.append(sub) return content
def get_content_of_subsections(subsects): content = [] vspace = reporting.BlockLatex(r"\vspace{0.75cm}" + "\n") for title, table, cs in subsects: sub = reporting.SectionRelative( title, contents=[cs, reporting.BlockLatex(table + "\n"), vspace]) content.append(sub) return content