Repository navigation
Content MathML read through ctop.xsl; amssymb symbols in LaTeX - #13
Merged
Merged
Conversation
Content MathML (apply, ci, cn...) outside the annotations is rewritten as
presentation MathML by David Carlisle's ctop.xsl (MIT), keeping the
presentation MathML around it. White space between elements and around
the text of ci/cn is removed first, and the limits ctop leaves empty
after. ctop.xsl is fixed for nested mi in bvar, x^{} in partialdiff
without a degree, an unprefixed mo, a bare log and ∫ as mi. The 40
equations of ctop's test page are the corpus of the new tests.
From the table of entities.xsl (XSLT MathML Library): about 70 amssymb
symbols written as commands, 15 commands the LaTeX reader did not know
(\square, \surd, \triangleq, \S...), and □ and √ written as \square and
\surd in standard LaTeX instead of \□ and \√.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… \underbrace
\mathop of one symbol is a group, to which \limits attaches its scripts
(munderover(x, 0, 1)); \overbrace and \underbrace with both scripts are, as
for TeX, operators with limits: \underset{x}{\overset{a}{\overbrace{3}}}.
The latex2mathml cases issue-125-4-limits, overbrace-c and underbrace-c pass.
[no-new-version]
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…does
\begin{name}{arguments}...\end{name} becomes the begin code with its #1...
(the first argument optional with a default), the body and the end code,
before the other passes; the definitions go to the macros, where later
conversions find them. ## in a macro body is # in math mode, which TeX
rejects: newcommand-escaped-hash is no LaTeX.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…acdf3 # Conflicts: # tests/SharpEquations.Tests/LaTeX/Latex2MathMLCorpusTests.cs
…sts to any branch Stacked pull requests (based on another PR's branch rather than main) ran no workflow at all, since every pull_request trigger was filtered to main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s out of NotInWordLaTeX [no-new-version] Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The groups of NotInWordLaTeX taken from main, without the seven cases the reader now reads (\tt, \Bbb, \mathop, the arrows of mathtools), and \Box renamed once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflicts resolved by keeping both sides: the NOTICE and tests/data/README.md
entries of ctop.xsl and of the latex2mathml and mml2tex corpora, and the union
of the symbols the LaTeX reader rewrites. The standard writer escapes a
structure operator as main does ({\surd}), so \surd reads as {\surd}, a
symbol, and the tests expect main's writer (a{\surd}b, \sum\limits in an
inline munderover).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
\ce{...} and \pu{...} are rewritten as plain LaTeX before the LaTeX is read
(Internal/LaTeX/Mhchem.cs): upright elements with counts and charges as
scripts, mass and atomic numbers as prescripts, reaction arrows with their
labels, bonds (\bond, - = #), states, hydrate dots, precipitates and gases.
The rules of \ce follow mhchem.go of treeblood (MIT, Copyright (c) 2024
Wyatt Sheffield), rewritten to write LaTeX instead of MathML.
Fixes the UnicodeMath preprocessing of a prescripted base with scripts of its
own (^0_(-1) n^-): its scripts were preprocessed twice, and an operator in
them came out as "[object Object]".
Test data: the 76 chemistry cases of treeblood's test/TESTCASES.yaml
(tests/data/latex/treeblood-mhchem.json), all read with Strict.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 task done
The standard LaTeX writer wrote \geqslant, \leqslant, \therefore, \coloneqq, \dblcolon, \ngtr and \lozenge, which the reader did not know. The reader now falls back to LaTeXSymbols for the commands UnicodeMath has no control word for, or another one (\succeq is ⪰, ≽ in UnicodeMath), so the two tables cannot drift. \oslash is escaped (⊘ builds a fraction in UnicodeMath) and \mid outside brackets too (∣ is a separator only in brackets). A test writes every character of LaTeXSymbols to LaTeX and reads it back. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tex-symbols-readback-e290e7 LaTeX reader reads every command the writer writes
…chem mhchem: \ce and \pu in the LaTeX reader
…reads
Since main reads a script without a base as one on an empty base ({^3H} is
{}^3 H, as in TeX), the prescripts mhchem wrote at the start of a group
were read as scripts of an empty base. The reader reads \prescript of
mathtools as UnicodeMath prescripts, and mhchem writes them with it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyVio98rJkziNnwWW9T1Mn
|
|
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.
Content MathML (apply, ci, cn...) outside the annotations is rewritten as presentation MathML by David Carlisle's ctop.xsl (MIT), keeping the presentation MathML around it. White space between elements and around the text of ci/cn is removed first, and the limits ctop leaves empty after. ctop.xsl is fixed for nested mi in bvar, x^{} in partialdiff without a degree, an unprefixed mo, a bare log and ∫ as mi. The 40 equations of ctop's test page are the corpus of the new tests.
From the table of entities.xsl (XSLT MathML Library): about 70 amssymb symbols written as commands, 15 commands the LaTeX reader did not know (\square, \surd, \triangleq, \S...), and □ and √ written as \square and \surd in standard LaTeX instead of \□ and \√.