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 a Builder that accepts custom TexNodeRendererFactory instances. Internally creates a RendererContext that manages a NodeRendererMap for 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 Appendable that provides LaTeX-specific output conveniences: line() for newlines, whitespace() for non-doubled spaces, and writeStripped(String) for collapsed whitespace.
TexNodeRendererFactory
A functional interface (single method create) for producing NodeRenderer instances given a TexNodeRendererContext.
TexNodeRendererContext
Interface providing renderers with access to the TexWriter, the stripNewlines flag, and the ability to recursively render(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)
 
See Also: