Issue with rendering mathematical formulas using myst-to-react MATH_RENDERERS #1140
Replies: 2 comments 4 replies
-
Hi @HaudinFlorence -- thanks for the question. The current math render is commented out as this is currently done in the transform (which is done in the CLI and the HTML output is provided to the web-client without having to have the katex rendering javascript loaded). This allows a slightly faster load, but is a bit unintuitive. To use that transform you can https://github.com/executablebooks/mystjs/blob/main/packages/myst-transforms/src/math.ts#L280 If you are looking to do this client side, you can also provide your own renders (i.e. the commented out directives), which will add a dependency of katex to the frontend as you are doing now. |
Beta Was this translation helpful? Give feedback.
-
Hello. Thanks @rowanc1 for the explanations. It worked for the math transform 👍🏻 . I will rather focus on using the transforms instead of using the plugins. But then I guess that conditions will be needed to differentiate between the different directives and transforms to be applied in each case. Up to now I have not managed to render the labels in equations, figures or tables / target directives. I tried with a combination of:
I need to investigate more in details the right order in which to use the transforms. |
Beta Was this translation helpful? Give feedback.
-
Hello,
I am note sure if this is the right place to ask. I am working on a react app and I am trying to render a math directive using
myst-to-react
. The only way I managed to get the mathematical formula rendered (withkatex
classes) was with using a modified version of theMATH_RENDERERS
provided bymyst-to-react
in/src/math.tsx
. What I basically did is using theMath
function that is commented in the current available version onmyst-to-react
and produced a simplifiedMATH_RENDERERS
:Can you please give me some hints about the way I can use the original version of
MATH_RENDERERS
and get the formulas rendered ? Right now, it seems that I always fell under this condition (with the red exclamation icon and the text of the formula underneath):Many thanks in advance for any help or advice.
Beta Was this translation helpful? Give feedback.
All reactions