define(["mathjax"], function() {

	// Allow labels and numbers to be reset:
	// https://groups.google.com/forum/#!msg/mathjax-users/kzOOFw1qtxw/YdAEPJfCEXUJ

	MathJax.resetLabels = function() {
		//var AMS = MathJax.Extension["TeX/AMSmath"];
		//AMS.startNumber = 0;
		//AMS.labels = {};
	}

	// Allow inline maths with single $s
	MathJax.Hub.Config({

		config: ["TeX-AMS_HTML.js"],
		
		tex2jax: {
		inlineMath: [ ['$','$'], ["\\(","\\)"] ],
		displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
		processEscapes: true,
		preview: ["---"],
		},
		TeX: {
			Macros: {
				// See http://docs.mathjax.org/en/latest/tex.html#defining-tex-macros
				"quantity": ["{#1}\\,{\\rm{#2}}",2],
				"valuedef": ["{#1}={\\quantity{#2}{#3}}",3],
				"vtr": ["{\\underline{\\boldsymbol{#1}}}",1],
				"d": "\\operatorname{d}",
				"vari": ["#1",1],
				"s": ["_{\\sf{#1}}", 1],
				"half": ["\\frac{1}{2}",0],
				"third": ["\\frac{1}{3}",0],
				"quarter": ["\\frac{1}{4}",0],
				"eighth": ["\\frac{1}{8}",0],
				"e": ["\\textrm{e}",0],
				"units": ["\\rm{#1}",1],
				"standardstate": ["\\mathbin{\u29B5}",0],
				"and": ["{#1} \\wedge {#2}", 2],
				"or": ["{#1} \\lor {#2}", 2],
				"not": ["\\lnot{#1}", 1],
			},
			extensions: ["mhchem.js"],

		},
	});

	// Fix font issues in Chrome 32
	// https://groups.google.com/forum/#!msg/mathjax-users/S5x-RQDPJrI/p4nmRXJvoskJ

	MathJax.Hub.Config({
		extensions: ["MatchWebFonts.js"]
	});

	if (MathJax.Hub.Browser.isChrome /*&& MathJax.Hub.Browser.version.substr(0,3) === "32."*/) {
		MathJax.Hub.Register.StartupHook(
			"HTML-CSS Jax Config",
			function () {MathJax.OutputJax["HTML-CSS"].FontFaceBug = true}
		);
	}

	MathJax.Hub.Configured();

});

// Here is a very useful page:

// http://meta.math.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference

@@ -785,20 +785,14 @@
  %22%5C%5C
-operatorname
+mathrm
 %7Bd%7D%22
@@ -1031,24 +1031,42 @@
 rm%7B#1%7D%22,1%5D,%0A
+%09%09%09%09// Chemistry:%0A
 %09%09%09%09%22standar
@@ -1095,24 +1095,123 @@
 u29B5%7D%22,0%5D,%0A
+%09%09%09%09// Boolean Algebra:%0A%09%09%09%09%22true%22: %22%5C%5Cboldsymbol%7B%5C%5Crm%7BT%7D%7D%22,%0A%09%09%09%09%22false%22: %22%5C%5Cboldsymbol%7B%5C%5Crm%7BF%7D%7D%22,%0A
 %09%09%09%09%22and%22: %5B
@@ -1299,16 +1299,82 @@
 %7D%22, 1%5D,%0A
+%09%09%09%09%22xor%22: %5B%22%7B#1%7D %5C%5Cveebar %7B#2%7D%22, 2%5D,%0A%09%09%09%09%22equivalent%22: %22%5C%5Cequiv%22%0A
 %09%09%09%7D,%0A%09%09

Expand boolean logic symbol set