Skip to content

Typst writer: map \cap from deprecated sect to inter#11592

Closed
SathyaTadinada wants to merge 3 commits intojgm:mainfrom
SathyaTadinada:fix-typst-cap-inter
Closed

Typst writer: map \cap from deprecated sect to inter#11592
SathyaTadinada wants to merge 3 commits intojgm:mainfrom
SathyaTadinada:fix-typst-cap-inter

Conversation

@SathyaTadinada
Copy link
Copy Markdown

@SathyaTadinada SathyaTadinada commented Apr 19, 2026

Summary

Fix LaTeX -> Typst math output for intersection symbols:

  • \cap now emits inter (instead of deprecated sect)
  • \bigcap now emits inter.big (instead of deprecated sect.big)

What changed

  • Added a small post-processing step in the Typst writer math path to normalize deprecated symbol names.
  • Added regression tests for inline and display intersection output.

Files

  • src/Text/Pandoc/Writers/Typst.hs
  • test/command/typst-math-intersection.md

Repro

pandoc -f latex -t typst

Input

$\cap$
$$\bigcap_{i=1}^n A_i$$

Expected Output

$inter$
$ inter.big_(i = 1)^n A_i $

Testing

Ran:

cabal test pandoc:test-pandoc --with-compiler="$HOME/.ghcup/ghc/9.12.2/bin/ghc" --test-options='-p typst-math-intersection'

Result: Both test cases passed.

Closes #11591.

Upstream context

Pandoc currently gets Typst math symbol names from texmath.
Related upstream tracking: jgm/texmath#287
Upstream fix PR: jgm/texmath#288
This Pandoc change is a compatibility normalization until upstream mapping is fixed/released.

@jgm
Copy link
Copy Markdown
Owner

jgm commented Apr 19, 2026

I'd consider an upstream change but not this kind of local patching.

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

LaTeX \cap maps to deprecated Typst symbol sect (should be inter)

2 participants