craigary / nobelium

A static blog build on top of Notion and NextJS, deployed on Vercel.
https://nobelium.js.org
MIT License
3k stars 1.97k forks source link

KeTex parse error: {equation} can be used only in display mode #306

Closed Rapisurazurite closed 1 year ago

Rapisurazurite commented 1 year ago

Description of the bug

When rendering a "Math Equation" block, the displayed content is not centered. And the "equation" and other envs cannot be used, suggesting "that {equation} can be used only in display mode".

Expected behavior

The display content is centered, and render in display mode.

Reproduction

when redering a "Math Equation" block, and using {equation} env.

Screenshots

image image

Additional context

Software versions

SilentDepth commented 1 year ago

Sorry, I’m not a TeX user. Could you please provide the TeX code of the reproduction? Then I’ll be able to debug this issue.

Rapisurazurite commented 1 year ago

I apologize for the late delivery. Here is an example of a latex equation that is not rendered correctly:

\begin{equation}L _ { T o p K } = - \frac { 1 } { \sum _ { i = 1 } ^ { N } \sum _ { c = 1 } ^ { C } 1 \left\{ g _ { i } = c \text { and } p _ { i c } < t \right\} } \left( \sum _ { i = 1 } ^ { N } \sum _ { c = 1 } ^ { C } 1 \left\{ y _ { i } = c \text { and } s _ { i } ^ { c } < t \right\} \log s _ { i } ^ { c } \right)\end{equation} . Thank you for your understanding.