增加MathJax公式的支持

This commit is contained in:
virusdefender 2016-03-11 18:12:57 +08:00
parent f2ce13c85b
commit 7f7699780a
5 changed files with 29 additions and 3 deletions

View File

@ -26,7 +26,7 @@
</div>
<div class="form-group col-md-12">
<label>题目描述</label>
<label>题目描述 (<a href="https://github.com/QingdaoU/OnlineJudge/wiki/MathJax%E5%9F%BA%E7%A1%80" target="_blank">想插入公式?</a>)</label>
<ms:editor $id="contestProblemDescriptionEditor" config="contestProblemDescriptionEditor"></ms:editor>
</div>

View File

@ -9,7 +9,7 @@
</div>
<div class="form-group col-md-12">
<label>题目描述</label>
<label>题目描述 (<a href="https://github.com/QingdaoU/OnlineJudge/wiki/MathJax%E5%9F%BA%E7%A1%80" target="_blank">想插入公式?</a>)</label>
<ms:editor $id="problemDescriptionEditor" config="problemDescriptionEditor"></ms:editor>
</div>

View File

@ -15,7 +15,7 @@
</div>
<div class="form-group col-md-12">
<label>题目描述</label>
<label>题目描述 (<a href="https://github.com/QingdaoU/OnlineJudge/wiki/MathJax%E5%9F%BA%E7%A1%80" target="_blank">想插入公式?</a>)</label>
<ms:editor $id="problemDescriptionEditor" config="problemDescriptionEditor"></ms:editor>
</div>

View File

@ -39,4 +39,17 @@
{% endblock %}
{% block js_block %}
<script src="/static/js/app/oj/problem/problem.js"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX", "output/HTML-CSS"],
tex2jax: {
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
processEscapes: true
},
"HTML-CSS": { availableFonts: ["TeX"] }
});
</script>
<script src="//cdn.bootcss.com/mathjax/2.6.1/MathJax.js"></script>
{% endblock %}

View File

@ -48,4 +48,17 @@
{% endblock %}
{% block js_block %}
<script src="/static/js/app/oj/problem/problem.js"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX", "output/HTML-CSS"],
tex2jax: {
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
processEscapes: true
},
"HTML-CSS": { availableFonts: ["TeX"] }
});
</script>
<script src="//cdn.bootcss.com/mathjax/2.6.1/MathJax.js"></script>
{% endblock %}