@openexam/render-latex
v0.1.0
Published
OEAST to LaTeX renderer for the print path (spec 0.1).
Readme
@openexam/render-latex
OEAST → LaTeX renderer for the print path. Produces LaTeX source
ready for latexmk (or pdflatex / lualatex / xelatex) to
compile to PDF. Dispatches Directive nodes to per-addon adapters
that emit the PrintFragment IR
(ADR-015); the renderer
converts the IR to LaTeX.
Public API
import { renderLatexBody, renderLatexDocument } from '@openexam/render-latex';
const adapter = {
render(directive, ctx) {
const params = parseMc(directive);
return mcWidget.print.render(params, ctx);
},
};
const registry = { 'response:mc': adapter };
const body = renderLatexBody(doc, { widgetRegistry: registry });
const tex = renderLatexDocument(doc, { widgetRegistry: registry });Document template
renderLatexDocument ships a default A4 template with sensible
defaults: \documentclass[11pt,a4paper]{article}, T1 fonts,
2.5 cm margins, parskip for blank-line paragraph breaks, and
\maketitle from the assignment frontmatter title. Adapters may
declare extra preamble lines that the renderer collects and
inserts in document order.
L-mark corner-registration drawing is not yet wired in 0.1 — the print template carries a placeholder comment for the M5 addition (see ADR-015 §D23). The output compiles and prints correctly today; what changes in M5 is only the geometry block.
License
Apache-2.0. See LICENSE and the repository root
../../LICENSE.
