Parcourir la source

Move MathJax config to base so it is always run

This prevents an issue where using MathJax would not be configured
correctly unless using the mathjax directive.
Alasdair Smith il y a 8 ans
Parent
commit
99e24db075
1 fichiers modifiés avec 16 ajouts et 1 suppressions
  1. 16 1
      services/web/public/coffee/base.coffee

+ 16 - 1
services/web/public/coffee/base.coffee

@@ -26,7 +26,22 @@ define [
 			baseUrl: window.sharelatex.sixpackDomain
 			baseUrl: window.sharelatex.sixpackDomain
 			client_id: window.user_id
 			client_id: window.user_id
 		})
 		})
-	
+
+		MathJax?.Hub?.Config(
+			extensions: ["Safe.js"]
+			messageStyle: "none"
+			imageFont:null
+			"HTML-CSS": { availableFonts: ["TeX"] },
+			TeX:
+				equationNumbers: { autoNumber: "AMS" },
+				useLabelIDs: false
+			skipStartupTypeset: true
+			tex2jax:
+				processEscapes: true,
+				inlineMath: [ ["\\(","\\)"] ],
+				displayMath: [ ['$$','$$'], ["\\[","\\]"] ]
+		)
+
 	App.run ($templateCache) ->
 	App.run ($templateCache) ->
 		# UI Select templates are hard-coded and use Glyphicon icons (which we don't import). 
 		# UI Select templates are hard-coded and use Glyphicon icons (which we don't import). 
 		# The line below simply overrides the hard-coded template with our own, which is 
 		# The line below simply overrides the hard-coded template with our own, which is