Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure Mathjax in Python Django

Tags:

django

mathjax

I would like to know how to configure Mathjax in Django in a Q&A system where Questions and Answers will be based on LaTeX format.

I have tried to add:

<script type="text/javascript"
   src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>

into the html template where the questions and answers will be displayed to no avail.

Thanks.

like image 354
XinYi Chua Avatar asked Apr 20 '26 10:04

XinYi Chua


1 Answers

If the page's content is dynamically created, you will need to call MathJax after the content has been loaded. See the documentation for details. The main idea is that you have to include

MathJax.Hub.Queue(["Typeset",MathJax.Hub]);

in the javascript that is executed after the content is in place.

like image 116
Davide Cervone Avatar answered Apr 23 '26 00:04

Davide Cervone



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!