Skip to content

Typst writer emits deprecated sect names for intersection operators #287

@SathyaTadinada

Description

@SathyaTadinada

Summary

texmath Typst writer currently emits deprecated Typst symbol names for intersection operators:

  • \cap -> sect (deprecated; should be inter)
  • \bigcap -> sect.big (deprecated; should be inter.big)

Pandoc currently carries a downstream compatibility workaround (Issue #11591, PR #11592), but this should be fixed upstream in texmath.

Reproduction

Using texmath directly (REPL, readTeX -> writeTypst):

  • Input: \bigcap_{i=0}^{\infty}{A \cap B}

  • Current output: sect.big_(i = 0)^oo A sect B

  • Input: \cap

  • Current output: sect

Expected

  • \cap emits inter
  • \bigcap emits inter.big

Root cause

writeTypst builds a map from Typst.Symbols.typstSymbols. That symbol list includes both:

  • inter / inter.big
  • and deprecated aliases sect / sect.big

When converted with Data.Map.fromList, duplicate-codepoint resolution picks the later entry, resulting in deprecated names being emitted.

Proposed fix

In Text.TeXMath.Writers.Typst, explicitly override the two codepoints after building the symbol map:

  • U+2229 -> inter
  • U+22C2 -> inter.big

Also add/update Typst writer tests to lock this behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions