AI-generated text
Prototype LaTeX renderer that encodes source in URL fragment and uses iframe sandboxing
Tools · October 16, 2026

A developer prototype recreates Tiny Little Office’s approach of storing document data in the URL fragment for a LaTeX renderer.
In this article · 6
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
Related articles More from the section.
T3 Code changes its user identification method
The open-source T3 Code project has stopped using Claude and Codex authentication files to identify users and switched to an estimate based on installations.
Tools · November 24, 2026Amateur astronomers find possible signs of planets in public telescope data
Amateur astronomers Kevin Bond and Ethan Byrd independently searched public telescope data for signs of planets orbiting distant stars.
Tools · November 24, 2026Development of an embeddable coding agent core underlies a command-line tool
An unnamed developer tool operates through a command-line interface because it is a thin wrapper built on the libfx library.


