Repository navigation
The Terminal renders an expression's LaTeX in the browser - #1495
Merged
Merged
Conversation
`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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #549.
render xshows 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 xalready returns the LaTeX as text. It comes fromAngouriMath.FSharp.Functions, which the Terminal opens, so that name was taken and the browser half is calledrender. The page also shows the LaTeX source under the typeset form, for copying.renderedPage xwrites the page and returns its path, andrenderopens it. If no browser can be started,renderprints the path instead of failing the cell.TerminalUnitTestsreads the page, since a test can't open a browser. It checks for the LaTeX, the MathJax script, and HTML escaping (y < 3is written asy < 3).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