A developer prototype creates a LaTeX renderer inspired by Tiny Little Office, the new web app suite from Paul Ford and Aboard Foundary. The key idea is to store LaTeX source in the URL fragment (#fragment), so each rendered document becomes a bookmarkable, shareable link.
Purpose and how it works
The prototype implements a tool with these behaviors:
- accept a #fragment that contains LaTeX code and render it effectively;
- support a prefix that indicates the LaTeX is compressed with a custom compression dictionary optimized for LaTeX;
- if the page is loaded without a fragment, show an editor where users can paste LaTeX and toggle to a "rendered" view; that rendered view should be bookmarkable;
- allow switching back to source edit mode from the #fragment view.
The developer used the Claude model (Claude Code, Opus 5.5 Extra) to generate the implementation and shared the prompt sequence specifying fragment-hash handling, compression prefix, use of a CDN or WebAssembly LaTeX renderer, editor/render toggle, etc.
Security — iframe sandboxing and XSS protection
The project borrows the iframe sandbox mechanism from the existing "SVG in Markdown" tool to reduce XSS risks. The prototype proposes running the renderer inside a sandboxed iframe to isolate execution.
In addition, the implementation uses DOMPurify to sanitize DOM output, providing further protection against embedded malicious content.
Loading from URLs and Gists
The developer copied the Gist/URL loading feature from the Markdown/SVG tool: the LaTeX renderer can fetch LaTeX source from external URLs or GitHub Gists, offering an alternative to embedding code in the fragment.
Libraries and versions used
The prototype uses the following libraries and versions:
- Pako 2.1.0 (for compression/decompression),
- MathJax 4.1.3 (for rendering LaTeX),
- faster-latex 0.3.1 (likely for parsing/optimizing LaTeX),
- DOMPurify 3.4.16 (for DOM sanitization against XSS).
Examples and notes
The developer references an example link and their tools repository where parts of the solution were already functioning. The combination of fragment-based sharing, optional compression prefix, iframe sandboxing and Gist/URL loading aims to balance ease of sharing with security.
Tags
latex, paul-ford, tools, urls, ai, generative-ai, llms



