Skip to content

Typst writer: map \\cap and \\bigcap to inter names#288

Closed
SathyaTadinada wants to merge 1 commit intojgm:masterfrom
SathyaTadinada:fix-typst-intersection-mapping
Closed

Typst writer: map \\cap and \\bigcap to inter names#288
SathyaTadinada wants to merge 1 commit intojgm:masterfrom
SathyaTadinada:fix-typst-intersection-mapping

Conversation

@SathyaTadinada
Copy link
Copy Markdown

Summary

This updates writeTypst symbol mapping for intersection operators to emit non-deprecated Typst names:

  • \cap now emits inter (was sect)
  • \bigcap now emits inter.big (was sect.big)

This is an upstream fix in texmath for pandoc’s downstream compatibility workaround.

Root cause

Text.TeXMath.Writers.Typst builds typstSymbolMap from typstSymbols.
That symbol table includes both inter/inter.big and deprecated sect/sect.big aliases for the same codepoints.
Map construction ended up resolving those duplicates to sect names.

Changes

  • Added explicit overrides in typstSymbolMap for:
    • U+2229 -> inter
    • U+22C2 -> inter.big
  • Updated Typst golden tests that expected deprecated names.
  • Added focused Typst writer test intersection_operators.test to lock both mappings.

Closes #287.

Testing

Ran:

cabal test -f -server test-texmath --test-options='--pattern writer.typst'

Result: All 69 tests passed (0.11s)

Also locally reproduced pre-fix behavior via REPL (readTeX -> writeTypst) showing sect/sect.big, then verified tests now enforce inter/inter.big.

jgm added a commit to jgm/typst-symbols that referenced this pull request Apr 24, 2026
Now we only export one module, Typst.Symbols.
This contains typstSymbols, typstEmojis, and mathSymbolShorthands.

typstSymbols and typstEmojis are no longer lists of tuples. Instead, they
are lists of Sym records, which now include deprecation and math symbol
class information.

See jgm/texmath#288 for motivation.
jgm added a commit that referenced this pull request Apr 24, 2026
@jgm
Copy link
Copy Markdown
Owner

jgm commented Apr 24, 2026

I've handled #287 a different way.

@jgm jgm closed this Apr 24, 2026
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.

Typst writer emits deprecated sect names for intersection operators

2 participants