latex-renderer

latex-renderer is a cursor rule for Cursor from Intrafere/MOTO-Autonomous-ASI. It costs 16 tokens per session (2,881 once invoked), scanned A, original, MIT.

A renderer that converts LaTeX, a text format commonly used for mathematics and technical documents, into formatted web content.

In plain words
What is it for?
It is for displaying equations, tables, headings, lists, and other supported LaTeX content safely, including documents large enough to require chunked rendering.
Why use it?
It makes mathematical and large technical documents readable in a browser while sanitizing untrusted AI-generated output to reduce the risk of harmful web code running.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit It is for displaying equations, tables, headings, lists, and other supported LaTeX content safely, including documents large enough to require chunked rendering.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/intrafere/moto-autonomous-asi/latex-renderer
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/Intrafere/MOTO-Autonomous-ASI

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for latex-renderer

README.md
[![agentmods](https://agentmods.dev/badge/rules/intrafere/moto-autonomous-asi/latex-renderer/github.svg)](https://agentmods.dev/rules/intrafere/moto-autonomous-asi/latex-renderer)
Your own site
<a href="https://agentmods.dev/rules/intrafere/moto-autonomous-asi/latex-renderer"><img src="https://agentmods.dev/badge/rules/intrafere/moto-autonomous-asi/latex-renderer/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for latex-renderer

Your own site · 80×15
<a href="https://agentmods.dev/rules/intrafere/moto-autonomous-asi/latex-renderer"><img src="https://agentmods.dev/badge/rules/intrafere/moto-autonomous-asi/latex-renderer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 16 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,881 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00016 $0.02881
Opus 5 $0.00008 $0.01440
Sonnet 5 $0.00003 $0.00576
Haiku 4.5 $0.00002 $0.00288

Measured 9d ago against content hash f63e6b2f001a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

latex-renderer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/latex-renderer.mdc · 190 lines

How it starts

The opening of the file, as written. The whole thing — 190 lines — stays where its author put it; the contents beside it link to each section on GitHub.

LaTeX Renderer System

🔒 CRITICAL SECURITY REQUIREMENTS

DOMPurify sanitization MUST be active in LatexRenderer.jsx. Processes untrusted LLM output — XSS risk without it.

Required implementation:

  • import DOMPurify from 'dompurify'; in LatexRenderer.jsx
  • DOMPURIFY_CONFIG constant defined (see below)
  • renderedHtmlSmall useMemo (single chunk) and per-chunk renderedHtml useMemo both call DOMPurify.sanitize() AFTER renderLatexToHtml()
  • dangerouslySetInnerHTML receives ONLY sanitized HTML

DOMPurify Configuration (REQUIRED)

const DOMPURIFY_CONFIG = {
  ALLOWED_TAGS: [
    'div', 'span', 'p', 'br', 'hr', 'strong', 'b', 'em', 'i', 'u', 's', 'sub', 'sup', 'small',
    'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'ul', 'ol', 'li', 'dl', 'dt', 'dd',
    'table', 'thead', 'tbody', 'tr', 'th', 'td',
    'math', 'semantics', 'mrow', 'mi', 'mo', 'mn', 'msup', 'msub', 'mfrac', 'mroot', 
    'msqrt', 'mtext', 'mspace', 'mtable', 'mtr', 'mtd', 'annotation', 'annotation-xml',
    'svg', 'path', 'line', 'rect', 'circle', 'g', 'use', 'defs', 'clippath',
  ],
  ALLOWED_ATTR: [
    'class', 'id', 'title', 'style',
    'mathvariant', 'encoding', 'xmlns', 'displaystyle', 'scriptlevel',
    'columnalign', 'rowalign', 'columnspacing', 'rowspacing', 'stretchy',
    'symmetric', 'fence', 'separator', 'lspace', 'rspace', 'accent',
    'accentunder', 'movablelimits', 'minsize', 'maxsize', 'width', 'height',
    'd', 'viewBox', 'preserveAspectRatio', 'fill', 'stroke', 'stroke-width',
    'transform', 'x', 'y', 'dx', 'dy', 'x1', 'y1', 'x2', 'y2', 'r', 'cx', 'cy',
    'href', 'xlink:href', 'clip-path',
  ],
  ALLOW_DATA_ATTR: false,
  ALLOW_ARIA_ATTR: false,
  FORBID_TAGS: ['script', 'iframe', 'object', 'embed', 'form', 'input', 'button', 'textarea', 'select', 'option', 'link', 'style', 'base', 'meta'],
  FORBID_ATTR: ['onerror', 'onclick', 'onload', 'onmouseover', 'onfocus', 'onblur', 'onchange', 'onsubmit', 'onkeydown', 'onkeyup', 'onmousedown', 'onmouseup'],
  SANITIZE_DOM: true,
};

Read the full file on GitHub · 190 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 190 lines · 16 tokens per session scan A f63e6b2f001a

Subscribe to this mod's changes

latex-renderer is a cursor rule published in the GitHub repository Intrafere/MOTO-Autonomous-ASI (83 stars, last pushed 5d ago), licensed MIT. It adds 16 tokens to every session and 2,881 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.