LATEX

LATEX

LATEX IS A COMPILED SURFACE. GOVERNANCE LIVES IN MARKDOWN. NO RAW LATEX IN GOV LAYER.

Purpose

LATEX is the compiled surface for governed PDF output.

Any scope that produces PDFs inherits LATEX. The pipeline is universal: governed Markdown compiles to LaTeX, LaTeX compiles to PDF. The governance lives in Markdown. The surface lives in LaTeX. The output lives in PDF. Nothing else.


Pipeline

GOV (.md)  →  SURFACE (.tex)  →  OUTPUT (.pdf)
  ↑               ↑                  ↑
source of       compiled by        filed /
truth           pandoc + xelatex   downloaded

Markdown is the source of truth. LaTeX is compiled from it. PDF is the output artifact.


Compilation

{SOURCE}.md → pandoc (template) → {SOURCE}.tex → xelatex → {SOURCE}.pdf
                  ↑
            LATEX service governs
            what pandoc emits

The compiler MUST:

  1. Read governed Markdown (headings, tables, math, citations)
  2. Apply scope-specific LaTeX template (paper, book, patent)
  3. Emit clean LaTeX from governed source
  4. Produce filing/download-ready PDF without manual editing

Template Contract

Scopes that inherit LATEX provide their own template:

Scope Template Output
PATENT patent template (longtable, USPTO formatting) Filing-ready PDF
PAPER academic template (abstract, TOC, citations, appendices) Download-ready PDF
BOOK book template (cover, PARTS, CHAPTERS, TOC) Download-ready PDF

Templates are pandoc .tex templates stored in _latex/ at the scope root.


Surface Rules

  1. Governed Markdown MUST be pure Markdown — zero embedded LaTeX after pipeline is built.
  2. Raw {=latex} blocks are TRANSITIONAL — they exist only until the compiler pipeline covers the use case.
  3. The compiler reads Markdown tables and emits LaTeX environments per template.
  4. The compiler enforces scope governance — prohibited content rejected at compile time.
  5. PDF output MUST be artifact-ready without manual LaTeX editing.

Ecosystem Connectivity

  1. Upstream: SERVICES governance contracts and scope inheritance.
  2. Downstream: PATENT, PAPER, BOOK scopes inherit LATEX for PDF compilation.
  3. Frontend: paper.html and book.html layouts link to compiled PDFs via pdf: front matter.
  4. Toolchain: pandoc + xelatex — same tools, different templates per scope.

Constraints

MUST:     Every inheriting scope provides a pandoc template
MUST:     Templates use DESIGN tokens for branding (fonts, colors, spacing)
MUST:     PDF output is deterministic — same .md source = same .pdf output
MUST:     Compiler rejects prohibited content at compile time
MUST NOT: Store .tex or .pdf in governance layer — they are compiled outputs
MUST NOT: Hand-edit any compiled artifact

*LATEX SPEC SERVICES*
TALK AUTO