LATEX
SERVICE CONTRACT · VIEW: GOV
Axiom
LATEX IS A COMPILED SURFACE. GOVERNANCE LIVES IN MARKDOWN. NO RAW LATEX IN GOV LAYER.
Constraints
MUST: Compile from governed Markdown — .md is the source of truth MUST: Emit LaTeX as an intermediate surface — never as source MUST: Produce deterministic PDF output — same source = same output MUST: Reject prohibited content at compile time — fail loud, not silent MUST: Resolve all citation codes ([X-n], [W-n], [B-n], etc.) to bibliography entries before PDF emit — no raw markdown references in output MUST: Scale to book-length documents (100K+ words) — chunked compilation or extended timeout, not silent truncation MUST: Papers compile to 2-column format (article class). Books compile to 1-column format (report class). No format drift. MUST: Zero markdown syntax leak in PDF output — all tables, links, emphasis, code blocks must render as LaTeX, not raw markdown MUST NOT: Store raw LaTeX in governance layer MUST NOT: Hand-edit compiled outputs (.tex, .pdf) MUST NOT: Bypass the pipeline — GOV → SURFACE → OUTPUT, no shortcuts MUST NOT: Silently truncate or skip content on compilation failure — fail loud with error, or compile fully
Capabilities
CONTENT_VALIDATE, LATEX_EMIT, MARKDOWN_COMPILE, PDF_GENERATE
COVERAGE: 255/255
SPEC
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:
- Read governed Markdown (headings, tables, math, citations)
- Apply scope-specific LaTeX template (paper, book, patent)
- Emit clean LaTeX from governed source
- 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
- Governed Markdown MUST be pure Markdown — zero embedded LaTeX after pipeline is built.
- Raw
{=latex}blocks are TRANSITIONAL — they exist only until the compiler pipeline covers the use case. - The compiler reads Markdown tables and emits LaTeX environments per template.
- The compiler enforces scope governance — prohibited content rejected at compile time.
- PDF output MUST be artifact-ready without manual LaTeX editing.
Ecosystem Connectivity
- Upstream:
SERVICESgovernance contracts and scope inheritance. - Downstream: PATENT, PAPER, BOOK scopes inherit LATEX for PDF compilation.
- Frontend:
paper.htmlandbook.htmllayouts link to compiled PDFs viapdf:front matter. - 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
INTEL
Scope Intelligence
| Dimension | Value |
|---|---|
| Subject | LaTeX compilation service — GOV (.md) → SURFACE (.tex via pandoc) → OUTPUT (.pdf via xelatex) |
| Audience | Build pipeline, paper authors, book authors, deck publishers |
| Sources | Pandoc documentation, XeLaTeX engine, canonic-paper.tex template, canonic-book.tex template |
| Status | ACTIVE — compiles all PAPER and BOOK scopes to PDF |
| Pipeline | Markdown → pandoc (–pdf-engine=xelatex) → PDF + PDF.js viewer (3.11.174) + KaTeX (0.16.21) |
| Voice | Infrastructure-precise. Same input always produces same output. Deterministic compilation. |
Evidence Chain
| Layer | Source | Count | Status |
|---|---|---|---|
| 1 | Pandoc markdown-to-LaTeX compiler | 1 | INSTALLED |
| 2 | XeLaTeX typesetter | 1 | INSTALLED |
| 3 | canonic-paper.tex (12pt article class) | 1 | ACTIVE |
| 4 | canonic-book.tex (12pt report class) | 1 | ACTIVE |
| 5 | PDF.js 3.11.174 (CDN viewer) | 1 | LIVE |
| 6 | KaTeX 0.16.21 (math rendering) | 1 | LIVE |
Compilation Matrix
| Input Type | Template | Engine | Output | Viewer |
|---|---|---|---|---|
| PAPER (.md) | canonic-paper.tex | xelatex | PDF.js canvas | |
| BOOK (.md) | canonic-book.tex | xelatex | PDF.js canvas | |
| DECK (.json) | Decktape (browser) | Puppeteer | download | |
| DECK (.json) | pptxgenjs (Node) | direct | .pptx | download |
Cross-Scope Connections
| Service | Role |
|---|---|
| PAPER | Paper compilation — .md → .pdf via canonic-paper.tex |
| BOOK | Book compilation — .md → .pdf via canonic-book.tex |
| DECK | Deck export — PDF (Decktape) + PPTX (pptxgenjs) |
| TALK | Conversation engine — compilation status and pipeline Q&A |
| *INTEL | LATEX | CROSS-AXIOMATIC BRIDGE* |
LEARNING
Discoveries
-
2026-02-25: LATEX promoted from PATENTS/LATEX.md to SERVICES/LATEX/. The pipeline is not patent-specific — it governs any .md → .pdf compilation. PATENT, PAPER, BOOK all inherit from one service. Zero duplication.
-
2026-02-25: The original PATENTS/LATEX.md already scored 255. The pipeline pattern (GOV → SURFACE → OUTPUT) and the axiom (governance in Markdown, never in LaTeX) are universal. Patent-specific rules (prohibited columns, USPTO formatting) stay in PATENTS/ scope — LATEX service governs only the generic pipeline.
ROADMAP
VOCAB
| Term | Definition |
|---|---|
| OUTPUT | The PDF artifact. Compiled from SURFACE. Filed or downloaded. |
| SURFACE | The LaTeX intermediate. Compiled from GOV, never authored directly. |
INHERITANCE CHAIN
SERVICES
SERVICES compose primitives — INTEL + CHAT + COIN. Every service governed. Every scope discovered.
MUST: Maintain TRIAD integrity (CANON.md + VOCAB.md + README.md)
MUST: Treat SPEC as scope identity (`{SCOPE}` directory), not as a file
MUST: Every SERVICE scope include ROADMAP.md, COVERAGE.md, LEARNING.md, and `{SCOPE}.md` as governed content surfaces
MUST: Discover SERVICE scopes from filesystem only (no manual catalog)
MUST: Keep http:// and magic:// on the same namespace (transport differs, scope path matches)
MUST: CANON.md = axiom + universal constraints (no service names, no paths, no implementation)
MUST: README.md = how to run the CANON (nothing else)
MUST: {SCOPE}.md = SPEC — the interface (purpose, routes, projections, ecosystem)
MUST: SHOP.md = public projection file (per scope, filesystem-discoverable)
MUST: VAULT.md = private projection file (per scope, filesystem-discoverable)
MUST: Runtime implementation remains under ~/.canonic; this workspace is governance-first
MUST NOT: Hardcode service names in CANON constraints (law speaks universals)
MUST NOT: Define ungoverned terms outside VOCAB.md
MUST NOT: Treat `{SCOPE}.md` as SPEC identity
MUST NOT: Move architecture/lifecycle into README
MUST NOT: Leak private projections to public surfaces
MUST NOT: Maintain duplicate mapping tables outside generated manifest outputs
MUST NOT: Add runtime jargon to governance contracts
MUST: Ledger-consuming services declare source ledgers, scope filters, and closure gates
MUST: Learning governance remains live — closure claims require fresh DISCOVER → GENERATE → RELINK evidence
hadleylab-canonic
HADLEYLAB ships software. Every app, book, paper, deal, and patent is PROOF that MAGIC works. COIN = WORK. LEARNING = COMPUTE.
MUST: Every app, book, paper, deal, or patent is evidence of MAGIC MUST: All scopes inherit canonic-canonic/CANONIC.md governance MUST: All users governed under USERS/ via SERVICES/USER MUST: Cross-index INTEL across users (INTEL.md) MUST: Shared events propagate to ALL affected user dashboards MUST: Maintain governance workspace purity (.md files only) MUST: Ledger all COIN (validated work) through MAGIC 255 MUST: Compile all INTEL from governed sources MUST: Keep frontend/runtime implementation under ~/.canonic (hidden runtime) MUST: Surface governed TALK, Library, and SERVICES scopes (no orphan content) MUST: Derive nav labels from governed scope names (no hardcoded strings) MUST NOT: Publish without governance (CANON.md required) MUST NOT: Duplicate primitives — compose from INTEL, CHAT, COIN MUST NOT: Silo intelligence inside a single user when multiple are affected MUST NOT: Expose VAULT contents outside NDA scope MUST NOT: Store runtime artifacts in governance workspace
canonic-canonic
SPEC is governance. `canonic-canonic/` is the spec root.
MUST: Keep this repo governance-only (.md/.pdf) MUST: Publish workspace mapping in CANONIC.git (no hardcoded repo lists) MUST: Preserve three primary lanes: FOUNDATION, INDUSTRIES, MAGIC MUST NOT: Commit runtime artifacts here (runtime belongs in ~/.canonic/) MUST: Sell MAGIC tiers — the product, not the proof (proof is hadleylab-canonic) MUST NOT: Embed beta-test app URLs in platform page content