Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion forum/settings/static.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,9 @@
label = _("Custom Head"),
help_text = _("Your custom Head elements."),
widget=Textarea(attrs={'rows': '25'}),
required=False))
required=False))

MATHJAX_ENABLED = Setting('MATHJAX_ENABLED', False, HEAD_SET, dict(
label = _("Enable LaTeX support"),
help_text = _("Enable LaTeX support via MathJax, by loading MathJax javascript"),
required=False))
Original file line number Diff line number Diff line change
Expand Up @@ -2269,6 +2269,7 @@ else
elapsedTime = currTime - prevTime;

pushPreviewHtml(text);
if (MathJax) { MathJax.Hub.Queue(["Typeset",MathJax.Hub]); }
};

// setTimeout is already used. Used as an event listener.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,7 @@
elapsedTime = currTime - prevTime;

pushPreviewHtml(text);
if (MathJax) { MathJax.Hub.Queue(["Typeset",MathJax.Hub]); }
};

// setTimeout is already used. Used as an event listener.
Expand Down
1 change: 1 addition & 0 deletions forum/skins/default/media/js.src/wmd/wmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -1919,6 +1919,7 @@ Attacklab.wmdBase = function(){

pushPreviewHtml(text);
htmlOut = text;
if (MathJax) { MathJax.Hub.Queue(["Typeset",MathJax.Hub]); }
};

// setTimeout is already used. Used as an event listener.
Expand Down
15 changes: 15 additions & 0 deletions forum/skins/default/templates/base_content.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,21 @@
</script>
<script type="text/javascript" src="{% media "/media/js/osqa.main.js" %}"></script>
{% include "base_onready.html" %}
{% if settings.MATHJAX_ENABLED %}
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
"HTML-CSS": { preferredFont: "TeX", availableFonts: ["STIX","TeX"] },
tex2jax: { inlineMath: [ ["$%","$%"] ],
displayMath: [ ["$$","$$"] ],
processEscapes: true,
ignoreClass: "tex2jax_ignore|dno"
},
TeX: { noUndefined: { attributes: { mathcolor: "red", mathbackground: "#FFEEEE", mathsize: "90%" } } },
messageStyle: "none"
});
</script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
{% endif %}

{% if settings.USE_PJAX %}
<script type="text/javascript" src="{% media "/media/js/jquery.pjax-8df345b0e7.js" %}"></script>
Expand Down