Skip to content

The Terminal renders an expression's LaTeX in the browser - #1495

Merged
Rafael-SOWNet merged 1 commit into
masterfrom
terminal-latex-549
Sep 27, 2026
Merged

Rafael-SOWNet merged 1 commit into
masterfrom
terminal-latex-549

Conversation

@Rafael-SOWNet

Copy link
Copy Markdown
Member

Closes #549.

render x shows an expression typeset in the browser, the way a plot is shown. It writes a page to the temporary directory with the expression's LaTeX, loads MathJax from the same CDN the notebook extension uses, and opens the page. There's no web service involved: the Terminal already holds the LaTeX for every result.

latex x already returns the LaTeX as text. It comes from AngouriMath.FSharp.Functions, which the Terminal opens, so that name was taken and the browser half is called render. The page also shows the LaTeX source under the typeset form, for copying.

  • renderedPage x writes the page and returns its path, and render opens it. If no browser can be started, render prints the path instead of failing the cell.
  • The new test in TerminalUnitTests reads the page, since a test can't open a browser. It checks for the LaTeX, the MathJax script, and HTML escaping (y < 3 is written as y &lt; 3).
  • The Terminal readme gets a short LaTeX section.

All 43 Terminal tests pass locally (net10.0), including the new one. It also asserts that latex (x / 2) answers \frac{x}{2} at the prompt, as the readme now says.

🤖 Generated with Claude Code

https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura

`render x` writes a page with the expression's LaTeX to the temporary directory, loads
MathJax from the CDN the notebook extension uses, and opens the page the way a plot is
shown. `latex x` already gave the LaTeX as text, and the page shows the source under the
typeset form. Where no browser can be started, `render` prints the page's path instead.

Closes #549.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
@Rafael-SOWNet
Rafael-SOWNet merged commit 8e3a270 into master Sep 27, 2026
27 checks passed
@Rafael-SOWNet
Rafael-SOWNet deleted the terminal-latex-549 branch October 29, 2026 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Latex to show in browser in Terminal

1 participant