Rendering math/latex from thebe-remove-input-init output cell #36
-
|
Hi! We are making a book where we are trying to render dynamically fetched latex/math by running cells in browser through Thebe. However, this does not seem to work render the math correctly if rendered in a "normal cell" or when using thebe-remove-input-init. It does however work when running the code normally in Thebe (see examples) Example with initial run in "normal cell": Example when using thebe-remove-input-init: Example when running code in visible Thebe editor: For some reason though, it does not render correctly when using a Thebe editor in your manual (https://teachbooks.io/manual/examples/example_quiz_interactive.html): I have also noticed that MathJax changes from version 3.2.2 to 2.7.5 when starting up the Thebe Python kernel (which does not seem to happen in your manual https://teachbooks.io/manual/examples/example_quiz_interactive.html.) I don't know if that is directly related though, as it does not render correctly in your manual even though that uses MathJax version 3. Any inputs on how I can get this to work? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
Interesting behaviour! @DianaBanta, do you know how this can happen? |
Beta Was this translation helpful? Give feedback.
-
|
Hello! Your issue most likely happens because MathJax isn’t automatically processing the dynamically inserted latex from widgets.HTMLMath. To make it work, you can manually trigger MathJax by adding and executing the code below in a code cell before your original code, which can be done using thebe-remove-input-init. I hope this helps! |
Beta Was this translation helpful? Give feedback.





Hello! Your issue most likely happens because MathJax isn’t automatically processing the dynamically inserted latex from widgets.HTMLMath. To make it work, you can manually trigger MathJax by adding and executing the code below in a code cell before your original code, which can be done using thebe-remove-input-init.
I hope this helps!