Package atessera.markdown.tex
package atessera.markdown.tex
Provides a standalone LaTeX rendering pipeline for Markdown ASTs.
This package implements a complete LaTeX renderer that is independent of commonmark-java's built-in HTML renderer. It processes the full Markdown AST (both standard and custom nodes) and produces LaTeX source suitable for inclusion in a full document.
Key classes
TexRenderer- The top-level renderer implementing
Renderer. Built via aBuilderthat accepts customTexNodeRendererFactoryinstances. Internally creates aRendererContextthat manages aNodeRendererMapfor dispatching nodes to the appropriate renderer. CoreRenderer- Handles all standard Markdown nodes (Document, Heading,
Paragraph, lists, emphasis, code, links, images, etc.) and
converts them to LaTeX. This is the workhorse of the rendering
pipeline. Registered as the last (fallback) node renderer
factory in
TexRenderer. TexWriter- A lightweight wrapper around an
Appendablethat provides LaTeX-specific output conveniences:line()for newlines,whitespace()for non-doubled spaces, andwriteStripped(String)for collapsed whitespace. TexNodeRendererFactory- A functional interface (single method
create) for producingNodeRendererinstances given aTexNodeRendererContext. TexNodeRendererContext- Interface providing renderers with access to the
TexWriter, thestripNewlinesflag, and the ability to recursivelyrender(Node)child nodes.
Rendering pipeline
TexRenderer.render(Node, Appendable)
│
▼
RendererContext.render(Node)
│
▼
NodeRendererMap.render(Node)
│
├──► TexNodeRenderer (custom nodes: headings, math, labels, refs, bib items)
│
└──► CoreRenderer (standard nodes: paragraphs, lists, code, emphasis, links, images)
│
▼
TexWriter (buffered LaTeX output)
-
ClassDescription