react-notion-x icon indicating copy to clipboard operation
react-notion-x copied to clipboard

LaTeX renderer doesn't fully take into account block type

Open QuietRocket opened this issue 3 years ago • 4 comments
trafficstars

Description

In Notion, there are both inline equations and block equations. They should be rendered differently, however it appears that react-notion-x doesn't take this into account. For instance, in Notion, integrals appear small in inline equations and large in block equations. In react-notion-x, however, they appear the same way (small). I believe passing the displayMode option in KaTeX rectifies this problem, as mentioned in the KaTeX documentation. The exact way to do this though might be a little different since a react wrapper package is used.

Notion: Screen Shot 2022-04-29 at 12 25 32 AM

React-Notion-X: Screen Shot 2022-04-29 at 12 26 04 AM

Notion Test Page ID

df2adb88d5b34105bc397074001b9b69

QuietRocket avatar Apr 29 '22 07:04 QuietRocket

Hmmm, we definitely handle block vs inline usage differently, though I agree that it looks like Notion's rendering of equation blocks has changed since it was initially implemented. See https://react-notion-x-demo.transitivebullsh.it/7820b2d5300747b38e31344eb06fbd57 for a live example.

This shouldn't be too hard to fix. PRs welcome 🙂

transitive-bullshit avatar Apr 29 '22 17:04 transitive-bullshit

I also had this problem when using \tag in formulas. The \tag only works when 'displayMode' is true. And I fixed this problem and PR.

Thooooor avatar Apr 30 '22 17:04 Thooooor

I also had this problem when using \tag in formulas. The \tag only works when 'displayMode' is true. And I fixed this problem and PR.

Could you please tell me how to fix this? Thanks!

yangkang2318 avatar May 09 '22 15:05 yangkang2318

I also had this problem when using \tag in formulas. The \tag only works when 'displayMode' is true. And I fixed this problem and PR.

Could you please tell me how to fix this? Thanks!

#281 see this

Thooooor avatar May 09 '22 16:05 Thooooor