La Te XReport Renderer
A ksl.utilities.io.report.visitor.ReportVisitor that renders a ReportNode tree to a LaTeX source file (.tex).
Extends AbstractReportVisitor and overrides only the nodes it handles; unrecognised nodes are silently skipped (no-op from the base class).
Preamble (emitted in enterDocument):
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{booktabs}
\usepackage{longtable}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{geometry}
\geometry{margin=1in}
\title{…}
\date{\today}
\begin{document}
\maketitleNode rendering:
ReportNode.Document — full LaTeX preamble +
\maketitle;\end{document}on exitReportNode.Section —
\section,\subsection,\subsubsection(depth-promoted)ReportNode.Heading — mapped to
\section…\subsubsectionbylevelReportNode.Paragraph — verbatim text + blank line
ReportNode.StatTable —
StatisticReporter.halfWidthSummaryReportAsLaTeXTableswrapped in atable+captionenvironment; detail=true appends a second tabular for diagnostic fieldsReportNode.WeightedStatTable — manually constructed
longtablewith all weighted-statistic columnsReportNode.DataTable —
longtablewith first columnl, remaining columnsrReportNode.PlotNode — saves PNG to RenderContext.plotDir; emits
figureenvironment with\includegraphicsand\captionReportNode.RawText —
verbatimenvironmentReportNode.PageBreak —
\newpage
LaTeX escaping: all user-supplied strings are passed through escapeLaTeX which escapes the ten special LaTeX characters (\ { } $ & # ^ _ % ~).
All mutable state uses the my prefix per KSL coding conventions.
Parameters
the render context supplying output paths and formatting preferences
Functions
Writes the accumulated LaTeX source to the given PrintWriter.