Skip to content

parse: add AMS lowercase-greek variants \varkappa and \digamma - #4

Merged
tannevaled merged 1 commit into
mainfrom
ams-var-greek
Aug 30, 2026
Merged

parse: add AMS lowercase-greek variants \varkappa and \digamma#4
tannevaled merged 1 commit into
mainfrom
ams-var-greek

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

An unknown control sequence in the math layer drops the whole equation group, so a single missing symbol silently deletes real content.

\varkappa was absent from the greek table even though \kappa and every other var-variant (\varphi, \varrho, \vartheta, \varpi, \varsigma, \varepsilon) were present. On one arXiv article (2606.18084) \varkappa occurs 12 times and dropped two display groups.

amssymb defines exactly two lowercase-greek variants beyond the standard block: \varkappa (ϰ U+03F0) and \digamma (ϝ U+03DD). Both added as clsOrd.

TestAddedSymbols gains \varkappa, \digamma, and combinations; full suite green.

An unknown control sequence in the math layer drops the WHOLE equation group,
so a single missing symbol silently deletes real content. \varkappa was absent
from the greek table though \kappa and every other var-variant (\varphi,
\varrho, \vartheta, \varpi, \varsigma, \varepsilon) were present; on one arXiv
article (2606.18084) it occurs 12 times and dropped two display groups.

amssymb defines exactly two lowercase-greek variants beyond the standard block:
\varkappa (ϰ U+03F0) and \digamma (ϝ U+03DD). Add both as clsOrd.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit 8d97a5b into main Aug 30, 2026
11 checks passed
@tannevaled
tannevaled deleted the ams-var-greek branch August 30, 2026 12:26
tannevaled added a commit that referenced this pull request Aug 31, 2026
Three of the commands the go-tex/engine corpus reports as dropped formulas live
here, not in the engine.

\triangleleft and \triangleright were missing. They are BINARY operators at U+25C1
and U+25B7 — unicode-math-table.tex:704/694, and fontmath.ltx:264-265 declares both
\mathbin — and they are not the ⊲ ⊳ of \vartriangleleft/right already in the table,
which amssymb makes relations: the two pairs differ in glyph and in spacing. 98
dropped formulas over the arXiv corpus.

\genfrac{left}{right}{thickness}{style}{num}{den} is amsmath's generalised
fraction (amsmath.sty:245-250):

	\edef\@tempb{\@nx\@genfrac\@mathstyle{#4}%
	  \csname @@\ifx @#3@over\else above\fi
	  \ifx\@tempa\@empty \else withdelims\fi\endcsname}

so an EMPTY thickness means \over — the font's own rule — and any other means
\above that thickness, 0pt being no rule at all. That is how \binom itself is
defined: \genfrac()\z@{} (amsmath.sty:240). The style argument is TeX's digit: 0
display, 1 text, 2 script, 3 scriptscript, empty keeping the style in force. Both
real uses in the corpus are the delimited no-rule form — a q-binomial written
\genfrac[]{0pt}{}{n}{k} and \genfrac{\{}{\}}{0pt}{} — and 88 formulas were dropped
for it. The delimiters arrive UNBRACED there, as TeX takes single tokens for
arguments, which readOptionalDelim handles beside {} for "no delimiter this side".

\z@ needs its own note: this parser has no catcodes, so amsmath's own spelling of
zero arrives as \z and @, and read as \z alone it would draw a rule where the
binomial wants none. The @ that follows a control word is absorbed with it.

Documented reduction: a non-zero explicit thickness draws the font's rule rather
than that exact width, since fraction() takes its thickness from the font's MATH
table.
tannevaled added a commit that referenced this pull request Aug 31, 2026
Three of the commands the go-tex/engine corpus reports as dropped formulas live
here, not in the engine.

\triangleleft and \triangleright were missing. They are BINARY operators at U+25C1
and U+25B7 — unicode-math-table.tex:704/694, and fontmath.ltx:264-265 declares both
\mathbin — and they are not the ⊲ ⊳ of \vartriangleleft/right already in the table,
which amssymb makes relations: the two pairs differ in glyph and in spacing. 98
dropped formulas over the arXiv corpus.

\genfrac{left}{right}{thickness}{style}{num}{den} is amsmath's generalised
fraction (amsmath.sty:245-250):

	\edef\@tempb{\@nx\@genfrac\@mathstyle{#4}%
	  \csname @@\ifx @#3@over\else above\fi
	  \ifx\@tempa\@empty \else withdelims\fi\endcsname}

so an EMPTY thickness means \over — the font's own rule — and any other means
\above that thickness, 0pt being no rule at all. That is how \binom itself is
defined: \genfrac()\z@{} (amsmath.sty:240). The style argument is TeX's digit: 0
display, 1 text, 2 script, 3 scriptscript, empty keeping the style in force. Both
real uses in the corpus are the delimited no-rule form — a q-binomial written
\genfrac[]{0pt}{}{n}{k} and \genfrac{\{}{\}}{0pt}{} — and 88 formulas were dropped
for it. The delimiters arrive UNBRACED there, as TeX takes single tokens for
arguments, which readOptionalDelim handles beside {} for "no delimiter this side".

\z@ needs its own note: this parser has no catcodes, so amsmath's own spelling of
zero arrives as \z and @, and read as \z alone it would draw a rule where the
binomial wants none. The @ that follows a control word is absorbed with it.

Documented reduction: a non-zero explicit thickness draws the font's rule rather
than that exact width, since fraction() takes its thickness from the font's MATH
table.
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.

1 participant