Skip to content

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

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

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.

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

1 participant