Skip to content

it is not working for JSON/API Data, but MathJax is working. It just works for objects only #2782

Answered by edemaine
dibasdauliya asked this question in Q&A
Discussion options

You must be logged in to vote

I would recommend putting the call to KaTeX (renderMathInElement) at the end of your JavaScript file main.js. Then it seems to work well. See this CodePen demo.

On the other hand, the code you show should work — I believe <script> tags are supposed to run in order, unless they are marked defer or async. I tried running your code directly as listed above, and I got some rendering defects (fraction lines invisible, not sure why) but it did render all the math. So it's difficult to tell what's going wrong in your setup.

Replies: 1 comment 11 replies

Comment options

You must be logged in to vote
11 replies
@dibasdauliya
Comment options

@edemaine
Comment options

@dibasdauliya
Comment options

@dibasdauliya
Comment options

@edemaine
Comment options

Answer selected by edemaine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #2745 on February 08, 2021 17:51.