1\documentclass[11pt]{article}
2\usepackage{amsmath}
3\usepackage{amssymb}
4\usepackage{xcolor}
5\usepackage{booktabs}
6\usepackage{pgfplots}
7\pgfplotsset{compat=1.17}
8
9\usepackage{telox}
10\teloxsemtrue
11\makeatletter
12\DeclareRobustCommand{\TeLoX}{%
33\makeatother
34\makeatletter
35\DeclareRobustCommand{\KaTeX}{K%
53
54\makeatother
55
56\newcommand{\strikethrough}[1]{\raisebox{1ex}{\underline{\smash{\raisebox{-1ex}{#1}}}}
57}
58
59\newsavebox{\dropbox}
60\newcommand{\dropcap}[1]{%
61 \sbox{\dropbox}{\fontsize{32}{32}\selectfont #1}%
62 \hangindent=\dimexpr\wd\dropbox+0.12em\relax
63 \hangafter=-2%
64 \noindent\llap{\raisebox{-\baselineskip}[0pt][0pt]{\usebox{\dropbox}}\hskip0.12em}%
65}
66
67\title{What If We Just Put \TeX{} In The Browser?}
68\author{eigenblake}
69\date{10 September 2026}
70
71\begin{document}
72
73\maketitle
74
75\dropcap{S}o, computers aren't yet fast enough for us to recompile entire documents with every keystroke in their entirety, so we have to do some interesting tricks to simulate it. To get this degree of interactivity, we're replaying from a ladder of checkpoints, with it taking \teloxreadout{total_ms}{2.4em} ms over \teloxreadout{steps}{3.7em} interpreter steps, of which \teloxreadout{emit_ms}{2.4em} ms wrote the pages you are looking at right now. Far from elagant but it works.
76
77\begin{center}
78[Try typing something here to see what it feels like -- you should get anywhere from 10 - 90 ms per keystroke]
79\end{center}
80
81Also, try interacting with the following -- you'll notice that it's not quite where we want it yet. Better than nothing but far too laggy. That's where optimizations should come in later.
82
83
84\teloxparam{z}{1.35}
85\begin{center}
86\teloxslider{z}{0.5}{2}
87\end{center}
88
89\begin{center}
90\begin{tikzpicture}
91\begin{axis}[xlabel=$x$, ylabel=$y$, width=9cm, height=6cm, view={30*\z}{35}]
92\addplot3[surf, shader=flat, samples=10, domain=-4:4, y domain=-4:4]
93 {sin(deg(x)) + cos(deg(y))};
94\end{axis}
95\end{tikzpicture}
96\end{center}
97\clearpage{}
98\newpage{}
99
100
101\section*{\TeLoX{} is a new tiny humble \LaTeX{} engine}
102
103\TeLoX{} is a small step for publication-grade typesetting \strikethrough{in the browser} \emph{everywhere}. And that includes the web (we are here), video games, e-readers, anything that can print glyphs. Maybe even the moon someday.
104
105It's a research project, and may never evolve beyond that point. The destination is a research paper. The key research goals are establishing bi-directionality between the text and presentation layer. Enabling interactive learning experiences is the long term goal, but what the engine has brought thus far is source attribution to enable selection.
106
107\section*{Formatting isn't the hard part}
108
109A word can be \textbf{bold} or \emph{stressed} or set in \texttt{monospace} or \textcolor{purple}{colored}. For this, scratchpad, I grabbed a subset of the most commmon packages and pre-packaged them. So we can't do \textit{anything}. But we can do lots.
110
111There's a rich text editor in this application (that's not really a part of the research project) that gives you the ability to preview things. Also the ``float'' button gives you a preview that follows your cursor. We have vim mode in this scratchpad as well.
112\section*{A simple interactive plot}
113
114The slider is movable, and this is all running inside the document with only the mouse movement piped in.
115
116\teloxparam{a}{2.00}
117\begin{center}
118\teloxslider{a}{0.5}{2}
119\end{center}
120\[ a = \a \]
121\begin{center}
122\begin{tikzpicture}
123\begin{axis}[xlabel=$x$, ylabel=$y$, width=9cm, height=5cm, ymin=-2.2, ymax=2.2]
124\addplot[domain=0:6.28, samples=35, thick] {\a*sin(deg(x))};
125\end{axis}
126\end{tikzpicture}
127\end{center}
128
129
130\section*{Mathematical Notation Works}
131
132Inline $e^{i\pi}+1=0$, or set off on its own:
133
134\[
135 \int_{-\infty}^{\infty} e^{-x^2}\,\mathrm{d}x = \sqrt{\pi},
136 \qquad \nabla\!\cdot\!\mathbf{E} = \frac{\rho}{\varepsilon_0},
137 \qquad \mathbb{R}\subseteq\mathbb{C}.
138\]
139
140\section*{Lists and tables do too}
141
142\begin{itemize}
143\item one;
144\item two;
145\item three.
146\end{itemize}
147
148\begin{center}
149\begin{tabular}{lrr}
150\toprule
151item & count & share \\
152\midrule
153alpha & 12 & 0.40 \\
154beta & 9 & 0.30 \\
155gamma & 9 & 0.30 \\
156\bottomrule
157\end{tabular}
What If We Just Put TEX In The Browser?
eigenblake
10 September 2026
o, computers aren’t yet fast enough for us to recompile entire documents
S
with every keystroke in their entirety, so we have to do some interesting
tricks to simulate it. To get this degree of interactivity, we’re replaying from
a ladder of checkpoints, with it taking ms over interpreter
steps, of which ms wrote the pages you are looking at right now. Far
from elagant but it works.
[Try typing something here to see what it feels like – you should get
anywhere from 10 - 90 ms per keystroke]
Also, try interacting with the following – you’ll notice that it’s not quite
where we want it yet. Better than nothing but far too laggy. That’s where
optimizations should come in later.
1
TELOX is a new tiny humble LATEX engine
TELOX is a small step for publication-grade typesetting in the browser ev-
erywhere. And that includes the web (we are here), video games, e-readers,
anything that can print glyphs. Maybe even the moon someday.
It’s a research project, and may never evolve beyond that point. The
destination is a research paper. The key research goals are establishing bi-
directionality between the text and presentation layer. Enabling interactive
learning experiences is the long term goal, but what the engine has brought
thus far is source attribution to enable selection.
Formatting isn’t the hard part
A word can be bold or stressed or set in monospace or colored. For this,
scratchpad, I grabbed a subset of the most commmon packages and pre-
packaged them. So we can’t do anything. But we can do lots.
There’s a rich text editor in this application (that’s not really a part of
the research project) that gives you the ability to preview things. Also the
“float” button gives you a preview that follows your cursor. We have vim
mode in this scratchpad as well.
A simple interactive plot
The slider is movable, and this is all running inside the document with only
the mouse movement piped in.
2
Mathematical Notation Works
Inline , or set off on its own:
Lists and tables do too
• one;
• two;
• three.
item count share
alpha 12 0.40
beta 9 0.30
gamma 9 0.30
3
Multiple Consumers
4
Much, Much More Ahead
1. Thinking hard about a11y – but we have the source code, so we can
actually do a really excellent job here.
2. Speed. Can we partition the document into local parametric bubbles
to save interpreter steps? It would be kind of like a “JIT” for LATEX
and that would enable smooth realtime editing. Or, maybe we can
even pull a Svelte.
3. I heard Iroh runs on wasm. P2P WYSIWYG LATEX editor, anyone?
4. Bound the number of instructions – we don’t want huge loops to freeze
your browser, and we don’t want to rely on someone else’s failsafes.
5. A portable CLI for making static sites with embedded LATEX and little
fuss
6. Tiny web component for KATEX like consumption? Can we do better
than 10MB compressed?
7. LATEX embedded wasm modules that telox executes? Computation
graph, input, output? Possible yes, well executed? I don’t know.
8. Frontend support for Markdown, Typst, Restructured Text, and more.
9. So
10. so
11. much
12. more ...
Conclusion
LATEX is effectively an interpreted programming language. This is much
harder than I thought. But some part of this already feels useful and that’s
enough for me to keep going.
5