def DocumentGenerator( body1: Latex, body2: Latex = null, body3: Latex = null, body4: Latex = null, body5: Latex = null, body6: Latex = null, body7: Latex = null, bibtex: Bibtex = null, abstractText: Latex = null, appendix: Latex = null, title: String = "", authors: String = "", rPackages: String = "", attachConfReport: Boolean = true): PDF = { val citations = if (rPackages == "") null else RConfigurationReport( packages = rPackages).citations val template = LatexTemplate( bibtex1 = bibtex, bibtex2 = citations, docAbstract = abstractText, title = title, authors = authors, printTOC = true) val body = LatexCombiner(body1, body2, body3, body4, body5, body6, body7, appendix) val pdf = LatexPDF( in = body, header = template.header, footer = template.footer, useRefs = true) pdf.out }