Skip to content

Commit 27e0d9d

Browse files
fixed mathjax bug in chp1 and 2
1 parent 66a1218 commit 27e0d9d

File tree

3 files changed

+58
-9
lines changed

3 files changed

+58
-9
lines changed

Chapter1_Introduction/Chapter1_Introduction.ipynb

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -908,16 +908,35 @@
908908
" margin-top: 0.5em;\n",
909909
" display: block;\n",
910910
" }\n",
911-
"</style>"
911+
" \n",
912+
" .warning{\n",
913+
" color: rgb( 240, 20, 20 )\n",
914+
" }\n",
915+
"</style>\n",
916+
"<script>\n",
917+
" MathJax.Hub.Config({\n",
918+
" TeX: {\n",
919+
" extensions: [\"AMSmath.js\"]\n",
920+
" },\n",
921+
" tex2jax: {\n",
922+
" inlineMath: [ ['$','$'], [\"\\\\(\",\"\\\\)\"] ],\n",
923+
" displayMath: [ ['$$','$$'], [\"\\\\[\",\"\\\\]\"] ]\n",
924+
" },\n",
925+
" displayAlign: 'center', // Change this to 'center' to center equations.\n",
926+
" \"HTML-CSS\": {\n",
927+
" styles: {'.MathJax_Display': {\"margin\": 4}}\n",
928+
" }\n",
929+
" });\n",
930+
"</script>"
912931
],
913932
"output_type": "pyout",
914-
"prompt_number": 22,
933+
"prompt_number": 1,
915934
"text": [
916-
"<IPython.core.display.HTML at 0xcac47f0>"
935+
"<IPython.core.display.HTML at 0x8225dd8>"
917936
]
918937
}
919938
],
920-
"prompt_number": 22
939+
"prompt_number": 1
921940
},
922941
{
923942
"cell_type": "code",

Chapter2_MorePyMC/MorePyMC.ipynb

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1777,16 +1777,31 @@
17771777
" .warning{\n",
17781778
" color: rgb( 240, 20, 20 )\n",
17791779
" }\n",
1780-
"</style>"
1780+
"</style>\n",
1781+
"<script>\n",
1782+
" MathJax.Hub.Config({\n",
1783+
" TeX: {\n",
1784+
" extensions: [\"AMSmath.js\"]\n",
1785+
" },\n",
1786+
" tex2jax: {\n",
1787+
" inlineMath: [ ['$','$'], [\"\\\\(\",\"\\\\)\"] ],\n",
1788+
" displayMath: [ ['$$','$$'], [\"\\\\[\",\"\\\\]\"] ]\n",
1789+
" },\n",
1790+
" displayAlign: 'center', // Change this to 'center' to center equations.\n",
1791+
" \"HTML-CSS\": {\n",
1792+
" styles: {'.MathJax_Display': {\"margin\": 4}}\n",
1793+
" }\n",
1794+
" });\n",
1795+
"</script>"
17811796
],
17821797
"output_type": "pyout",
1783-
"prompt_number": 9,
1798+
"prompt_number": 1,
17841799
"text": [
1785-
"<IPython.core.display.HTML at 0x127c5390>"
1800+
"<IPython.core.display.HTML at 0x8293dd8>"
17861801
]
17871802
}
17881803
],
1789-
"prompt_number": 9
1804+
"prompt_number": 1
17901805
},
17911806
{
17921807
"cell_type": "code",

styles/custom.css

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,19 @@
3838
.warning{
3939
color: rgb( 240, 20, 20 )
4040
}
41-
</style>
41+
</style>
42+
<script>
43+
MathJax.Hub.Config({
44+
TeX: {
45+
extensions: ["AMSmath.js"]
46+
},
47+
tex2jax: {
48+
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
49+
displayMath: [ ['$$','$$'], ["\\[","\\]"] ]
50+
},
51+
displayAlign: 'center', // Change this to 'center' to center equations.
52+
"HTML-CSS": {
53+
styles: {'.MathJax_Display': {"margin": 4}}
54+
}
55+
});
56+
</script>

0 commit comments

Comments
 (0)