Skip to content

Serialize Triangle, the color heads, ColorDelta, Apply, Distance and Chop under their own names - #671

Open
enumeratio wants to merge 1 commit into
cortex-js:mainfrom
enumeratio:latex-own-name-serialization
Open

enumeratio wants to merge 1 commit into
cortex-js:mainfrom
enumeratio:latex-own-name-serialization

Conversation

@enumeratio

Copy link
Copy Markdown
Contributor

Triangle, the color heads, ColorDelta, Apply, Distance and Chop now serialize under their own names, keeping each entry's wrapper (\operatorname or \mathrm). Parsing is unchanged: every lowercase spelling still parses to the same head, and so does the own-name form. This changes printed LaTeX.

Head Before After
Triangle \operatorname{triangle}(1) \operatorname{Triangle}(1)
Rgb, Hsl, Hsv, Oklab, Oklch \operatorname{rgb}(1) ... \operatorname{Rgb}(1) ...
AsRgb, AsHsl, AsHsv, AsOklab, AsOklch \operatorname{asRgb}(1) ... \operatorname{AsRgb}(1) ...
ColorDelta \operatorname{colorDelta}(1) \operatorname{ColorDelta}(1)
Apply \operatorname{apply}(f_{(k)}, x, y) \operatorname{Apply}(f_{(k)}, x, y)
Distance \operatorname{distance}(1) \operatorname{Distance}(1)
Chop \mathrm{chop}(1) \mathrm{Chop}(1)

Conventional lowercase operator names (\sin, \gcd, \mathrm{mean}, \mathrm{median}, ...) are untouched.

Tests: own-name-serialization.test.ts checks for each head the serialized form, that it parses back, and that the lowercase alias still parses. Three existing expectations that pinned the lowercase output are updated.

Fixes #670

…Chop under their own names, keeping the lowercase spellings as parse aliases (cortex-js#670)
@enumeratio
enumeratio force-pushed the latex-own-name-serialization branch from 418d4e1 to 50c1d0c Compare December 3, 2026 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Some heads print a lowercase or camelCase spelling of their name in LaTeX

1 participant