Skip to content

LaTeX reader: operator names alone and the amsmath names of two words - #22

Open
simonebortolin wants to merge 2 commits into
mainfrom
claude/latex-operator-names
Open

simonebortolin wants to merge 2 commits into
mainfrom
claude/latex-operator-names

Conversation

@simonebortolin

Copy link
Copy Markdown
Owner

First of a stack: main ← this ← macros (NotExpanded) ← write-back (NotWrittenBack).

Reads the last cases of NotReadYet in Latex2MathMLCorpusTests, which is gone:

  • \lg is a function name for the whole pipeline (the grammar already had it, UnicodeMathText.FunctionNames did not).
  • \liminf, \limsup, \injlim, \projlim read as one name, lim inf with a six-per-em space (U+2006) between the words, as MathJax and latex2mathml write them; the grammar takes U+2006 inside a function name, EulerFunctions has their limits under the name in display, and the writer writes them back as \liminf… in standard and Word LaTeX.
  • \varinjlim, \varprojlim, \varliminf, \varlimsup read as the plain names, as latex2mathml reads them (amsmath draws an arrow or bar under/over them: the drawn form does not read back cleanly).
  • A name with scripts and nothing after it (\operatorname*{argmax}_x) reads as msub(argmax, x) rather than as letters; \operatorname{lim} and \operatornamewithlimits{lim} read as \lim; the UnicodeMath writer writes argmax_𝑥 so that it reads back.
  • Rune.IsLetter in the netstandard2.0 polyfill.

Tests: new ReadsOperatorNames (15 cases, inline and display, written as standard LaTeX and UnicodeMath and read back from standard LaTeX, Word LaTeX and UnicodeMath); the unknown-command tests use \erfc and \cosec instead of \lg and \liminf. 6788/6788 on net10.0 and net8.0.


Generated by Claude Code

…wo words

\lg is a function name, as for Word; \liminf, \limsup, \injlim, \projlim (and their
\var forms) are one name whose words a six-per-em space parts, as MathJax and
latex2mathml write them, read through UnicodeMath as a name marked as a function
(lim inf⁡) and written back as their commands; a name marked as a function with
scripts and nothing after it (argmax⁡_x alone, \operatorname*{argmax}_x) is the name
with its scripts, and the UnicodeMath writer marks such a name; \operatorname{lim}
is \lim. The latex2mathml cases that were not read yet now are.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyVio98rJkziNnwWW9T1Mn
@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Pre-release 1.0.5-pr.22.64 is ready: https://github.com/simonebortolin/SharpEquations/releases/tag/pr-22-64-1

NuGet package of 081e4ed. Updated on every push, deleted when this PR is closed.

Removed tests for unknown control words '\erfc' and '\cosec' from the LaTeXReaderTests.

This branch has not been deployed

No deployments
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.

2 participants