ER2-ENGINE

Run ER2 inside Quarto documents

ER2-ENGINE: a Quarto engine for ER2

ER2 is Python with mathematics built in: x^2 is a power, 1/3 is exact, sym x declares a symbol, and number theory runs on PARI/GP. This extension makes it a Quarto language: ```{er2} cells execute, and they are highlighted as ER2.

sym x
f = (x + 1)^3
expand(f)

\[x^{3} + 3 x^{2} + 3 x + 1\]

factor(2^64 + 1), phi(123456789), 1/3 + 1/6
(274177 * 67280421310721, 82260072, 1/2)

Everything on this site — including the two cells above — was computed by the engine as the page was built.

Install

quarto add oeistools/ER2-ENGINE

You also need Quarto 1.9 or newer and ER2 itself; see Get started.

What you get

  • One ER2 session per document. Symbols and values carry from cell to cell, and to inline code: \(f =\) \(\left(x + 1\right)^{3}\).
  • Mathematics as mathematics. A cell that ends in an expression shows it, as LaTeX when it has a LaTeX form.
  • Figures from Matplotlib, numbered and cross-referenceable.
  • ER2 highlighting — sym, ^^, 5r — with nothing to configure.
  • No Jupyter. No kernel to install, no daemon to restart.

This is the sibling of PARI-GP-ENGINE, built the same way for a different language.