Update to v3.2.0 of mhchem.
This commit is contained in:
parent
3245058ccb
commit
8485788917
|
@ -22,11 +22,11 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
MathJax.Extension["TeX/mhchem"]={version:"3.0.6"},MathJax.Hub.Register.StartupHook("TeX Jax Ready",
|
||||
MathJax.Extension["TeX/mhchem"]={version:"3.2.0"},MathJax.Hub.Register.StartupHook("TeX Jax Ready",
|
||||
function(){var n=MathJax.InputJax.TeX,r=MathJax.Object.Subclass({string:"",Init:
|
||||
function(n){this.string=n},Parse:
|
||||
function(r){try{return o.go(t.go(this.string,r))}catch(r){n.Error(r)}}}),t={};t.go=
|
||||
function(n,r){if(!n)return n;void 0===r&&(r="ce");var o="0",a={};a.pL=0,n=n.replace(/[\u2212\u2013\u2014\u2010]/g,"-"),n=n.replace(/[\u2026]/g,"...");for(var e,u,i=[];;){e!==n?(u=10,e=n):u--;var s=t.c[r],l=s.e.length;n:for(var h=0;h<l;h++){var p=s.e[h],c=p.g[o]||p.g["*"]||null;if(c){var f=t.h(p.h,n);if(f){for(var m=t.j([],c.k),k=m.length,d=0;d<k;d++){var g,q=m[d],v=void 0;if(q.l&&(v=q.m,q=q.l),"string"==typeof q)if(s.g[q])g=s.g[q](a,f.h,v);else{if(!t.g[q])throw["MhchemBugA","mhchem bug A. Please report. ("+q+")"];g=t.g[q](a,f.h,v)}else"function"==typeof q&&(g=q(a,f.h));i=t.j(i,g)}if(o=c.n||o,!(n.length>0))return i;if(c.s||(n=f.t),!c.u)break n}}}if(u<=0)throw["MhchemBugU","mhchem bug U. Please report."]}},
|
||||
function(n,r){if(!n)return n;void 0===r&&(r="ce");var o="0",e={};e.pL=0,n=n.replace(/[\u2212\u2013\u2014\u2010]/g,"-"),n=n.replace(/[\u2026]/g,"...");for(var a,u,i=[];;){a!==n?(u=10,a=n):u--;var s=t.c[r],l=s.e.length;n:for(var h=0;h<l;h++){var p=s.e[h],c=p.g[o]||p.g["*"]||null;if(c){var f=t.h(p.h,n);if(f){for(var m=t.j([],c.k),k=m.length,d=0;d<k;d++){var g,q=m[d],v=void 0;if(q.l&&(v=q.m,q=q.l),"string"==typeof q)if(s.g[q])g=s.g[q](e,f.h,v);else{if(!t.g[q])throw["MhchemBugA","mhchem bug A. Please report. ("+q+")"];g=t.g[q](e,f.h,v)}else"function"==typeof q&&(g=q(e,f.h));i=t.j(i,g)}if(o=c.n||o,!(n.length>0))return i;if(c.s||(n=f.t),!c.u)break n}}}if(u<=0)throw["MhchemBugU","mhchem bug U. Please report."]}},
|
||||
t.j=
|
||||
function(n,r){return r?n?n.concat(r):[].concat(r):n},t.w={"~C":/^$/,"~A":/^./,"~B":/^./,"%m":/^\s/,"%l":/^\s(?=[A-Z\\$])/,"~@":/^[a-z]/,x:/^x/,x$:/^x$/,i$:/^i$/,"~M":/^(?:[a-zA-Z\u03B1-\u03C9\u0391-\u03A9?@]|(?:\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))))+/,"@z":/^\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))/,"~P":/^(?:([a-z])(?:$|[^a-zA-Z]))$/,"@%":/^\$(?:([a-z])(?:$|[^a-zA-Z]))\$$/,"~O":/^(?:\$?[\u03B1-\u03C9]\$?|\$?\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega)\s*\$?)(?:\s+|\{\}|(?![a-zA-Z]))$/,"~u":/^[0-9]+/,"@h":/^[+\-]?(?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))/,"@g":/^[+\-]?[0-9]+(?:[.,][0-9]+)?/,"%T":
|
||||
function(n){var r=n.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+)?)(\((?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+)?)\))?(?:([eE]|\s*(\*|x|\\times|\u00D7)\s*10\^)([+\-]?[0-9]+|\{[+\-]?[0-9]+\}))?/);return r&&r[0]?{h:r.splice(1),t:n.substr(r[0].length)}:null},aj:
|
||||
|
@ -59,13 +59,13 @@ function(n){return this["@W"](n,"\\color","\\","",/^(?=\{)/,"{","","","}")},"@u"
|
|||
function(n){return this["@W"](n,"\\ce{","","","}")},"~Z":/^(?:[+-][IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,"a~":/^(?:[+-]?\s?[IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,"%d":/^[IVX]+/,"@j":/^[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+(?:\$[a-z]\$|[a-z])?$/,"~%":
|
||||
function(n){var r;if(r=n.match(/^(?:(?:(?:\([+\-]?[0-9]+\/[0-9]+\)|[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+|[+\-]?[0-9]+[.,][0-9]+|[+\-]?\.[0-9]+|[+\-]?[0-9]+)(?:[a-z](?=\s*[A-Z]))?)|[+\-]?[a-z](?=\s*[A-Z])|\+(?!\s))/))return{h:r[0],t:n.substr(r[0].length)};var t=this["@W"](n,"","$","$","");return t&&(r=t.h.match(/^\$(?:\(?[+\-]?(?:[0-9]*[a-z]?[+\-])?[0-9]*[a-z](?:[+\-][0-9]*[a-z]?)?\)?|\+|-)\$$/))?{h:r[0],t:n.substr(r[0].length)}:null},"~a":
|
||||
function(n){return this["~%"](n)},"@b":/^(?:[A-Z][a-z]{0,2}|i)(?=,)/,"~E":
|
||||
function(n){if(n.match(/^\([a-z]+\)$/))return null;var r=n.match(/^(?:[a-z]|(?:[0-9\ \+\-\,\.\(\)]+[a-z])+[0-9\ \+\-\,\.\(\)]*|(?:[a-z][0-9\ \+\-\,\.\(\)]+)+[a-z]?)$/);return r?{h:r[0],t:n.substr(r[0].length)}:null},"%z":/^(?:pH|pOH|pC|pK|iPr|iBu)(?=$|[^a-zA-Z])/,"~v":/^pK([abw]|eq|sp)(?=$|[^a-zA-Z0-9])/,"~w":/^pK_([abw])/,"~x":/^pK_{([abw]|eq|sp)}/,"pK(a1)":/^pK([ab])([123])(?=$|[^a-zA-Z0-9])/,"pK_{(a1)}":/^pK_{([ab])([123])}/,ab:/^K([abwfcp]|eq|sp)(?=$|[^a-zA-Z0-9])/,ac:/^K_([abwfcpCP])/,ad:/^K_{([abwfcpCP]|eq|sp)}/,"K(a1)":/^K([ab])([123])(?=$|[^a-zA-Z0-9])/,"K_{(a1)}":/^K_{([ab])([123])}/,"/":/^\s*(\/)\s*/,"//":/^\s*(\/\/)\s*/,"*":/^\s*\*\s*/,"@W":
|
||||
function(n,r,t,o,a,e,u,i,s,l){var h=this["@V"](n,r);if(null===h)return null;if(n=n.substr(h.length),h=this["@V"](n,t),null===h)return null;var p=this["@U"](n,h.length,o||a);if(null===p)return null;var c=n.substring(0,o?p.y:p.z);if(e||u){var f=this["@W"](n.substr(p.y),e,u,i,s);if(null===f)return null;var m=[c,f.h];return l&&(m=m.join("")),{h:m,t:f.t}}return{h:c,t:n.substr(p.y)}},
|
||||
function(n){if(n.match(/^\([a-z]+\)$/))return null;var r=n.match(/^(?:[a-z]|(?:[0-9\ \+\-\,\.\(\)]+[a-z])+[0-9\ \+\-\,\.\(\)]*|(?:[a-z][0-9\ \+\-\,\.\(\)]+)+[a-z]?)$/);return r?{h:r[0],t:n.substr(r[0].length)}:null},"%z":/^(?:pH|pOH|pC|pK|iPr|iBu)(?=$|[^a-zA-Z])/,"/":/^\s*(\/)\s*/,"//":/^\s*(\/\/)\s*/,"*":/^\s*\*\s*/,"@W":
|
||||
function(n,r,t,o,e,a,u,i,s,l){var h=this["@V"](n,r);if(null===h)return null;if(n=n.substr(h.length),h=this["@V"](n,t),null===h)return null;var p=this["@U"](n,h.length,o||e);if(null===p)return null;var c=n.substring(0,o?p.y:p.z);if(a||u){var f=this["@W"](n.substr(p.y),a,u,i,s);if(null===f)return null;var m=[c,f.h];return l&&(m=m.join("")),{h:m,t:f.t}}return{h:c,t:n.substr(p.y)}},
|
||||
"@V":
|
||||
function(n,r){if("string"==typeof r)return 0!==n.indexOf(r)?null:r;var t=n.match(r);return t?t[0]:null},"@U":
|
||||
function(n,r,t){for(var o=0;r<n.length;){var a=n.charAt(r),e=this["@V"](n.substr(r),t);if(null!==e&&0===o)return{z:r,y:r+e.length};if("{"===a)o++;else if("}"===a){if(0===o)throw["ExtraCloseMissingOpen","Extra close brace or missing open brace"];o--}r++}return null}},
|
||||
function(n,r,t){for(var o=0;r<n.length;){var e=n.charAt(r),a=this["@V"](n.substr(r),t);if(null!==a&&0===o)return{z:r,y:r+a.length};if("{"===e)o++;else if("}"===e){if(0===o)throw["ExtraCloseMissingOpen","Extra close brace or missing open brace"];o--}r++}return null}},
|
||||
t.h=
|
||||
function(n,r){var o=t.w[n];if(void 0===o)throw["MhchemBugP","mhchem bug P. Please report. ("+n+")"];if("function"==typeof o)return t.w[n](r);var a=r.match(o);if(a){var e;return e=a[2]?[a[1],a[2]]:a[1]?a[1]:a[0],{h:e,t:r.substr(a[0].length)}}return null},t.g={"a=":
|
||||
function(n,r){var o=t.w[n];if(void 0===o)throw["MhchemBugP","mhchem bug P. Please report. ("+n+")"];if("function"==typeof o)return t.w[n](r);var e=r.match(o);if(e){var a;return a=e[2]?[e[1],e[2]]:e[1]?e[1]:e[0],{h:a,t:r.substr(e[0].length)}}return null},t.g={"a=":
|
||||
function(n,r){n.a=(n.a||"")+r},"b=":
|
||||
function(n,r){n.b=(n.b||"")+r},"p=":
|
||||
function(n,r){n.p=(n.p||"")+r},"o=":
|
||||
|
@ -92,18 +92,14 @@ function(n,r,t){return{l:"~f",A:t||r}},
|
|||
function(n,r){return{l:"~l",B:r[0]}},
|
||||
ce:
|
||||
function(n,r){return t.go(r)},"@k":
|
||||
function(n,r){var o;r.match(/^[+\-]/)&&(o=[r.substr(0,1)],r=r.substr(1));var a=r.match(/^([0-9]+|\$[a-z]\$|[a-z])\/([0-9]+)(\$[a-z]\$|[a-z])?$/);return a[1]=a[1].replace(/\$/g,""),o=t.j(o,{l:"~F",p1:a[1],p2:a[2]}),a[3]&&(a[3]=a[3].replace(/\$/g,""),o=t.j(o,{l:"%r",p1:a[3]})),o},"@l":
|
||||
function(n,r){var o;r.match(/^[+\-]/)&&(o=[r.substr(0,1)],r=r.substr(1));var e=r.match(/^([0-9]+|\$[a-z]\$|[a-z])\/([0-9]+)(\$[a-z]\$|[a-z])?$/);return e[1]=e[1].replace(/\$/g,""),o=t.j(o,{l:"~F",p1:e[1],p2:e[2]}),e[3]&&(e[3]=e[3].replace(/\$/g,""),o=t.j(o,{l:"%r",p1:e[3]})),o},"@l":
|
||||
function(n,r){return t.go(r,"@l")}},
|
||||
t.c={},t.C=
|
||||
function(n){var r,t,o,a,e={};for(r in n)if(r.indexOf("|")!==-1)for(o=r.split("|"),a=0;a<o.length;a++)e[o[a]]=n[r];else e[r]=n[r];var u=[];for(r in e){var i={},s=e[r];for(t in s)if(t.indexOf("|")!==-1)for(o=t.split("|"),a=0;a<o.length;a++)i[o[a]]=s[t];else i[t]=s[t];u.push({h:r,g:i})}return u},t.c.ce={e:t.C({"~C":{"*":{k:"~T"}},
|
||||
function(n){var r,t,o,e,a={};for(r in n)if(r.indexOf("|")!==-1)for(o=r.split("|"),e=0;e<o.length;e++)a[o[e]]=n[r];else a[r]=n[r];var u=[];for(r in a){var i={},s=a[r];for(t in s)if(t.indexOf("|")!==-1)for(o=t.split("|"),e=0;e<o.length;e++)i[o[e]]=s[t];else i[t]=s[t];u.push({h:r,g:i})}return u},t.c.ce={e:t.C({"~C":{"*":{k:"~T"}},
|
||||
"~A":{"0|1|2":{k:"%F",s:!0,u:!0}},
|
||||
"~Z":{0:{k:"a%"}},
|
||||
"@m":{r:{k:"%b",n:"rt"},rd:{k:"%g",n:"%i"}},
|
||||
"~c":{"0|1|2|as":{k:["%j","~T","~Q"],n:"1"}},
|
||||
"~v|~w|~x":{"0|1|2":{k:[{l:"~T",m:1},{l:"~K",m:"aa"}],n:"1"}},
|
||||
"ab|ac|ad":{"0|1|2":{k:[{l:"~T",m:1},{l:"~K",m:"Ka"}],n:"1"}},
|
||||
"pK(a1)|pK_{(a1)}":{"0|1|2":{k:[{l:"~T",m:1},{l:"~L",m:"af"}],n:"1"}},
|
||||
"K(a1)|K_{(a1)}":{"0|1|2":{k:[{l:"~T",m:1},{l:"~L",m:"ag"}],n:"1"}},
|
||||
"%z":{"0|1|2":{k:["o=","~T"],n:"1"}},
|
||||
"~R":{"0|1|2|3":{k:"o=",n:"o"}},
|
||||
"->":{"0|1|2|3":{k:"r=",n:"r"},"a|as":{k:["~T","r="],n:"r"},"*":{k:["~T","r="],n:"r"}},
|
||||
|
@ -152,12 +148,12 @@ ae:{"d|D|q|qd|qD|dq":{k:["~T","q="],n:"q"}},
|
|||
"@G|@F|@E":{"0|1|2|3|a|as|b|p|bp|o|c0":{k:["o=","~T"],n:"3"},"*":{k:["~T","o=","~T"],n:"3"}},
|
||||
"~S":{"*":{k:[{l:"~T",m:1},"~s"],n:"3"}},
|
||||
"~B":{a:{k:"@Z",n:"o",s:!0},as:{k:[{l:"~T"},"%k"],n:"1",s:!0},"r|rt|rd|%i|%h":{k:["~T"],n:"0",s:!0},"*":{k:["~T","~s"],n:"3"}}}),g:{"~N":
|
||||
function(n,r){var o;if(n.d.match(/^[0-9]+$/)){var a=n.d;n.d=void 0,o=this["~T"](n),n.b=a}else o=this["~T"](n);return t.g["o="](n,r),o},"~t":
|
||||
function(n,r){var o;if(n.d.match(/^[0-9]+$/)){var e=n.d;n.d=void 0,o=this["~T"](n),n.b=e}else o=this["~T"](n);return t.g["o="](n,r),o},"~t":
|
||||
function(n,r){n.d=r,n["%I"]="kv"},"~g":
|
||||
function(n,r){if(n.yB){var o=t.j(o,this["~T"](n));return o=t.j(o,t.g["~f"](n,r,"-"))}n.d=r},"@e":
|
||||
function(n,r,o){var a=o||this["@X"](n,r),e=t.j(null,this["~T"](n,r));return e=a?t.j(e,{l:"~I"}):t.j(e,t.g["~f"](n,r,"-"))},"@d":
|
||||
function(n,r,o){var a,e=o||this["@X"](n,r);if(e)a=t.j(a,this["~T"](n,r)),a=t.j(a,{l:"~I"});else{var u=t.h("~u",n.d||"");u&&""===u.t?(a=t.j(null,t.g["d="](n,r)),a=t.j(a,this["~T"](n))):(a=t.j(a,this["~T"](n,r)),a=t.j(a,t.g["~f"](n,r,"-")))}return a},"@X":
|
||||
function(n,r){var o=t.h("~R",n.o||""),a=t.h("~O",n.o||""),e=t.h("~P",n.o||""),u=t.h("@%",n.o||""),i="-"===r&&(o&&""===o.t||a||e||u);return!i||n.a||n.b||n.p||n.d||n.q||o||!e||(n.o="$"+n.o+"$"),i},"@Z":
|
||||
function(n,r,o){var e=o||this["@X"](n,r),a=t.j(null,this["~T"](n,r));return a=e?t.j(a,{l:"~I"}):t.j(a,t.g["~f"](n,r,"-"))},"@d":
|
||||
function(n,r,o){var e,a=o||this["@X"](n,r);if(a)e=t.j(e,this["~T"](n,r)),e=t.j(e,{l:"~I"});else{var u=t.h("~u",n.d||"");u&&""===u.t?(e=t.j(null,t.g["d="](n,r)),e=t.j(e,this["~T"](n))):(e=t.j(e,this["~T"](n,r)),e=t.j(e,t.g["~f"](n,r,"-")))}return e},"@X":
|
||||
function(n,r){var o=t.h("~R",n.o||""),e=t.h("~O",n.o||""),a=t.h("~P",n.o||""),u=t.h("@%",n.o||""),i="-"===r&&(o&&""===o.t||e||a||u);return!i||n.a||n.b||n.p||n.d||n.q||o||!a||(n.o="$"+n.o+"$"),i},"@Z":
|
||||
function(n,r){n.o=n.a,n.a=void 0},"%k":
|
||||
function(n,r){n.sb=!0},"%j":
|
||||
function(n,r){n.sb=!1},"%E":
|
||||
|
@ -169,7 +165,7 @@ function(n,r){return r=t.go(r,"o"),{l:"%p",p1:r}},
|
|||
"~q":
|
||||
function(n,r){var t=r.replace(/\s*$/,""),o=t!==r;return o&&0===n.pL?{l:"~n",p1:t}:{l:"~o",p1:t}},
|
||||
"~T":
|
||||
function(n,r,o){var a;n.r?("M"===n.rdt?n.rd=t.go(n.rd,"%r"):"T"===n.rdt?n.rd=[{l:"%s",p1:n.rd}]:n.rd=t.go(n.rd),"M"===n.rqt?n.rq=t.go(n.rq,"%r"):"T"===n.rqt?n.rq=[{l:"%s",p1:n.rq}]:n.rq=t.go(n.rq),a={l:"~b",r:n.r,rd:n.rd,rq:n.rq}):(a=[],n.a||n.b||n.p||n.o||n.q||n.d||o?(n.sb&&a.push({l:"~D"}),n.o||n.q||n.d||n.b||n.p||2===o?n.o||n.q||n.d||!n.b&&!n.p?n.o&&"kv"===n["%I"]&&t.h("a~",n.d||"")?n["%I"]="~Y":n.o&&"kv"===n["%I"]&&!n.q&&(n["%I"]=void 0):(n.o=n.a,n.d=n.b,n.q=n.p,n.a=n.b=n.p=void 0):(n.o=n.a,n.a=void 0),n.a=t.go(n.a,"a"),n.b=t.go(n.b,"bd"),n.p=t.go(n.p,"pq"),n.o=t.go(n.o,"o"),"~Y"===n["%I"]?n.d=t.go(n.d,"~Y"):n.d=t.go(n.d,"bd"),n.q=t.go(n.q,"pq"),a.push({l:"~h",a:n.a,b:n.b,p:n.p,o:n.o,q:n.q,d:n.d,"%I":n["%I"]})):a=null);for(var e in n)"pL"!==e&&"yB"!==e&&delete n[e];return a},"a%":
|
||||
function(n,r,o){var e;n.r?("M"===n.rdt?n.rd=t.go(n.rd,"%r"):"T"===n.rdt?n.rd=[{l:"%s",p1:n.rd}]:n.rd=t.go(n.rd),"M"===n.rqt?n.rq=t.go(n.rq,"%r"):"T"===n.rqt?n.rq=[{l:"%s",p1:n.rq}]:n.rq=t.go(n.rq),e={l:"~b",r:n.r,rd:n.rd,rq:n.rq}):(e=[],n.a||n.b||n.p||n.o||n.q||n.d||o?(n.sb&&e.push({l:"~D"}),n.o||n.q||n.d||n.b||n.p||2===o?n.o||n.q||n.d||!n.b&&!n.p?n.o&&"kv"===n["%I"]&&t.h("a~",n.d||"")?n["%I"]="~Y":n.o&&"kv"===n["%I"]&&!n.q&&(n["%I"]=void 0):(n.o=n.a,n.d=n.b,n.q=n.p,n.a=n.b=n.p=void 0):(n.o=n.a,n.a=void 0),n.a=t.go(n.a,"a"),n.b=t.go(n.b,"bd"),n.p=t.go(n.p,"pq"),n.o=t.go(n.o,"o"),"~Y"===n["%I"]?n.d=t.go(n.d,"~Y"):n.d=t.go(n.d,"bd"),n.q=t.go(n.q,"pq"),e.push({l:"~h",a:n.a,b:n.b,p:n.p,o:n.o,q:n.q,d:n.d,"%I":n["%I"]})):e=null);for(var a in n)"pL"!==a&&"yB"!==a&&delete n[a];return e},"a%":
|
||||
function(n,r){var o=["{"];return o=t.j(o,t.go(r,"~Y")),o=o.concat(["}"])},"~H":
|
||||
function(n,r){return{l:"~G",p1:t.go(r[0]),p2:t.go(r[1])}},
|
||||
"~X":
|
||||
|
@ -285,7 +281,7 @@ function(n,r,t){return{l:"~Q",A:t||r}},
|
|||
"%m":
|
||||
function(n,r){return{l:"%Q"}},
|
||||
"~T":
|
||||
function(n,r){var o,a=t.h("%A",n.d||"");a&&""===a.t&&(n.d=a.h);var e=t.h("%A",n.q||"");e&&""===e.t&&(n.q=e.h),n.d&&(n.d=n.d.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),n.d=n.d.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F")),n.q?(n.d=t.go(n.d,"pu"),n.q=n.q.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),n.q=n.q.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F"),n.q=t.go(n.q,"pu"),"//"===n.o?o={l:"%S",p1:n.d,p2:n.q}:(o=n.d,o=n.d.length>1||n.q.length>1?t.j(o,{l:"%V"}):t.j(o,{l:"/"}),o=t.j(o,n.q))):o=t.go(n.d,"%R");for(var u in n)delete n[u];return o}}},
|
||||
function(n,r){var o,e=t.h("%A",n.d||"");e&&""===e.t&&(n.d=e.h);var a=t.h("%A",n.q||"");a&&""===a.t&&(n.q=a.h),n.d&&(n.d=n.d.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),n.d=n.d.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F")),n.q?(n.d=t.go(n.d,"pu"),n.q=n.q.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),n.q=n.q.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F"),n.q=t.go(n.q,"pu"),"//"===n.o?o={l:"%S",p1:n.d,p2:n.q}:(o=n.d,o=n.d.length>1||n.q.length>1?t.j(o,{l:"%V"}):t.j(o,{l:"/"}),o=t.j(o,n.q))):o=t.go(n.d,"%R");for(var u in n)delete n[u];return o}}},
|
||||
t.c["%R"]={e:t.C({"~C":{"*":{k:"~T"}},
|
||||
"*":{"*":{k:["~T","%N"],n:"0"}},
|
||||
"@E":{"*":{k:"%c"},n:"1"},"%m":{"*":{k:["~T","%m"],n:"0"}},
|
||||
|
@ -297,15 +293,15 @@ function(n,r){return{l:"%O"}},
|
|||
function(n,r){n.rm+="^{"+r+"}"},"%m":
|
||||
function(n,r){return{l:"ah"}},
|
||||
"~T":
|
||||
function(n,r){var o;if(n.rm){var a=t.h("%A",n.rm||"");o=a&&""===a.t?t.go(a.h,"pu"):{l:"rm",p1:n.rm}}for(var e in n)delete n[e];return o}}},
|
||||
function(n,r){var o;if(n.rm){var e=t.h("%A",n.rm||"");o=e&&""===e.t?t.go(e.h,"pu"):{l:"rm",p1:n.rm}}for(var a in n)delete n[a];return o}}},
|
||||
t.c["%X"]={e:t.C({"~C":{0:{k:"~U"},o:{k:"~V"}},
|
||||
",":{0:{k:["~U","~q"],n:"o"}},
|
||||
".":{0:{k:["~U","~s"],n:"o"}},
|
||||
"~A":{"*":{k:"%t"}}}),g:{"~q":
|
||||
function(n,r){return{l:"~r"}},
|
||||
"~U":
|
||||
function(n,r){var t=[];if(n.text.length>4){var o=n.text.length%3;0===o&&(o=3);for(var a=n.text.length-3;a>0;a-=3)t.push(n.text.substr(a,3)),t.push({l:"%W"});t.push(n.text.substr(0,o)),t.reverse()}else t.push(n.text);for(var e in n)delete n[e];return t},"~V":
|
||||
function(n,r){var t=[];if(n.text.length>4){for(var o=n.text.length-3,a=0;a<o;a+=3)t.push(n.text.substr(a,3)),t.push({l:"%W"});t.push(n.text.substr(a))}else t.push(n.text);for(var e in n)delete n[e];return t}}};var o={H:{"~h":
|
||||
function(n,r){var t=[];if(n.text.length>4){var o=n.text.length%3;0===o&&(o=3);for(var e=n.text.length-3;e>0;e-=3)t.push(n.text.substr(e,3)),t.push({l:"%W"});t.push(n.text.substr(0,o)),t.reverse()}else t.push(n.text);for(var a in n)delete n[a];return t},"~V":
|
||||
function(n,r){var t=[];if(n.text.length>4){for(var o=n.text.length-3,e=0;e<o;e+=3)t.push(n.text.substr(e,3)),t.push({l:"%W"});t.push(n.text.substr(e))}else t.push(n.text);for(var a in n)delete n[a];return t}}};var o={H:{"~h":
|
||||
function(n){var r="";return n.a=o.go2(n.a),n.b=o.go2(n.b),n.p=o.go2(n.p),n.o=o.go2(n.o),n.q=o.go2(n.q),n.d=o.go2(n.d),n.a&&(n.a.match(/^[+\-]/)&&(n.a="{"+n.a+"}"),r+=n.a+"\\,"),(n.b||n.p)&&(r+="{\\vphantom{X}}",r+="^{\\hphantom{"+(n.b||"")+"}}_{\\hphantom{"+(n.p||"")+"}}",r+="{\\vphantom{X}}",r+="^{\\smash[t]{\\vphantom{2}}\\llap{"+(n.b||"")+"}}",r+="_{\\vphantom{2}\\llap{\\smash[t]{"+(n.p||"")+"}}}"),n.o&&(n.o.match(/^[+\-]/)&&(n.o="{"+n.o+"}"),r+=n.o),"kv"===n["%I"]?((n.d||n.q)&&(r+="{\\vphantom{X}}"),n.d&&(r+="^{"+n.d+"}"),n.q&&(r+="_{\\smash[t]{"+n.q+"}}")):"~Y"===n["%I"]?(n.d&&(r+="{\\vphantom{X}}",r+="^{"+n.d+"}"),n.q&&(r+="{\\vphantom{X}}",r+="_{\\smash[t]{"+n.q+"}}")):(n.q&&(r+="{\\vphantom{X}}",r+="_{\\smash[t]{"+n.q+"}}"),n.d&&(r+="{\\vphantom{X}}",r+="^{"+n.d+"}")),r},rm:
|
||||
function(n){return"\\mathrm{"+n.p1+"}"},"%s":
|
||||
function(n){return n.p1.match(/[\^_]/)?(n.p1=n.p1.replace(" ","~").replace("-","\\text{-}"),"\\mathrm{"+n.p1+"}"):"\\text{"+n.p1+"}"},"%d":
|
||||
|
@ -324,8 +320,8 @@ function(n){return"{\\color{"+n.F+"}{"+o.go2(n.G)+"}}"},"~l":
|
|||
function(n){return"\\color{"+n.B+"}"},"~b":
|
||||
function(n){n.rd=o.go2(n.rd),n.rq=o.go2(n.rq);var r=o.J[n.r];return n.rd||n.rq?"<=>"===n.r||"<=>>"===n.r||"<<=>"===n.r||"<-->"===n.r?(r="\\long"+r,n.rd&&(r="\\overset{"+n.rd+"}{"+r+"}"),n.rq&&(r="\\underset{\\lower7mu{"+n.rq+"}}{"+r+"}"),r=" {}\\mathrel{"+r+"}{} "):(n.rq&&(r+="[{"+n.rq+"}]"),r+="{"+n.rd+"}",r=" {}\\mathrel{\\x"+r+"}{} "):r=" {}\\mathrel{\\long"+r+"}{} ",r},"~Q":
|
||||
function(n){return o.K[n.A]}},
|
||||
J:{"->":"rightarrow","\u2192":"rightarrow","\u27f6":"rightarrow","<-":"leftarrow","<->":"leftrightarrow","<-->":"leftrightarrows","<=>":"rightleftharpoons","\u21cc":"rightleftharpoons","<=>>":"Rightleftharpoons","<<=>":"Leftrightharpoons"},I:{"-":"{-}",1:"{-}","=":"{=}",2:"{=}","#":"{\\equiv}",3:"{\\equiv}","~":"{\\tripledash}","~-":"{\\rlap{\\lower.1em{-}}\\raise.1em{\\tripledash}}","~=":"{\\rlap{\\lower.2em{-}}\\rlap{\\raise.2em{\\tripledash}}-}","~--":"{\\rlap{\\lower.2em{-}}\\rlap{\\raise.2em{\\tripledash}}-}","-~-":"{\\rlap{\\lower.2em{-}}\\rlap{\\raise.2em{-}}\\tripledash}","...":"{{\\cdot}{\\cdot}{\\cdot}}","....":"{{\\cdot}{\\cdot}{\\cdot}{\\cdot}}","->":"{\\rightarrow}","<-":"{\\leftarrow}","<":"{<}",">":"{>}"},L:{"%m":" ","~D":"~","%Q":"~",ah:"\\mkern3mu ","%W":"\\mkern2mu ","~r":"{,}","~n":"{{0}}\\mkern6mu ","~o":"{{0}}\\mkern3mu ","~p":"{{0}}\\mkern1mu ","~I":"\\text{-}","~~":"\\,{\\cdot}\\,","~y":"\\mkern1mu \\bullet\\mkern1mu ","@n":"{\\times}","%%":"\\prime ","%N":"\\cdot ","%O":"\\mkern1mu{\\cdot}\\mkern1mu ","%P":"\\times ","~i":"{\\sim}","^":"uparrow",v:"downarrow","~z":"\\ldots ",aa:"\\mathrm{p}K_{\\mathrm{{0}}}",Ka:"K_{\\mathrm{{0}}}",af:"\\mathrm{p}K_{\\mathrm{{0}_{{1}}}}",ag:"K_{\\mathrm{{0}_{{1}}}}","/":"/","%V":"\\,/\\,",al:"{0} "},K:{"+":" {}+{} ","-":" {}-{} ","=":" {}={} ","<":" {}<{} ",">":" {}>{} ","<<":" {}\\ll{} ",">>":" {}\\gg{} ","\\pm":" {}\\pm{} ","\\approx":" {}\\approx{} ","$\\approx$":" {}\\approx{} ",v:" \\downarrow{} ","(v)":" \\downarrow{} ","^":" \\uparrow{} ","(^)":" \\uparrow{} "},go:
|
||||
function(n,r){if(!n)return n;for(var t="",o=!1,a=0;a<n.length;a++){var e=n[a];if("string"==typeof e)t+=e;else if(this.H[e.l])t+=this.H[e.l](e);else{if(!this.L[e.l])throw["MhchemBugT","mhchem bug T. Please report."];var u=this.L[e.l];u=u.replace("{0}",e.p1||""),u=u.replace("{1}",e.p2||""),t+=u,"al"===e.l&&(o=!0)}}return r||o||(t="{"+t+"}"),t},go2:
|
||||
J:{"->":"rightarrow","\u2192":"rightarrow","\u27f6":"rightarrow","<-":"leftarrow","<->":"leftrightarrow","<-->":"leftrightarrows","<=>":"rightleftharpoons","\u21cc":"rightleftharpoons","<=>>":"Rightleftharpoons","<<=>":"Leftrightharpoons"},I:{"-":"{-}",1:"{-}","=":"{=}",2:"{=}","#":"{\\equiv}",3:"{\\equiv}","~":"{\\tripledash}","~-":"{\\rlap{\\lower.1em{-}}\\raise.1em{\\tripledash}}","~=":"{\\rlap{\\lower.2em{-}}\\rlap{\\raise.2em{\\tripledash}}-}","~--":"{\\rlap{\\lower.2em{-}}\\rlap{\\raise.2em{\\tripledash}}-}","-~-":"{\\rlap{\\lower.2em{-}}\\rlap{\\raise.2em{-}}\\tripledash}","...":"{{\\cdot}{\\cdot}{\\cdot}}","....":"{{\\cdot}{\\cdot}{\\cdot}{\\cdot}}","->":"{\\rightarrow}","<-":"{\\leftarrow}","<":"{<}",">":"{>}"},L:{"%m":" ","~D":"~","%Q":"~",ah:"\\mkern3mu ","%W":"\\mkern2mu ","~r":"{,}","~n":"{{0}}\\mkern6mu ","~o":"{{0}}\\mkern3mu ","~p":"{{0}}\\mkern1mu ","~I":"\\text{-}","~~":"\\,{\\cdot}\\,","~y":"\\mkern1mu \\bullet\\mkern1mu ","@n":"{\\times}","%%":"\\prime ","%N":"\\cdot ","%O":"\\mkern1mu{\\cdot}\\mkern1mu ","%P":"\\times ","~i":"{\\sim}","^":"uparrow",v:"downarrow","~z":"\\ldots ","/":"/","%V":"\\,/\\,",al:"{0} "},K:{"+":" {}+{} ","-":" {}-{} ","=":" {}={} ","<":" {}<{} ",">":" {}>{} ","<<":" {}\\ll{} ",">>":" {}\\gg{} ","\\pm":" {}\\pm{} ","\\approx":" {}\\approx{} ","$\\approx$":" {}\\approx{} ",v:" \\downarrow{} ","(v)":" \\downarrow{} ","^":" \\uparrow{} ","(^)":" \\uparrow{} "},go:
|
||||
function(n,r){if(!n)return n;for(var t="",o=!1,e=0;e<n.length;e++){var a=n[e];if("string"==typeof a)t+=a;else if(this.H[a.l])t+=this.H[a.l](a);else{if(!this.L[a.l])throw["MhchemBugT","mhchem bug T. Please report."];var u=this.L[a.l];u=u.replace("{0}",a.p1||""),u=u.replace("{1}",a.p2||""),t+=u,"al"===a.l&&(o=!0)}}return r||o||(t="{"+t+"}"),t},go2:
|
||||
function(n){return this.go(n,!0)}};MathJax.Extension["TeX/mhchem"].CE=r,n.Definitions.Add({macros:{ce:"CE",pu:"PU",xleftrightarrow:["Extension","AMSmath"],xrightleftharpoons:["Extension","AMSmath"],xRightleftharpoons:["Extension","AMSmath"],xLeftrightharpoons:["Extension","AMSmath"],longrightleftharpoons:["Macro","\\stackrel{\\textstyle{-}\\!\\!{\\rightharpoonup}}{\\smash{{\\leftharpoondown}\\!\\!{-}}}"],longRightleftharpoons:["Macro","\\stackrel{\\textstyle{-}\\!\\!{\\rightharpoonup}}{\\smash{\\leftharpoondown}}"],longLeftrightharpoons:["Macro","\\stackrel{\\textstyle\\vphantom{{-}}{\\rightharpoonup}}{\\smash{{\\leftharpoondown}\\!\\!{-}}}"],longleftrightarrows:["Macro","\\stackrel{\\longrightarrow}{\\smash{\\longleftarrow}\\Rule{0px}{.25em}{0px}}"],tripledash:["Macro","\\vphantom{-}\\raise2mu{\\kern2mu\\tiny\\text{-}\\kern1mu\\text{-}\\kern1mu\\text{-}\\kern2mu}"]}},
|
||||
null,!0),MathJax.Extension["TeX/AMSmath"]||n.Definitions.Add({macros:{xrightarrow:["Extension","AMSmath"],xleftarrow:["Extension","AMSmath"]}},
|
||||
null,!0),MathJax.Hub.Register.StartupHook("TeX AMSmath Ready",
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
/*************************************************************
|
||||
*
|
||||
* MathJax/extensions/TeX/mhchem3/mhchem.js
|
||||
* MathJax/extensions/TeX/mhchem.js
|
||||
*
|
||||
* Implements the \ce command for handling chemical formulas
|
||||
* from the mhchem LaTeX package.
|
||||
|
@ -33,7 +33,7 @@
|
|||
|
||||
|
||||
MathJax.Extension["TeX/mhchem"] = {
|
||||
version: "3.0.6"
|
||||
version: "3.2.0"
|
||||
};
|
||||
|
||||
MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
||||
|
@ -341,16 +341,6 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
|||
return null;
|
||||
},
|
||||
'uprightEntities': /^(?:pH|pOH|pC|pK|iPr|iBu)(?=$|[^a-zA-Z])/,
|
||||
'pK(a)': /^pK([abw]|eq|sp)(?=$|[^a-zA-Z0-9])/, // acid/base dissociation constant, freezing/boiling-point depression, ionic product for water, equilibrium constants
|
||||
'pK_(a)': /^pK_([abw])/,
|
||||
'pK_{(a)}': /^pK_{([abw]|eq|sp)}/,
|
||||
'pK(a1)': /^pK([ab])([123])(?=$|[^a-zA-Z0-9])/,
|
||||
'pK_{(a1)}': /^pK_{([ab])([123])}/,
|
||||
'K(a)': /^K([abwfcp]|eq|sp)(?=$|[^a-zA-Z0-9])/,
|
||||
'K_(a)': /^K_([abwfcpCP])/,
|
||||
'K_{(a)}': /^K_{([abwfcpCP]|eq|sp)}/,
|
||||
'K(a1)': /^K([ab])([123])(?=$|[^a-zA-Z0-9])/,
|
||||
'K_{(a1)}': /^K_{([ab])([123])}/,
|
||||
'/': /^\s*(\/)\s*/,
|
||||
'//': /^\s*(\/\/)\s*/,
|
||||
'*': /^\s*\*\s*/,
|
||||
|
@ -557,14 +547,6 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
|||
'rd': { action: 'rqt=', nextState: 'rdt' } },
|
||||
'arrowUpDown': {
|
||||
'0|1|2|as': { action: [ 'sb=false', 'output', 'operator' ], nextState: '1' } },
|
||||
'pK(a)|pK_(a)|pK_{(a)}': {
|
||||
'0|1|2': { action: [ { type: 'output', option: 1 }, { type: 'insert+p1', option: 'pKa' } ], nextState: '1' } },
|
||||
'K(a)|K_(a)|K_{(a)}': {
|
||||
'0|1|2': { action: [ { type: 'output', option: 1 }, { type: 'insert+p1', option: 'Ka' } ], nextState: '1' } },
|
||||
'pK(a1)|pK_{(a1)}': {
|
||||
'0|1|2': { action: [ { type: 'output', option: 1 }, { type: 'insert+p1+p2', option: 'pKa1' } ], nextState: '1' } },
|
||||
'K(a1)|K_{(a1)}': {
|
||||
'0|1|2': { action: [ { type: 'output', option: 1 }, { type: 'insert+p1+p2', option: 'Ka1' } ], nextState: '1' } },
|
||||
'uprightEntities': {
|
||||
'0|1|2': { action: [ 'o=', 'output' ], nextState: '1' } },
|
||||
'orbital': {
|
||||
|
@ -1571,10 +1553,6 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
|||
'^': "uparrow",
|
||||
'v': "downarrow",
|
||||
'ellipsis': "\\ldots ",
|
||||
'pKa': "\\mathrm{p}K_{\\mathrm{{0}}}",
|
||||
'Ka': "K_{\\mathrm{{0}}}",
|
||||
'pKa1': "\\mathrm{p}K_{\\mathrm{{0}_{{1}}}}",
|
||||
'Ka1': "K_{\\mathrm{{0}_{{1}}}}",
|
||||
'/': "/",
|
||||
' / ': "\\,/\\,",
|
||||
'1st-level escape': "{0} " // &, \\\\, \\hline
|
||||
|
@ -1712,4 +1690,4 @@ MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
|
|||
|
||||
});
|
||||
|
||||
MathJax.Ajax.loadComplete("[mhchem]/mhchem.js");
|
||||
MathJax.Ajax.loadComplete("[mhchem]/unpacked/mhchem.js");
|
||||
|
|
Loading…
Reference in New Issue
Block a user