temml 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +44 -0
  3. package/contrib/auto-render/README.md +89 -0
  4. package/contrib/auto-render/auto-render.js +128 -0
  5. package/contrib/auto-render/dist/auto-render.js +217 -0
  6. package/contrib/auto-render/dist/auto-render.min.js +1 -0
  7. package/contrib/auto-render/splitAtDelimiters.js +84 -0
  8. package/contrib/auto-render/test/auto-render-spec.js +234 -0
  9. package/contrib/auto-render/test/auto-render.js +217 -0
  10. package/contrib/auto-render/test/test_page.html +59 -0
  11. package/contrib/mhchem/README.md +26 -0
  12. package/contrib/mhchem/mhchem.js +1705 -0
  13. package/contrib/mhchem/mhchem.min.js +1 -0
  14. package/contrib/physics/README.md +20 -0
  15. package/contrib/physics/physics.js +131 -0
  16. package/contrib/texvc/README.md +23 -0
  17. package/contrib/texvc/texvc.js +61 -0
  18. package/dist/Temml-Asana.css +201 -0
  19. package/dist/Temml-Latin-Modern.css +216 -0
  20. package/dist/Temml-Libertinus.css +214 -0
  21. package/dist/Temml-Local.css +194 -0
  22. package/dist/Temml-STIX2.css +203 -0
  23. package/dist/Temml.woff2 +0 -0
  24. package/dist/temml.cjs +13122 -0
  25. package/dist/temml.js +11225 -0
  26. package/dist/temml.min.js +1 -0
  27. package/dist/temml.mjs +13120 -0
  28. package/dist/temmlPostProcess.js +70 -0
  29. package/package.json +34 -0
  30. package/src/Lexer.js +121 -0
  31. package/src/MacroExpander.js +437 -0
  32. package/src/Namespace.js +107 -0
  33. package/src/ParseError.js +64 -0
  34. package/src/Parser.js +977 -0
  35. package/src/Settings.js +49 -0
  36. package/src/SourceLocation.js +29 -0
  37. package/src/Style.js +144 -0
  38. package/src/Token.js +40 -0
  39. package/src/buildMathML.js +235 -0
  40. package/src/constants.js +25 -0
  41. package/src/defineEnvironment.js +25 -0
  42. package/src/defineFunction.js +69 -0
  43. package/src/defineMacro.js +11 -0
  44. package/src/domTree.js +185 -0
  45. package/src/environments/array.js +791 -0
  46. package/src/environments/cd.js +252 -0
  47. package/src/environments.js +8 -0
  48. package/src/functions/accent.js +127 -0
  49. package/src/functions/accentunder.js +38 -0
  50. package/src/functions/arrow.js +204 -0
  51. package/src/functions/cancelto.js +36 -0
  52. package/src/functions/char.js +33 -0
  53. package/src/functions/color.js +253 -0
  54. package/src/functions/cr.js +46 -0
  55. package/src/functions/def.js +259 -0
  56. package/src/functions/delimsizing.js +304 -0
  57. package/src/functions/enclose.js +193 -0
  58. package/src/functions/envTag.js +38 -0
  59. package/src/functions/environment.js +59 -0
  60. package/src/functions/font.js +123 -0
  61. package/src/functions/genfrac.js +333 -0
  62. package/src/functions/hbox.js +29 -0
  63. package/src/functions/horizBrace.js +32 -0
  64. package/src/functions/href.js +90 -0
  65. package/src/functions/html.js +95 -0
  66. package/src/functions/includegraphics.js +131 -0
  67. package/src/functions/kern.js +75 -0
  68. package/src/functions/label.js +29 -0
  69. package/src/functions/lap.js +75 -0
  70. package/src/functions/math.js +40 -0
  71. package/src/functions/mathchoice.js +41 -0
  72. package/src/functions/mclass.js +201 -0
  73. package/src/functions/multiscript.js +91 -0
  74. package/src/functions/not.js +46 -0
  75. package/src/functions/op.js +338 -0
  76. package/src/functions/operatorname.js +139 -0
  77. package/src/functions/ordgroup.js +9 -0
  78. package/src/functions/phantom.js +73 -0
  79. package/src/functions/pmb.js +31 -0
  80. package/src/functions/raise.js +68 -0
  81. package/src/functions/ref.js +28 -0
  82. package/src/functions/relax.js +16 -0
  83. package/src/functions/rule.js +52 -0
  84. package/src/functions/sizing.js +64 -0
  85. package/src/functions/smash.js +66 -0
  86. package/src/functions/sqrt.js +31 -0
  87. package/src/functions/styling.js +58 -0
  88. package/src/functions/supsub.js +135 -0
  89. package/src/functions/symbolsOp.js +53 -0
  90. package/src/functions/symbolsOrd.js +102 -0
  91. package/src/functions/symbolsSpacing.js +53 -0
  92. package/src/functions/tag.js +8 -0
  93. package/src/functions/text.js +75 -0
  94. package/src/functions/tip.js +63 -0
  95. package/src/functions/toggle.js +13 -0
  96. package/src/functions/verb.js +33 -0
  97. package/src/functions.js +57 -0
  98. package/src/linebreaking.js +159 -0
  99. package/src/macros.js +708 -0
  100. package/src/mathMLTree.js +175 -0
  101. package/src/parseNode.js +42 -0
  102. package/src/parseTree.js +40 -0
  103. package/src/postProcess.js +57 -0
  104. package/src/replace.js +225 -0
  105. package/src/stretchy.js +66 -0
  106. package/src/svg.js +110 -0
  107. package/src/symbols.js +972 -0
  108. package/src/tree.js +50 -0
  109. package/src/unicodeAccents.js +16 -0
  110. package/src/unicodeScripts.js +119 -0
  111. package/src/unicodeSupOrSub.js +108 -0
  112. package/src/unicodeSymbolBuilder.js +31 -0
  113. package/src/unicodeSymbols.js +320 -0
  114. package/src/units.js +109 -0
  115. package/src/utils.js +109 -0
  116. package/src/variant.js +103 -0
  117. package/temml.js +181 -0
@@ -0,0 +1 @@
1
+ temml.__defineMacro("\\ce",(function(t){return chemParse(t.consumeArgs(1)[0],"ce")})),temml.__defineMacro("\\pu",(function(t){return chemParse(t.consumeArgs(1)[0],"pu")})),temml.__defineMacro("\\uniDash","{\\rule{0.672em}{0.06em}}"),temml.__defineMacro("\\triDash","{\\rule{0.15em}{0.06em}\\kern2mu\\rule{0.15em}{0.06em}\\kern2mu\\rule{0.15em}{0.06em}}"),temml.__defineMacro("\\tripleDash","\\kern0.075em\\raise0.25em{\\triDash}\\kern0.075em"),temml.__defineMacro("\\tripleDashOverLine","\\kern0.075em\\mathrlap{\\raise0.125em{\\uniDash}}\\raise0.34em{\\triDash}\\kern0.075em"),temml.__defineMacro("\\tripleDashOverDoubleLine","\\kern0.075em\\mathrlap{\\mathrlap{\\raise0.48em{\\triDash}}\\raise0.27em{\\uniDash}}{\\raise0.05em{\\uniDash}}\\kern0.075em"),temml.__defineMacro("\\tripleDashBetweenDoubleLine","\\kern0.075em\\mathrlap{\\mathrlap{\\raise0.48em{\\uniDash}}\\raise0.27em{\\triDash}}{\\raise0.05em{\\uniDash}}\\kern0.075em");var chemParse=function(t,e){for(var r="",a=t.length&&t[t.length-1].loc.start,n=t.length-1;n>=0;n--)t[n].loc.start>a&&(r+=" ",a=t[n].loc.start),r+=t[n].text,a+=t[n].text.length;return texify.go(mhchemParser.go(r,e))},mhchemParser={go:function(t,e){if(!t)return[];void 0===e&&(e="ce");var r,a="0",n={};n.parenthesisLevel=0,t=(t=(t=t.replace(/\n/g," ")).replace(/[\u2212\u2013\u2014\u2010]/g,"-")).replace(/[\u2026]/g,"...");for(var o=10,i=[];;){r!==t?(o=10,r=t):o--;var c=mhchemParser.stateMachines[e],s=c.transitions[a]||c.transitions["*"];t:for(var u=0;u<s.length;u++){var p=mhchemParser.patterns.match_(s[u].pattern,t);if(p){for(var m=s[u].task,h=0;h<m.action_.length;h++){var _;if(c.actions[m.action_[h].type_])_=c.actions[m.action_[h].type_](n,p.match_,m.action_[h].option);else{if(!mhchemParser.actions[m.action_[h].type_])throw["MhchemBugA","mhchem bug A. Please report. ("+m.action_[h].type_+")"];_=mhchemParser.actions[m.action_[h].type_](n,p.match_,m.action_[h].option)}mhchemParser.concatArray(i,_)}if(a=m.nextState||a,!(t.length>0))return i;if(m.revisit||(t=p.remainder),!m.toContinue)break t}}if(o<=0)throw["MhchemBugU","mhchem bug U. Please report."]}},concatArray:function(t,e){if(e)if(Array.isArray(e))for(var r=0;r<e.length;r++)t.push(e[r]);else t.push(e)},patterns:{patterns:{empty:/^$/,else:/^./,else2:/^./,space:/^\s/,"space A":/^\s(?=[A-Z\\$])/,space$:/^\s$/,"a-z":/^[a-z]/,x:/^x/,x$:/^x$/,i$:/^i$/,letters:/^(?:[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]))))+/,"\\greek":/^\\(?: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]))/,"one lowercase latin letter $":/^(?:([a-z])(?:$|[^a-zA-Z]))$/,"$one lowercase latin letter$ $":/^\$(?:([a-z])(?:$|[^a-zA-Z]))\$$/,"one lowercase greek letter $":/^(?:\$?[\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]))$/,digits:/^[0-9]+/,"-9.,9":/^[+\-]?(?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))/,"-9.,9 no missing 0":/^[+\-]?[0-9]+(?:[.,][0-9]+)?/,"(-)(9.,9)(e)(99)":function(t){var e=t.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 e&&e[0]?{match_:e.splice(1),remainder:t.substr(e[0].length)}:null},"(-)(9)^(-9)":function(t){var e=t.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+)?)\^([+\-]?[0-9]+|\{[+\-]?[0-9]+\})/);return e&&e[0]?{match_:e.splice(1),remainder:t.substr(e[0].length)}:null},"state of aggregation $":function(t){var e=mhchemParser.patterns.findObserveGroups(t,"",/^\([a-z]{1,3}(?=[\),])/,")","");if(e&&e.remainder.match(/^($|[\s,;\)\]\}])/))return e;var r=t.match(/^(?:\((?:\\ca\s?)?\$[amothc]\$\))/);return r?{match_:r[0],remainder:t.substr(r[0].length)}:null},"_{(state of aggregation)}$":/^_\{(\([a-z]{1,3}\))\}/,"{[(":/^(?:\\\{|\[|\()/,")]}":/^(?:\)|\]|\\\})/,", ":/^[,;]\s*/,",":/^[,;]/,".":/^[.]/,". ":/^([.\u22C5\u00B7\u2022])\s*/,"...":/^\.\.\.(?=$|[^.])/,"* ":/^([*])\s*/,"^{(...)}":function(t){return mhchemParser.patterns.findObserveGroups(t,"^{","","","}")},"^($...$)":function(t){return mhchemParser.patterns.findObserveGroups(t,"^","$","$","")},"^a":/^\^([0-9]+|[^\\_])/,"^\\x{}{}":function(t){return mhchemParser.patterns.findObserveGroups(t,"^",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"^\\x{}":function(t){return mhchemParser.patterns.findObserveGroups(t,"^",/^\\[a-zA-Z]+\{/,"}","")},"^\\x":/^\^(\\[a-zA-Z]+)\s*/,"^(-1)":/^\^(-?\d+)/,"'":/^'/,"_{(...)}":function(t){return mhchemParser.patterns.findObserveGroups(t,"_{","","","}")},"_($...$)":function(t){return mhchemParser.patterns.findObserveGroups(t,"_","$","$","")},_9:/^_([+\-]?[0-9]+|[^\\])/,"_\\x{}{}":function(t){return mhchemParser.patterns.findObserveGroups(t,"_",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"_\\x{}":function(t){return mhchemParser.patterns.findObserveGroups(t,"_",/^\\[a-zA-Z]+\{/,"}","")},"_\\x":/^_(\\[a-zA-Z]+)\s*/,"^_":/^(?:\^(?=_)|\_(?=\^)|[\^_]$)/,"{}":/^\{\}/,"{...}":function(t){return mhchemParser.patterns.findObserveGroups(t,"","{","}","")},"{(...)}":function(t){return mhchemParser.patterns.findObserveGroups(t,"{","","","}")},"$...$":function(t){return mhchemParser.patterns.findObserveGroups(t,"","$","$","")},"${(...)}$":function(t){return mhchemParser.patterns.findObserveGroups(t,"${","","","}$")},"$(...)$":function(t){return mhchemParser.patterns.findObserveGroups(t,"$","","","$")},"=<>":/^[=<>]/,"#":/^[#\u2261]/,"+":/^\+/,"-$":/^-(?=[\s_},;\]/]|$|\([a-z]+\))/,"-9":/^-(?=[0-9])/,"- orbital overlap":/^-(?=(?:[spd]|sp)(?:$|[\s,;\)\]\}]))/,"-":/^-/,"pm-operator":/^(?:\\pm|\$\\pm\$|\+-|\+\/-)/,operator:/^(?:\+|(?:[\-=<>]|<<|>>|\\approx|\$\\approx\$)(?=\s|$|-?[0-9]))/,arrowUpDown:/^(?:v|\(v\)|\^|\(\^\))(?=$|[\s,;\)\]\}])/,"\\bond{(...)}":function(t){return mhchemParser.patterns.findObserveGroups(t,"\\bond{","","","}")},"->":/^(?:<->|<-->|->|<-|<=>>|<<=>|<=>|[\u2192\u27F6\u21CC])/,CMT:/^[CMT](?=\[)/,"[(...)]":function(t){return mhchemParser.patterns.findObserveGroups(t,"[","","","]")},"1st-level escape":/^(&|\\\\|\\hline)\s*/,"\\,":/^(?:\\[,\ ;:])/,"\\x{}{}":function(t){return mhchemParser.patterns.findObserveGroups(t,"",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"\\x{}":function(t){return mhchemParser.patterns.findObserveGroups(t,"",/^\\[a-zA-Z]+\{/,"}","")},"\\ca":/^\\ca(?:\s+|(?![a-zA-Z]))/,"\\x":/^(?:\\[a-zA-Z]+\s*|\\[_&{}%])/,orbital:/^(?:[0-9]{1,2}[spdfgh]|[0-9]{0,2}sp)(?=$|[^a-zA-Z])/,others:/^[\/~|]/,"\\frac{(...)}":function(t){return mhchemParser.patterns.findObserveGroups(t,"\\frac{","","","}","{","","","}")},"\\overset{(...)}":function(t){return mhchemParser.patterns.findObserveGroups(t,"\\overset{","","","}","{","","","}")},"\\underset{(...)}":function(t){return mhchemParser.patterns.findObserveGroups(t,"\\underset{","","","}","{","","","}")},"\\underbrace{(...)}":function(t){return mhchemParser.patterns.findObserveGroups(t,"\\underbrace{","","","}_","{","","","}")},"\\color{(...)}0":function(t){return mhchemParser.patterns.findObserveGroups(t,"\\color{","","","}")},"\\color{(...)}{(...)}1":function(t){return mhchemParser.patterns.findObserveGroups(t,"\\color{","","","}","{","","","}")},"\\color(...){(...)}2":function(t){return mhchemParser.patterns.findObserveGroups(t,"\\color","\\","",/^(?=\{)/,"{","","","}")},"\\ce{(...)}":function(t){return mhchemParser.patterns.findObserveGroups(t,"\\ce{","","","}")},oxidation$:/^(?:[+-][IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,"d-oxidation$":/^(?:[+-]?\s?[IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,"roman numeral":/^[IVX]+/,"1/2$":/^[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+(?:\$[a-z]\$|[a-z])?$/,amount:function(t){var e;if(e=t.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{match_:e[0],remainder:t.substr(e[0].length)};var r=mhchemParser.patterns.findObserveGroups(t,"","$","$","");return r&&(e=r.match_.match(/^\$(?:\(?[+\-]?(?:[0-9]*[a-z]?[+\-])?[0-9]*[a-z](?:[+\-][0-9]*[a-z]?)?\)?|\+|-)\$$/))?{match_:e[0],remainder:t.substr(e[0].length)}:null},amount2:function(t){return this.amount(t)},"(KV letters),":/^(?:[A-Z][a-z]{0,2}|i)(?=,)/,formula$:function(t){if(t.match(/^\([a-z]+\)$/))return null;var e=t.match(/^(?:[a-z]|(?:[0-9\ \+\-\,\.\(\)]+[a-z])+[0-9\ \+\-\,\.\(\)]*|(?:[a-z][0-9\ \+\-\,\.\(\)]+)+[a-z]?)$/);return e?{match_:e[0],remainder:t.substr(e[0].length)}:null},uprightEntities:/^(?:pH|pOH|pC|pK|iPr|iBu)(?=$|[^a-zA-Z])/,"/":/^\s*(\/)\s*/,"//":/^\s*(\/\/)\s*/,"*":/^\s*[*.]\s*/},findObserveGroups:function(t,e,r,a,n,o,i,c,s,u){var p=function(t,e){if("string"==typeof e)return 0!==t.indexOf(e)?null:e;var r=t.match(e);return r?r[0]:null},m=p(t,e);if(null===m)return null;if(t=t.substr(m.length),null===(m=p(t,r)))return null;var h=function(t,e,r){for(var a=0;e<t.length;){var n=t.charAt(e),o=p(t.substr(e),r);if(null!==o&&0===a)return{endMatchBegin:e,endMatchEnd:e+o.length};if("{"===n)a++;else if("}"===n){if(0===a)throw["ExtraCloseMissingOpen","Extra close brace or missing open brace"];a--}e++}return null}(t,m.length,a||n);if(null===h)return null;var _=t.substring(0,a?h.endMatchEnd:h.endMatchBegin);if(o||i){var d=this.findObserveGroups(t.substr(h.endMatchEnd),o,i,c,s);if(null===d)return null;var l=[_,d.match_];return{match_:u?l.join(""):l,remainder:d.remainder}}return{match_:_,remainder:t.substr(h.endMatchEnd)}},match_:function(t,e){var r=mhchemParser.patterns.patterns[t];if(void 0===r)throw["MhchemBugP","mhchem bug P. Please report. ("+t+")"];if("function"==typeof r)return mhchemParser.patterns.patterns[t](e);var a=e.match(r);return a?{match_:a[2]?[a[1],a[2]]:a[1]?a[1]:a[0],remainder:e.substr(a[0].length)}:null}},actions:{"a=":function(t,e){t.a=(t.a||"")+e},"b=":function(t,e){t.b=(t.b||"")+e},"p=":function(t,e){t.p=(t.p||"")+e},"o=":function(t,e){t.o=(t.o||"")+e},"q=":function(t,e){t.q=(t.q||"")+e},"d=":function(t,e){t.d=(t.d||"")+e},"rm=":function(t,e){t.rm=(t.rm||"")+e},"text=":function(t,e){t.text_=(t.text_||"")+e},insert:function(t,e,r){return{type_:r}},"insert+p1":function(t,e,r){return{type_:r,p1:e}},"insert+p1+p2":function(t,e,r){return{type_:r,p1:e[0],p2:e[1]}},copy:function(t,e){return e},rm:function(t,e){return{type_:"rm",p1:e||""}},text:function(t,e){return mhchemParser.go(e,"text")},"{text}":function(t,e){var r=["{"];return mhchemParser.concatArray(r,mhchemParser.go(e,"text")),r.push("}"),r},"tex-math":function(t,e){return mhchemParser.go(e,"tex-math")},"tex-math tight":function(t,e){return mhchemParser.go(e,"tex-math tight")},bond:function(t,e,r){return{type_:"bond",kind_:r||e}},"color0-output":function(t,e){return{type_:"color0",color:e[0]}},ce:function(t,e){return mhchemParser.go(e)},"1/2":function(t,e){var r=[];e.match(/^[+\-]/)&&(r.push(e.substr(0,1)),e=e.substr(1));var a=e.match(/^([0-9]+|\$[a-z]\$|[a-z])\/([0-9]+)(\$[a-z]\$|[a-z])?$/);return a[1]=a[1].replace(/\$/g,""),r.push({type_:"frac",p1:a[1],p2:a[2]}),a[3]&&(a[3]=a[3].replace(/\$/g,""),r.push({type_:"tex-math",p1:a[3]})),r},"9,9":function(t,e){return mhchemParser.go(e,"9,9")}},createTransitions:function(t){var e,r,a,n,o={};for(e in t)for(r in t[e])for(a=r.split("|"),t[e][r].stateArray=a,n=0;n<a.length;n++)o[a[n]]=[];for(e in t)for(r in t[e])for(a=t[e][r].stateArray||[],n=0;n<a.length;n++){var i=t[e][r];if(i.action_){i.action_=[].concat(i.action_);for(var c=0;c<i.action_.length;c++)"string"==typeof i.action_[c]&&(i.action_[c]={type_:i.action_[c]})}else i.action_=[];for(var s=e.split("|"),u=0;u<s.length;u++)if("*"===a[n])for(var p in o)o[p].push({pattern:s[u],task:i});else o[a[n]].push({pattern:s[u],task:i})}return o},stateMachines:{}};mhchemParser.stateMachines={ce:{transitions:mhchemParser.createTransitions({empty:{"*":{action_:"output"}},else:{"0|1|2":{action_:"beginsWithBond=false",revisit:!0,toContinue:!0}},oxidation$:{0:{action_:"oxidation-output"}},CMT:{r:{action_:"rdt=",nextState:"rt"},rd:{action_:"rqt=",nextState:"rdt"}},arrowUpDown:{"0|1|2|as":{action_:["sb=false","output","operator"],nextState:"1"}},uprightEntities:{"0|1|2":{action_:["o=","output"],nextState:"1"}},orbital:{"0|1|2|3":{action_:"o=",nextState:"o"}},"->":{"0|1|2|3":{action_:"r=",nextState:"r"},"a|as":{action_:["output","r="],nextState:"r"},"*":{action_:["output","r="],nextState:"r"}},"+":{o:{action_:"d= kv",nextState:"d"},"d|D":{action_:"d=",nextState:"d"},q:{action_:"d=",nextState:"qd"},"qd|qD":{action_:"d=",nextState:"qd"},dq:{action_:["output","d="],nextState:"d"},3:{action_:["sb=false","output","operator"],nextState:"0"}},amount:{"0|2":{action_:"a=",nextState:"a"}},"pm-operator":{"0|1|2|a|as":{action_:["sb=false","output",{type_:"operator",option:"\\pm"}],nextState:"0"}},operator:{"0|1|2|a|as":{action_:["sb=false","output","operator"],nextState:"0"}},"-$":{"o|q":{action_:["charge or bond","output"],nextState:"qd"},d:{action_:"d=",nextState:"d"},D:{action_:["output",{type_:"bond",option:"-"}],nextState:"3"},q:{action_:"d=",nextState:"qd"},qd:{action_:"d=",nextState:"qd"},"qD|dq":{action_:["output",{type_:"bond",option:"-"}],nextState:"3"}},"-9":{"3|o":{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"3"}},"- orbital overlap":{o:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"},d:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"}},"-":{"0|1|2":{action_:[{type_:"output",option:1},"beginsWithBond=true",{type_:"bond",option:"-"}],nextState:"3"},3:{action_:{type_:"bond",option:"-"}},a:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"},as:{action_:[{type_:"output",option:2},{type_:"bond",option:"-"}],nextState:"3"},b:{action_:"b="},o:{action_:{type_:"- after o/d",option:!1},nextState:"2"},q:{action_:{type_:"- after o/d",option:!1},nextState:"2"},"d|qd|dq":{action_:{type_:"- after o/d",option:!0},nextState:"2"},"D|qD|p":{action_:["output",{type_:"bond",option:"-"}],nextState:"3"}},amount2:{"1|3":{action_:"a=",nextState:"a"}},letters:{"0|1|2|3|a|as|b|p|bp|o":{action_:"o=",nextState:"o"},"q|dq":{action_:["output","o="],nextState:"o"},"d|D|qd|qD":{action_:"o after d",nextState:"o"}},digits:{o:{action_:"q=",nextState:"q"},"d|D":{action_:"q=",nextState:"dq"},q:{action_:["output","o="],nextState:"o"},a:{action_:"o=",nextState:"o"}},"space A":{"b|p|bp":{}},space:{a:{nextState:"as"},0:{action_:"sb=false"},"1|2":{action_:"sb=true"},"r|rt|rd|rdt|rdq":{action_:"output",nextState:"0"},"*":{action_:["output","sb=true"],nextState:"1"}},"1st-level escape":{"1|2":{action_:["output",{type_:"insert+p1",option:"1st-level escape"}]},"*":{action_:["output",{type_:"insert+p1",option:"1st-level escape"}],nextState:"0"}},"[(...)]":{"r|rt":{action_:"rd=",nextState:"rd"},"rd|rdt":{action_:"rq=",nextState:"rdq"}},"...":{"o|d|D|dq|qd|qD":{action_:["output",{type_:"bond",option:"..."}],nextState:"3"},"*":{action_:[{type_:"output",option:1},{type_:"insert",option:"ellipsis"}],nextState:"1"}},". |* ":{"*":{action_:["output",{type_:"insert",option:"addition compound"}],nextState:"1"}},"state of aggregation $":{"*":{action_:["output","state of aggregation"],nextState:"1"}},"{[(":{"a|as|o":{action_:["o=","output","parenthesisLevel++"],nextState:"2"},"0|1|2|3":{action_:["o=","output","parenthesisLevel++"],nextState:"2"},"*":{action_:["output","o=","output","parenthesisLevel++"],nextState:"2"}},")]}":{"0|1|2|3|b|p|bp|o":{action_:["o=","parenthesisLevel--"],nextState:"o"},"a|as|d|D|q|qd|qD|dq":{action_:["output","o=","parenthesisLevel--"],nextState:"o"}},", ":{"*":{action_:["output","comma"],nextState:"0"}},"^_":{"*":{}},"^{(...)}|^($...$)":{"0|1|2|as":{action_:"b=",nextState:"b"},p:{action_:"b=",nextState:"bp"},"3|o":{action_:"d= kv",nextState:"D"},q:{action_:"d=",nextState:"qD"},"d|D|qd|qD|dq":{action_:["output","d="],nextState:"D"}},"^a|^\\x{}{}|^\\x{}|^\\x|'":{"0|1|2|as":{action_:"b=",nextState:"b"},p:{action_:"b=",nextState:"bp"},"3|o":{action_:"d= kv",nextState:"d"},q:{action_:"d=",nextState:"qd"},"d|qd|D|qD":{action_:"d="},dq:{action_:["output","d="],nextState:"d"}},"_{(state of aggregation)}$":{"d|D|q|qd|qD|dq":{action_:["output","q="],nextState:"q"}},"_{(...)}|_($...$)|_9|_\\x{}{}|_\\x{}|_\\x":{"0|1|2|as":{action_:"p=",nextState:"p"},b:{action_:"p=",nextState:"bp"},"3|o":{action_:"q=",nextState:"q"},"d|D":{action_:"q=",nextState:"dq"},"q|qd|qD|dq":{action_:["output","q="],nextState:"q"}},"=<>":{"0|1|2|3|a|as|o|q|d|D|qd|qD|dq":{action_:[{type_:"output",option:2},"bond"],nextState:"3"}},"#":{"0|1|2|3|a|as|o":{action_:[{type_:"output",option:2},{type_:"bond",option:"#"}],nextState:"3"}},"{}":{"*":{action_:{type_:"output",option:1},nextState:"1"}},"{...}":{"0|1|2|3|a|as|b|p|bp":{action_:"o=",nextState:"o"},"o|d|D|q|qd|qD|dq":{action_:["output","o="],nextState:"o"}},"$...$":{a:{action_:"a="},"0|1|2|3|as|b|p|bp|o":{action_:"o=",nextState:"o"},"as|o":{action_:"o="},"q|d|D|qd|qD|dq":{action_:["output","o="],nextState:"o"}},"\\bond{(...)}":{"*":{action_:[{type_:"output",option:2},"bond"],nextState:"3"}},"\\frac{(...)}":{"*":{action_:[{type_:"output",option:1},"frac-output"],nextState:"3"}},"\\overset{(...)}":{"*":{action_:[{type_:"output",option:2},"overset-output"],nextState:"3"}},"\\underset{(...)}":{"*":{action_:[{type_:"output",option:2},"underset-output"],nextState:"3"}},"\\underbrace{(...)}":{"*":{action_:[{type_:"output",option:2},"underbrace-output"],nextState:"3"}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:[{type_:"output",option:2},"color-output"],nextState:"3"}},"\\color{(...)}0":{"*":{action_:[{type_:"output",option:2},"color0-output"]}},"\\ce{(...)}":{"*":{action_:[{type_:"output",option:2},"ce"],nextState:"3"}},"\\,":{"*":{action_:[{type_:"output",option:1},"copy"],nextState:"1"}},"\\x{}{}|\\x{}|\\x":{"0|1|2|3|a|as|b|p|bp|o|c0":{action_:["o=","output"],nextState:"3"},"*":{action_:["output","o=","output"],nextState:"3"}},others:{"*":{action_:[{type_:"output",option:1},"copy"],nextState:"3"}},else2:{a:{action_:"a to o",nextState:"o",revisit:!0},as:{action_:["output","sb=true"],nextState:"1",revisit:!0},"r|rt|rd|rdt|rdq":{action_:["output"],nextState:"0",revisit:!0},"*":{action_:["output","copy"],nextState:"3"}}}),actions:{"o after d":function(t,e){var r;if((t.d||"").match(/^[0-9]+$/)){var a=t.d;t.d=void 0,r=this.output(t),t.b=a}else r=this.output(t);return mhchemParser.actions["o="](t,e),r},"d= kv":function(t,e){t.d=e,t.dType="kv"},"charge or bond":function(t,e){if(t.beginsWithBond){var r=[];return mhchemParser.concatArray(r,this.output(t)),mhchemParser.concatArray(r,mhchemParser.actions.bond(t,e,"-")),r}t.d=e},"- after o/d":function(t,e,r){var a=mhchemParser.patterns.match_("orbital",t.o||""),n=mhchemParser.patterns.match_("one lowercase greek letter $",t.o||""),o=mhchemParser.patterns.match_("one lowercase latin letter $",t.o||""),i=mhchemParser.patterns.match_("$one lowercase latin letter$ $",t.o||""),c="-"===e&&(a&&""===a.remainder||n||o||i);!c||t.a||t.b||t.p||t.d||t.q||a||!o||(t.o="$"+t.o+"$");var s=[];return c?(mhchemParser.concatArray(s,this.output(t)),s.push({type_:"hyphen"})):(a=mhchemParser.patterns.match_("digits",t.d||""),r&&a&&""===a.remainder?(mhchemParser.concatArray(s,mhchemParser.actions["d="](t,e)),mhchemParser.concatArray(s,this.output(t))):(mhchemParser.concatArray(s,this.output(t)),mhchemParser.concatArray(s,mhchemParser.actions.bond(t,e,"-")))),s},"a to o":function(t){t.o=t.a,t.a=void 0},"sb=true":function(t){t.sb=!0},"sb=false":function(t){t.sb=!1},"beginsWithBond=true":function(t){t.beginsWithBond=!0},"beginsWithBond=false":function(t){t.beginsWithBond=!1},"parenthesisLevel++":function(t){t.parenthesisLevel++},"parenthesisLevel--":function(t){t.parenthesisLevel--},"state of aggregation":function(t,e){return{type_:"state of aggregation",p1:mhchemParser.go(e,"o")}},comma:function(t,e){var r=e.replace(/\s*$/,"");return r!==e&&0===t.parenthesisLevel?{type_:"comma enumeration L",p1:r}:{type_:"comma enumeration M",p1:r}},output:function(t,e,r){var a,n,o;t.r?(n="M"===t.rdt?mhchemParser.go(t.rd,"tex-math"):"T"===t.rdt?[{type_:"text",p1:t.rd||""}]:mhchemParser.go(t.rd),o="M"===t.rqt?mhchemParser.go(t.rq,"tex-math"):"T"===t.rqt?[{type_:"text",p1:t.rq||""}]:mhchemParser.go(t.rq),a={type_:"arrow",r:t.r,rd:n,rq:o}):(a=[],(t.a||t.b||t.p||t.o||t.q||t.d||r)&&(t.sb&&a.push({type_:"entitySkip"}),t.o||t.q||t.d||t.b||t.p||2===r?t.o||t.q||t.d||!t.b&&!t.p?t.o&&"kv"===t.dType&&mhchemParser.patterns.match_("d-oxidation$",t.d||"")?t.dType="oxidation":t.o&&"kv"===t.dType&&!t.q&&(t.dType=void 0):(t.o=t.a,t.d=t.b,t.q=t.p,t.a=t.b=t.p=void 0):(t.o=t.a,t.a=void 0),a.push({type_:"chemfive",a:mhchemParser.go(t.a,"a"),b:mhchemParser.go(t.b,"bd"),p:mhchemParser.go(t.p,"pq"),o:mhchemParser.go(t.o,"o"),q:mhchemParser.go(t.q,"pq"),d:mhchemParser.go(t.d,"oxidation"===t.dType?"oxidation":"bd"),dType:t.dType})));for(var i in t)"parenthesisLevel"!==i&&"beginsWithBond"!==i&&delete t[i];return a},"oxidation-output":function(t,e){var r=["{"];return mhchemParser.concatArray(r,mhchemParser.go(e,"oxidation")),r.push("}"),r},"frac-output":function(t,e){return{type_:"frac-ce",p1:mhchemParser.go(e[0]),p2:mhchemParser.go(e[1])}},"overset-output":function(t,e){return{type_:"overset",p1:mhchemParser.go(e[0]),p2:mhchemParser.go(e[1])}},"underset-output":function(t,e){return{type_:"underset",p1:mhchemParser.go(e[0]),p2:mhchemParser.go(e[1])}},"underbrace-output":function(t,e){return{type_:"underbrace",p1:mhchemParser.go(e[0]),p2:mhchemParser.go(e[1])}},"color-output":function(t,e){return{type_:"color",color1:e[0],color2:mhchemParser.go(e[1])}},"r=":function(t,e){t.r=e},"rdt=":function(t,e){t.rdt=e},"rd=":function(t,e){t.rd=e},"rqt=":function(t,e){t.rqt=e},"rq=":function(t,e){t.rq=e},operator:function(t,e,r){return{type_:"operator",kind_:r||e}}}},a:{transitions:mhchemParser.createTransitions({empty:{"*":{}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"1",revisit:!0}},"$(...)$":{"*":{action_:"tex-math tight",nextState:"1"}},",":{"*":{action_:{type_:"insert",option:"commaDecimal"}}},else2:{"*":{action_:"copy"}}}),actions:{}},o:{transitions:mhchemParser.createTransitions({empty:{"*":{}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"1",revisit:!0}},letters:{"*":{action_:"rm"}},"\\ca":{"*":{action_:{type_:"insert",option:"circa"}}},"\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"{text}"}},else2:{"*":{action_:"copy"}}}),actions:{}},text:{transitions:mhchemParser.createTransitions({empty:{"*":{action_:"output"}},"{...}":{"*":{action_:"text="}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"\\greek":{"*":{action_:["output","rm"]}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:["output","copy"]}},else:{"*":{action_:"text="}}}),actions:{output:function(t){if(t.text_){var e={type_:"text",p1:t.text_};for(var r in t)delete t[r];return e}}}},pq:{transitions:mhchemParser.createTransitions({empty:{"*":{}},"state of aggregation $":{"*":{action_:"state of aggregation"}},i$:{0:{nextState:"!f",revisit:!0}},"(KV letters),":{0:{action_:"rm",nextState:"0"}},formula$:{0:{nextState:"f",revisit:!0}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"!f",revisit:!0}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"text"}},"a-z":{f:{action_:"tex-math"}},letters:{"*":{action_:"rm"}},"-9.,9":{"*":{action_:"9,9"}},",":{"*":{action_:{type_:"insert+p1",option:"comma enumeration S"}}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:"color-output"}},"\\color{(...)}0":{"*":{action_:"color0-output"}},"\\ce{(...)}":{"*":{action_:"ce"}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},else2:{"*":{action_:"copy"}}}),actions:{"state of aggregation":function(t,e){return{type_:"state of aggregation subscript",p1:mhchemParser.go(e,"o")}},"color-output":function(t,e){return{type_:"color",color1:e[0],color2:mhchemParser.go(e[1],"pq")}}}},bd:{transitions:mhchemParser.createTransitions({empty:{"*":{}},x$:{0:{nextState:"!f",revisit:!0}},formula$:{0:{nextState:"f",revisit:!0}},else:{0:{nextState:"!f",revisit:!0}},"-9.,9 no missing 0":{"*":{action_:"9,9"}},".":{"*":{action_:{type_:"insert",option:"electron dot"}}},"a-z":{f:{action_:"tex-math"}},x:{"*":{action_:{type_:"insert",option:"KV x"}}},letters:{"*":{action_:"rm"}},"'":{"*":{action_:{type_:"insert",option:"prime"}}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"text"}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:"color-output"}},"\\color{(...)}0":{"*":{action_:"color0-output"}},"\\ce{(...)}":{"*":{action_:"ce"}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},else2:{"*":{action_:"copy"}}}),actions:{"color-output":function(t,e){return{type_:"color",color1:e[0],color2:mhchemParser.go(e[1],"bd")}}}},oxidation:{transitions:mhchemParser.createTransitions({empty:{"*":{}},"roman numeral":{"*":{action_:"roman-numeral"}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},else:{"*":{action_:"copy"}}}),actions:{"roman-numeral":function(t,e){return{type_:"roman numeral",p1:e||""}}}},"tex-math":{transitions:mhchemParser.createTransitions({empty:{"*":{action_:"output"}},"\\ce{(...)}":{"*":{action_:["output","ce"]}},"{...}|\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"o="}},else:{"*":{action_:"o="}}}),actions:{output:function(t){if(t.o){var e={type_:"tex-math",p1:t.o};for(var r in t)delete t[r];return e}}}},"tex-math tight":{transitions:mhchemParser.createTransitions({empty:{"*":{action_:"output"}},"\\ce{(...)}":{"*":{action_:["output","ce"]}},"{...}|\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"o="}},"-|+":{"*":{action_:"tight operator"}},else:{"*":{action_:"o="}}}),actions:{"tight operator":function(t,e){t.o=(t.o||"")+"{"+e+"}"},output:function(t){if(t.o){var e={type_:"tex-math",p1:t.o};for(var r in t)delete t[r];return e}}}},"9,9":{transitions:mhchemParser.createTransitions({empty:{"*":{}},",":{"*":{action_:"comma"}},else:{"*":{action_:"copy"}}}),actions:{comma:function(){return{type_:"commaDecimal"}}}},pu:{transitions:mhchemParser.createTransitions({empty:{"*":{action_:"output"}},space$:{"*":{action_:["output","space"]}},"{[(|)]}":{"0|a":{action_:"copy"}},"(-)(9)^(-9)":{0:{action_:"number^",nextState:"a"}},"(-)(9.,9)(e)(99)":{0:{action_:"enumber",nextState:"a"}},space:{"0|a":{}},"pm-operator":{"0|a":{action_:{type_:"operator",option:"\\pm"},nextState:"0"}},operator:{"0|a":{action_:"copy",nextState:"0"}},"//":{d:{action_:"o=",nextState:"/"}},"/":{d:{action_:"o=",nextState:"/"}},"{...}|else":{"0|d":{action_:"d=",nextState:"d"},a:{action_:["space","d="],nextState:"d"},"/|q":{action_:"q=",nextState:"q"}}}),actions:{enumber:function(t,e){var r=[];return"+-"===e[0]||"+/-"===e[0]?r.push("\\pm "):e[0]&&r.push(e[0]),e[1]&&(mhchemParser.concatArray(r,mhchemParser.go(e[1],"pu-9,9")),e[2]&&(e[2].match(/[,.]/)?mhchemParser.concatArray(r,mhchemParser.go(e[2],"pu-9,9")):r.push(e[2])),e[3]=e[4]||e[3],e[3]&&(e[3]=e[3].trim(),"e"===e[3]||"*"===e[3].substr(0,1)?r.push({type_:"cdot"}):r.push({type_:"times"}))),e[3]&&r.push("10^{"+e[5]+"}"),r},"number^":function(t,e){var r=[];return"+-"===e[0]||"+/-"===e[0]?r.push("\\pm "):e[0]&&r.push(e[0]),mhchemParser.concatArray(r,mhchemParser.go(e[1],"pu-9,9")),r.push("^{"+e[2]+"}"),r},operator:function(t,e,r){return{type_:"operator",kind_:r||e}},space:function(){return{type_:"pu-space-1"}},output:function(t){var e,r=mhchemParser.patterns.match_("{(...)}",t.d||"");r&&""===r.remainder&&(t.d=r.match_);var a=mhchemParser.patterns.match_("{(...)}",t.q||"");if(a&&""===a.remainder&&(t.q=a.match_),t.d&&(t.d=t.d.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),t.d=t.d.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F")),t.q){t.q=t.q.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),t.q=t.q.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F");var n={d:mhchemParser.go(t.d,"pu"),q:mhchemParser.go(t.q,"pu")};"//"===t.o?e={type_:"pu-frac",p1:n.d,p2:n.q}:(e=n.d,n.d.length>1||n.q.length>1?e.push({type_:" / "}):e.push({type_:"/"}),mhchemParser.concatArray(e,n.q))}else e=mhchemParser.go(t.d,"pu-2");for(var o in t)delete t[o];return e}}},"pu-2":{transitions:mhchemParser.createTransitions({empty:{"*":{action_:"output"}},"*":{"*":{action_:["output","cdot"],nextState:"0"}},"\\x":{"*":{action_:"rm="}},space:{"*":{action_:["output","space"],nextState:"0"}},"^{(...)}|^(-1)":{1:{action_:"^(-1)"}},"-9.,9":{0:{action_:"rm=",nextState:"0"},1:{action_:"^(-1)",nextState:"0"}},"{...}|else":{"*":{action_:"rm=",nextState:"1"}}}),actions:{cdot:function(){return{type_:"tight cdot"}},"^(-1)":function(t,e){t.rm+="^{"+e+"}"},space:function(){return{type_:"pu-space-2"}},output:function(t){var e=[];if(t.rm){var r=mhchemParser.patterns.match_("{(...)}",t.rm||"");e=r&&""===r.remainder?mhchemParser.go(r.match_,"pu"):{type_:"rm",p1:t.rm}}for(var a in t)delete t[a];return e}}},"pu-9,9":{transitions:mhchemParser.createTransitions({empty:{0:{action_:"output-0"},o:{action_:"output-o"}},",":{0:{action_:["output-0","comma"],nextState:"o"}},".":{0:{action_:["output-0","copy"],nextState:"o"}},else:{"*":{action_:"text="}}}),actions:{comma:function(){return{type_:"commaDecimal"}},"output-0":function(t){var e=[];if(t.text_=t.text_||"",t.text_.length>4){var r=t.text_.length%3;0===r&&(r=3);for(var a=t.text_.length-3;a>0;a-=3)e.push(t.text_.substr(a,3)),e.push({type_:"1000 separator"});e.push(t.text_.substr(0,r)),e.reverse()}else e.push(t.text_);for(var n in t)delete t[n];return e},"output-o":function(t){var e=[];if(t.text_=t.text_||"",t.text_.length>4){for(var r=t.text_.length-3,a=0;a<r;a+=3)e.push(t.text_.substr(a,3)),e.push({type_:"1000 separator"});e.push(t.text_.substr(a))}else e.push(t.text_);for(var n in t)delete t[n];return e}}}};var texify={go:function(t,e){if(!t)return"";for(var r="",a=!1,n=0;n<t.length;n++){var o=t[n];"string"==typeof o?r+=o:(r+=texify._go2(o),"1st-level escape"===o.type_&&(a=!0))}return e||a||!r||(r="{"+r+"}"),r},_goInner:function(t){return t?texify.go(t,!0):t},_go2:function(t){var e;switch(t.type_){case"chemfive":e="";var r={a:texify._goInner(t.a),b:texify._goInner(t.b),p:texify._goInner(t.p),o:texify._goInner(t.o),q:texify._goInner(t.q),d:texify._goInner(t.d)};r.a&&(r.a.match(/^[+\-]/)&&(r.a="{"+r.a+"}"),e+=r.a+"\\,"),(r.b||r.p)&&(e+="{\\vphantom{X}}",e+="^{\\hphantom{"+(r.b||"")+"}}_{\\hphantom{"+(r.p||"")+"}}",e+="{\\vphantom{X}}",e+="^{\\smash[t]{\\vphantom{2}}\\mathllap{"+(r.b||"")+"}}",e+="_{\\vphantom{2}\\mathllap{\\smash[t]{"+(r.p||"")+"}}}"),r.o&&(r.o.match(/^[+\-]/)&&(r.o="{"+r.o+"}"),e+=r.o),"kv"===t.dType?((r.d||r.q)&&(e+="{\\vphantom{X}}"),r.d&&(e+="^{"+r.d+"}"),r.q&&(e+="_{\\smash[t]{"+r.q+"}}")):"oxidation"===t.dType?(r.d&&(e+="{\\vphantom{X}}",e+="^{"+r.d+"}"),r.q&&(e+="{{}}",e+="_{\\smash[t]{"+r.q+"}}")):(r.q&&(e+="{{}}",e+="_{\\smash[t]{"+r.q+"}}"),r.d&&(e+="{{}}",e+="^{"+r.d+"}"));break;case"rm":case"roman numeral":e="\\mathrm{"+t.p1+"}";break;case"text":t.p1.match(/[\^_]/)?(t.p1=t.p1.replace(" ","~").replace("-","\\text{-}"),e="\\mathrm{"+t.p1+"}"):e="\\text{"+t.p1+"}";break;case"state of aggregation":e="\\mskip2mu "+texify._goInner(t.p1);break;case"state of aggregation subscript":e="\\mskip1mu "+texify._goInner(t.p1);break;case"bond":if(!(e=texify._getBond(t.kind_)))throw["MhchemErrorBond","mhchem Error. Unknown bond type ("+t.kind_+")"];break;case"frac":var a="\\frac{"+t.p1+"}{"+t.p2+"}";e="\\mathchoice{\\textstyle"+a+"}{"+a+"}{"+a+"}{"+a+"}";break;case"pu-frac":var n="\\frac{"+texify._goInner(t.p1)+"}{"+texify._goInner(t.p2)+"}";e="\\mathchoice{\\textstyle"+n+"}{"+n+"}{"+n+"}{"+n+"}";break;case"tex-math":case"1st-level escape":e=t.p1+" ";break;case"frac-ce":e="\\frac{"+texify._goInner(t.p1)+"}{"+texify._goInner(t.p2)+"}";break;case"overset":e="\\overset{"+texify._goInner(t.p1)+"}{"+texify._goInner(t.p2)+"}";break;case"underset":e="\\underset{"+texify._goInner(t.p1)+"}{"+texify._goInner(t.p2)+"}";break;case"underbrace":e="\\underbrace{"+texify._goInner(t.p1)+"}_{"+texify._goInner(t.p2)+"}";break;case"color":e="{\\color{"+t.color1+"}{"+texify._goInner(t.color2)+"}}";break;case"color0":e="\\color{"+t.color+"}";break;case"arrow":var o={rd:texify._goInner(t.rd),rq:texify._goInner(t.rq)},i=texify._getArrow(t.r);o.rq&&(i+="[{\\rm "+o.rq+"}]"),e=i+=o.rd?"{\\rm "+o.rd+"}":"{}";break;case"operator":e=texify._getOperator(t.kind_);break;case"space":e=" ";break;case"entitySkip":case"pu-space-1":e="~";break;case"pu-space-2":e="\\mkern3mu ";break;case"1000 separator":e="\\mkern2mu ";break;case"commaDecimal":e="{,}";break;case"comma enumeration L":e="{"+t.p1+"}\\mkern6mu ";break;case"comma enumeration M":e="{"+t.p1+"}\\mkern3mu ";break;case"comma enumeration S":e="{"+t.p1+"}\\mkern1mu ";break;case"hyphen":e="\\text{-}";break;case"addition compound":e="\\,{\\cdot}\\,";break;case"electron dot":e="\\mkern1mu \\text{\\textbullet}\\mkern1mu ";break;case"KV x":e="{\\times}";break;case"prime":e="\\prime ";break;case"cdot":e="\\cdot ";break;case"tight cdot":e="\\mkern1mu{\\cdot}\\mkern1mu ";break;case"times":e="\\times ";break;case"circa":e="{\\sim}";break;case"^":e="uparrow";break;case"v":e="downarrow";break;case"ellipsis":e="\\ldots ";break;case"/":e="/";break;case" / ":e="\\,/\\,";break;default:throw assertNever(t),["MhchemBugT","mhchem bug T. Please report."]}return assertString(e),e},_getArrow:function(t){switch(t){case"->":case"→":case"⟶":return"\\yields";case"<-":return"\\yieldsLeft";case"<->":return"\\mesomerism";case"<--\x3e":return"\\yieldsLeftRight";case"<=>":case"⇌":return"\\equilibrium";case"<=>>":return"\\equilibriumRight";case"<<=>":return"\\equilibriumLeft";default:throw assertNever(t),["MhchemBugT","mhchem bug T. Please report."]}},_getBond:function(t){switch(t){case"-":case"1":return"{-}";case"=":case"2":return"{=}";case"#":case"3":return"{\\equiv}";case"~":return"{\\tripleDash}";case"~-":return"{\\tripleDashOverLine}";case"~=":case"~--":return"{\\tripleDashOverDoubleLine}";case"-~-":return"{\\tripleDashBetweenDoubleLine}";case"...":return"{{\\cdot}{\\cdot}{\\cdot}}";case"....":return"{{\\cdot}{\\cdot}{\\cdot}{\\cdot}}";case"->":return"{\\rightarrow}";case"<-":return"{\\leftarrow}";case"<":return"{<}";case">":return"{>}";default:throw assertNever(t),["MhchemBugT","mhchem bug T. Please report."]}},_getOperator:function(t){switch(t){case"+":return" {}+{} ";case"-":return" {}-{} ";case"=":return" {}={} ";case"<":return" {}<{} ";case">":return" {}>{} ";case"<<":return" {}\\ll{} ";case">>":return" {}\\gg{} ";case"\\pm":return" {}\\pm{} ";case"\\approx":case"$\\approx$":return" {}\\approx{} ";case"v":case"(v)":return" \\downarrow{} ";case"^":case"(^)":return" \\uparrow{} ";default:throw assertNever(t),["MhchemBugT","mhchem bug T. Please report."]}}};function assertNever(t){}function assertString(t){}
@@ -0,0 +1,20 @@
1
+ # physics extension
2
+
3
+ This extension adds to Temml many of the functions from the LaTeX [physics package](https://www.ctan.org/tex-archive/macros/latex/contrib/physics).
4
+
5
+ You can download the `physics.js` file from this repository.
6
+
7
+ ### Usage
8
+
9
+ This extension isn't part of core Temml, so the script should be separately included in the HTML page's `<head>`. Place it _after_ the line that calls `temml.js`.
10
+
11
+ ```html
12
+ <script src="./temml.min.js"></script>
13
+ <script src="./physics.js"></script>
14
+ ```
15
+
16
+ If you are working sever-side, just use `temml.cjs`. It already includes all the functions in `physics.js`.
17
+
18
+ ### Syntax
19
+
20
+ All the functions in the physics extension are listed in the [physics section](https://temml.org/docs/en/supported.html#physics-and-chemistry) (below the fold) of the Temml docs.
@@ -0,0 +1,131 @@
1
+ /* eslint-disable no-undef */
2
+
3
+ /****************************************************
4
+ *
5
+ * physics.js
6
+ *
7
+ * Implements the Physics Package for LaTeX input.
8
+ *
9
+ * ---------------------------------------------------------------------
10
+ *
11
+ * The original version of this file is licensed as follows:
12
+ * Copyright (c) 2015-2016 Kolen Cheung <https://github.com/ickc/MathJax-third-party-extensions>.
13
+ *
14
+ * Licensed under the Apache License, Version 2.0 (the "License");
15
+ * you may not use this file except in compliance with the License.
16
+ * You may obtain a copy of the License at
17
+ *
18
+ * http://www.apache.org/licenses/LICENSE-2.0
19
+ *
20
+ * Unless required by applicable law or agreed to in writing, software
21
+ * distributed under the License is distributed on an "AS IS" BASIS,
22
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23
+ * See the License for the specific language governing permissions and
24
+ * limitations under the License.
25
+ *
26
+ * ---------------------------------------------------------------------
27
+ *
28
+ * This file has been revised from the original in the following ways:
29
+ * 1. The interface is changed so that it can be called from Temml, not MathJax.
30
+ * 2. \Re and \Im are not used, to avoid conflict with existing LaTeX letters.
31
+ *
32
+ * This revision of the file is released under the MIT license.
33
+ * https://mit-license.org/
34
+ */
35
+ temml.__defineMacro("\\quantity", "{\\left\\{ #1 \\right\\}}");
36
+ temml.__defineMacro("\\qty", "{\\left\\{ #1 \\right\\}}");
37
+ temml.__defineMacro("\\pqty", "{\\left( #1 \\right)}");
38
+ temml.__defineMacro("\\bqty", "{\\left[ #1 \\right]}");
39
+ temml.__defineMacro("\\vqty", "{\\left\\vert #1 \\right\\vert}");
40
+ temml.__defineMacro("\\Bqty", "{\\left\\{ #1 \\right\\}}");
41
+ temml.__defineMacro("\\absolutevalue", "{\\left\\vert #1 \\right\\vert}");
42
+ temml.__defineMacro("\\abs", "{\\left\\vert #1 \\right\\vert}");
43
+ temml.__defineMacro("\\norm", "{\\left\\Vert #1 \\right\\Vert}");
44
+ temml.__defineMacro("\\evaluated", "{\\left.#1 \\right\\vert}");
45
+ temml.__defineMacro("\\eval", "{\\left.#1 \\right\\vert}");
46
+ temml.__defineMacro("\\order", "{\\mathcal{O} \\left( #1 \\right)}");
47
+ temml.__defineMacro("\\commutator", "{\\left[ #1 , #2 \\right]}");
48
+ temml.__defineMacro("\\comm", "{\\left[ #1 , #2 \\right]}");
49
+ temml.__defineMacro("\\anticommutator", "{\\left\\{ #1 , #2 \\right\\}}");
50
+ temml.__defineMacro("\\acomm", "{\\left\\{ #1 , #2 \\right\\}}");
51
+ temml.__defineMacro("\\poissonbracket", "{\\left\\{ #1 , #2 \\right\\}}");
52
+ temml.__defineMacro("\\pb", "{\\left\\{ #1 , #2 \\right\\}}");
53
+ temml.__defineMacro("\\vectorbold", "{\\boldsymbol{ #1 }}");
54
+ temml.__defineMacro("\\vb", "{\\boldsymbol{ #1 }}");
55
+ temml.__defineMacro("\\vectorarrow", "{\\vec{\\boldsymbol{ #1 }}}");
56
+ temml.__defineMacro("\\va", "{\\vec{\\boldsymbol{ #1 }}}");
57
+ temml.__defineMacro("\\vectorunit", "{{\\boldsymbol{\\hat{ #1 }}}}");
58
+ temml.__defineMacro("\\vu", "{{\\boldsymbol{\\hat{ #1 }}}}");
59
+ temml.__defineMacro("\\dotproduct", "\\mathbin{\\boldsymbol\\cdot}");
60
+ temml.__defineMacro("\\vdot", "{\\boldsymbol\\cdot}");
61
+ temml.__defineMacro("\\crossproduct", "\\mathbin{\\boldsymbol\\times}");
62
+ temml.__defineMacro("\\cross", "\\mathbin{\\boldsymbol\\times}");
63
+ temml.__defineMacro("\\cp", "\\mathbin{\\boldsymbol\\times}");
64
+ temml.__defineMacro("\\gradient", "{\\boldsymbol\\nabla}");
65
+ temml.__defineMacro("\\grad", "{\\boldsymbol\\nabla}");
66
+ temml.__defineMacro("\\divergence", "{\\grad\\vdot}");
67
+ //temml.__defineMacro("\\div", "{\\grad\\vdot}"); Not included in Temml. Conflicts w/LaTeX \div
68
+ temml.__defineMacro("\\curl", "{\\grad\\cross}");
69
+ temml.__defineMacro("\\laplacian", "\\nabla^2");
70
+ temml.__defineMacro("\\tr", "{\\operatorname{tr}}");
71
+ temml.__defineMacro("\\Tr", "{\\operatorname{Tr}}");
72
+ temml.__defineMacro("\\rank", "{\\operatorname{rank}}");
73
+ temml.__defineMacro("\\erf", "{\\operatorname{erf}}");
74
+ temml.__defineMacro("\\Res", "{\\operatorname{Res}}");
75
+ temml.__defineMacro("\\principalvalue", "{\\mathcal{P}}");
76
+ temml.__defineMacro("\\pv", "{\\mathcal{P}}");
77
+ temml.__defineMacro("\\PV", "{\\operatorname{P.V.}}");
78
+ // Temml does not use the next two lines. They conflict with LaTeX letters.
79
+ //temml.__defineMacro("\\Re", "{\\operatorname{Re} \\left\\{ #1 \\right\\}}");
80
+ //temml.__defineMacro("\\Im", "{\\operatorname{Im} \\left\\{ #1 \\right\\}}");
81
+ temml.__defineMacro("\\qqtext", "{\\quad\\text{ #1 }\\quad}");
82
+ temml.__defineMacro("\\qq", "{\\quad\\text{ #1 }\\quad}");
83
+ temml.__defineMacro("\\qcomma", "{\\text{,}\\quad}");
84
+ temml.__defineMacro("\\qc", "{\\text{,}\\quad}");
85
+ temml.__defineMacro("\\qcc", "{\\quad\\text{c.c.}\\quad}");
86
+ temml.__defineMacro("\\qif", "{\\quad\\text{if}\\quad}");
87
+ temml.__defineMacro("\\qthen", "{\\quad\\text{then}\\quad}");
88
+ temml.__defineMacro("\\qelse", "{\\quad\\text{else}\\quad}");
89
+ temml.__defineMacro("\\qotherwise", "{\\quad\\text{otherwise}\\quad}");
90
+ temml.__defineMacro("\\qunless", "{\\quad\\text{unless}\\quad}");
91
+ temml.__defineMacro("\\qgiven", "{\\quad\\text{given}\\quad}");
92
+ temml.__defineMacro("\\qusing", "{\\quad\\text{using}\\quad}");
93
+ temml.__defineMacro("\\qassume", "{\\quad\\text{assume}\\quad}");
94
+ temml.__defineMacro("\\qsince", "{\\quad\\text{since}\\quad}");
95
+ temml.__defineMacro("\\qlet", "{\\quad\\text{let}\\quad}");
96
+ temml.__defineMacro("\\qfor", "{\\quad\\text{for}\\quad}");
97
+ temml.__defineMacro("\\qall", "{\\quad\\text{all}\\quad}");
98
+ temml.__defineMacro("\\qeven", "{\\quad\\text{even}\\quad}");
99
+ temml.__defineMacro("\\qodd", "{\\quad\\text{odd}\\quad}");
100
+ temml.__defineMacro("\\qinteger", "{\\quad\\text{integer}\\quad}");
101
+ temml.__defineMacro("\\qand", "{\\quad\\text{and}\\quad}");
102
+ temml.__defineMacro("\\qor", "{\\quad\\text{or}\\quad}");
103
+ temml.__defineMacro("\\qas", "{\\quad\\text{as}\\quad}");
104
+ temml.__defineMacro("\\qin", "{\\quad\\text{in}\\quad}");
105
+ temml.__defineMacro("\\differential", "{\\text{d}}");
106
+ temml.__defineMacro("\\dd", "{\\text{d}}");
107
+ temml.__defineMacro("\\derivative", "{\\frac{\\text{d}{ #1 }}{\\text{d}{ #2 }}}");
108
+ temml.__defineMacro("\\dv", "{\\frac{\\text{d}{ #1 }}{\\text{d}{ #2 }}}");
109
+ temml.__defineMacro("\\partialderivative", "{\\frac{\\partial{ #1 }}{\\partial{ #2 }}}");
110
+ temml.__defineMacro("\\variation", "{\\delta}");
111
+ temml.__defineMacro("\\var", "{\\delta}");
112
+ temml.__defineMacro("\\functionalderivative", "{\\frac{\\delta{ #1 }}{\\delta{ #2 }}}");
113
+ temml.__defineMacro("\\fdv", "{\\frac{\\delta{ #1 }}{\\delta{ #2 }}}");
114
+ temml.__defineMacro("\\innerproduct", "{\\left\\langle {#1} \\mid { #2} \\right\\rangle}");
115
+ temml.__defineMacro("\\outerproduct",
116
+ "{\\left\\vert { #1 } \\right\\rangle\\left\\langle { #2} \\right\\vert}");
117
+ temml.__defineMacro("\\dyad",
118
+ "{\\left\\vert { #1 } \\right\\rangle\\left\\langle { #2} \\right\\vert}");
119
+ temml.__defineMacro("\\ketbra",
120
+ "{\\left\\vert { #1 } \\right\\rangle\\left\\langle { #2} \\right\\vert}");
121
+ temml.__defineMacro("\\op",
122
+ "{\\left\\vert { #1 } \\right\\rangle\\left\\langle { #2} \\right\\vert}");
123
+ temml.__defineMacro("\\expectationvalue", "{\\left\\langle {#1 } \\right\\rangle}");
124
+ temml.__defineMacro("\\expval", "{\\left\\langle {#1 } \\right\\rangle}");
125
+ temml.__defineMacro("\\ev", "{\\left\\langle {#1 } \\right\\rangle}");
126
+ temml.__defineMacro("\\matrixelement",
127
+ "{\\left\\langle{ #1 }\\right\\vert{ #2 }\\left\\vert{#3}\\right\\rangle}");
128
+ temml.__defineMacro("\\matrixel",
129
+ "{\\left\\langle{ #1 }\\right\\vert{ #2 }\\left\\vert{#3}\\right\\rangle}");
130
+ temml.__defineMacro("\\mel",
131
+ "{\\left\\langle{ #1 }\\right\\vert{ #2 }\\left\\vert{#3}\\right\\rangle}");
@@ -0,0 +1,23 @@
1
+ # texvc extension
2
+
3
+ This extension adds to Temml functions available in mediawiki pages.
4
+
5
+ It omits the functions deprecated at
6
+ https://en.wikipedia.org/wiki/Help:Displaying_a_formula#Deprecated_syntax
7
+
8
+ You can download the `texvc.js` file from this repository.
9
+
10
+ ### Usage
11
+
12
+ This extension isn't part of core Temml, so the script should be separately included in the HTML page's `<head>`. Place it _after_ the line that calls `temml.js`.
13
+
14
+ ```html
15
+ <script src="./temml.min.js"></script>
16
+ <script src="./texvc.js"></script>
17
+ ```
18
+
19
+ If you are working sever-side, just use `temml.cjs`. It already includes all the functions in `texvc.js`.
20
+
21
+ ### Syntax
22
+
23
+ All the functions in the _texvc_ extension are listed in the [Temml docs](https://temml.org/docs/en/supported.html).
@@ -0,0 +1,61 @@
1
+ /* eslint-disable no-undef */
2
+
3
+ //////////////////////////////////////////////////////////////////////
4
+ // texvc.sty
5
+
6
+ // The texvc package contains macros available in mediawiki pages.
7
+ // We omit the functions deprecated at
8
+ // https://en.wikipedia.org/wiki/Help:Displaying_a_formula#Deprecated_syntax
9
+
10
+ // We also omit texvc's \O, which conflicts with \text{\O}
11
+
12
+ temml.__defineMacro("\\darr", "\\downarrow");
13
+ temml.__defineMacro("\\dArr", "\\Downarrow");
14
+ temml.__defineMacro("\\Darr", "\\Downarrow");
15
+ temml.__defineMacro("\\lang", "\\langle");
16
+ temml.__defineMacro("\\rang", "\\rangle");
17
+ temml.__defineMacro("\\uarr", "\\uparrow");
18
+ temml.__defineMacro("\\uArr", "\\Uparrow");
19
+ temml.__defineMacro("\\Uarr", "\\Uparrow");
20
+ temml.__defineMacro("\\N", "\\mathbb{N}");
21
+ temml.__defineMacro("\\R", "\\mathbb{R}");
22
+ temml.__defineMacro("\\Z", "\\mathbb{Z}");
23
+ temml.__defineMacro("\\alef", "\\aleph");
24
+ temml.__defineMacro("\\alefsym", "\\aleph");
25
+ temml.__defineMacro("\\bull", "\\bullet");
26
+ temml.__defineMacro("\\clubs", "\\clubsuit");
27
+ temml.__defineMacro("\\cnums", "\\mathbb{C}");
28
+ temml.__defineMacro("\\Complex", "\\mathbb{C}");
29
+ temml.__defineMacro("\\Dagger", "\\ddagger");
30
+ temml.__defineMacro("\\diamonds", "\\diamondsuit");
31
+ temml.__defineMacro("\\empty", "\\emptyset");
32
+ temml.__defineMacro("\\exist", "\\exists");
33
+ temml.__defineMacro("\\harr", "\\leftrightarrow");
34
+ temml.__defineMacro("\\hArr", "\\Leftrightarrow");
35
+ temml.__defineMacro("\\Harr", "\\Leftrightarrow");
36
+ temml.__defineMacro("\\hearts", "\\heartsuit");
37
+ temml.__defineMacro("\\image", "\\Im");
38
+ temml.__defineMacro("\\infin", "\\infty");
39
+ temml.__defineMacro("\\isin", "\\in");
40
+ temml.__defineMacro("\\larr", "\\leftarrow");
41
+ temml.__defineMacro("\\lArr", "\\Leftarrow");
42
+ temml.__defineMacro("\\Larr", "\\Leftarrow");
43
+ temml.__defineMacro("\\lrarr", "\\leftrightarrow");
44
+ temml.__defineMacro("\\lrArr", "\\Leftrightarrow");
45
+ temml.__defineMacro("\\Lrarr", "\\Leftrightarrow");
46
+ temml.__defineMacro("\\natnums", "\\mathbb{N}");
47
+ temml.__defineMacro("\\plusmn", "\\pm");
48
+ temml.__defineMacro("\\rarr", "\\rightarrow");
49
+ temml.__defineMacro("\\rArr", "\\Rightarrow");
50
+ temml.__defineMacro("\\Rarr", "\\Rightarrow");
51
+ temml.__defineMacro("\\real", "\\Re");
52
+ temml.__defineMacro("\\reals", "\\mathbb{R}");
53
+ temml.__defineMacro("\\Reals", "\\mathbb{R}");
54
+ temml.__defineMacro("\\sdot", "\\cdot");
55
+ temml.__defineMacro("\\sect", "\\S");
56
+ temml.__defineMacro("\\spades", "\\spadesuit");
57
+ temml.__defineMacro("\\sub", "\\subset");
58
+ temml.__defineMacro("\\sube", "\\subseteq");
59
+ temml.__defineMacro("\\supe", "\\supseteq");
60
+ temml.__defineMacro("\\thetasym", "\\vartheta");
61
+ temml.__defineMacro("\\weierp", "\\wp");
@@ -0,0 +1,201 @@
1
+ /*
2
+ Asana Math is released under the SIL Open Font License. See the files in this
3
+ directory for details. The font can be obtained from several TeX distributions
4
+ or package managers. The font does not seem to have a corresponding "non-MATH"
5
+ font, it is recommended to use a Palatino-like font for the surrounding text.
6
+
7
+ The WOFF fonts have been obtained from
8
+ http://mirrors.ctan.org/fonts/
9
+ */
10
+
11
+ @font-face {
12
+ font-family: Asana Math;
13
+ src: local('Asana Math'), local('Asana-Math'),
14
+ url('./Asana-Math.woff2');
15
+ }
16
+
17
+ math {
18
+ font-style: normal;
19
+ font-weight: normal;
20
+ line-height: normal;
21
+ font-size-adjust: none;
22
+ text-indent: 0;
23
+ text-transform: none;
24
+ letter-spacing: normal;
25
+ word-wrap: normal;
26
+ direction: ltr;
27
+ }
28
+
29
+ math * {
30
+ border-color: currentColor;
31
+ }
32
+
33
+ mtext {
34
+ font-family: Asana Math;
35
+ }
36
+
37
+ math {
38
+ font-family: Asana Math;
39
+ }
40
+
41
+ *.mathcal,
42
+ mo.tml-prime {
43
+ font-feature-settings: 'salt';
44
+ }
45
+
46
+ .oldstylenums {
47
+ font-feature-settings: 'onum';
48
+ }
49
+
50
+ /* AMS environment auto-numbering via CSS counter. */
51
+ .tml-eqn::before {
52
+ counter-increment: tmlEqnNo;
53
+ content: "(" counter(tmlEqnNo) ")";
54
+ }
55
+
56
+ body {
57
+ counter-reset: tmlEqnNo;
58
+ }
59
+
60
+ /* Environment arrays */
61
+
62
+ /* Environments that addjot to row spacing */
63
+ mtable.tml-jot > mtr > mtd {
64
+ padding-top: calc(0.5ex + 0.09em);
65
+ padding-bottom: calc(0.5ex + 0.09em);
66
+ }
67
+
68
+ /* Zero column gap for {alignat}, {split}, etc */
69
+ mtable.tml-abut > mtr > mtd,
70
+ mtable.tml-align > mtr > mtd:nth-child(odd),
71
+ mtable.tml-align-star > mtr > mtd:nth-child(even) {
72
+ padding-left: 0em;
73
+ padding-right: 0em;
74
+ }
75
+
76
+ mtable.tml-align > mtr > mtd:nth-child(even),
77
+ mtable.tml-align-star > mtr > mtd:nth-child(odd) {
78
+ padding-left: 1em;
79
+ padding-right: 0em;
80
+ }
81
+
82
+ mtable.tml-align > mtr > mtd:nth-child(1) {
83
+ padding-left: 0em;
84
+ }
85
+
86
+ mtable.tml-align > mtr > mtd:nth-child(odd),
87
+ mtable.tml-alignat > mtr > mtd:nth-child(odd),
88
+ mtable.tml-aligned > mtr > mtd:nth-child(even) {
89
+ text-align: -webkit-left;
90
+ }
91
+
92
+ mtable.tml-align > mtr > mtd:nth-child(even),
93
+ mtable.tml-alignat > mtr > mtd:nth-child(even),
94
+ mtable.tml-aligned > mtr > mtd:nth-child(odd) {
95
+ text-align: -webkit-right;
96
+ }
97
+
98
+ mtable.tml-cases > mtr > mtd {
99
+ padding-left: 0em;
100
+ padding-right: 0em;
101
+ text-align: -webkit-left;
102
+ }
103
+
104
+ mtable.tml-cases > mtr > mtd:nth-child(2) {
105
+ padding-left: 1em;
106
+ }
107
+
108
+ mtable.tml-small > mtr > mtd {
109
+ padding-top: 0.35ex;
110
+ padding-bottom: 0.35ex;
111
+ padding-left: 0.1389em;
112
+ padding-right: 0.1389em;
113
+ }
114
+
115
+ mtable.tml-subarray > mtr > mtd {
116
+ padding-top: 0em;
117
+ padding-left: 0em;
118
+ }
119
+
120
+ mtable.tml-cd > mtr > mtd {
121
+ padding-left: 0.25em;
122
+ padding-right: 0.25em;
123
+ }
124
+
125
+ mtable > mtr:first-child > mtr > mtd {
126
+ padding-top: 0em;
127
+ }
128
+
129
+ mtable > mtr:last-child > mtr > mtd {
130
+ padding-bottom: 0em;
131
+ }
132
+
133
+ mtable:not(.tml-array) > mtr > mtd:first-child {
134
+ padding-left: 0em;
135
+ }
136
+
137
+ mtable:not(.tml-array) > mtr > mtd:last-child {
138
+ padding-right: 0em;
139
+ }
140
+
141
+ mtr.tml-top-solid > mtd {
142
+ border-top: 0.06em solid;
143
+ }
144
+
145
+ mtr.tml-top-double > mtd {
146
+ border-top: 0.15em double;
147
+ }
148
+
149
+ mtr.tml-top-dashed > mtd {
150
+ border-top: 0.06em dashed;
151
+ }
152
+
153
+ mtr.tml-hline-solid > mtd {
154
+ border-bottom: 0.06em solid;
155
+ }
156
+
157
+ mtr.tml-hline-double > mtd {
158
+ border-bottom: 0.15em double;
159
+ }
160
+
161
+ mtr.tml-hline-dashed > mtd {
162
+ border-bottom: 0.06em dashed;
163
+ }
164
+
165
+ /* MathML-Core does not support <menclose> attributes.
166
+ * So Use background images for \cancel */
167
+ menclose.cancel {
168
+ background:
169
+ linear-gradient(to top left,
170
+ rgba(0,0,0,0) 0%,
171
+ rgba(0,0,0,0) calc(50% - 0.06em),
172
+ rgba(0,0,0,1) 50%,
173
+ rgba(0,0,0,0) calc(50% + 0.06em),
174
+ rgba(0,0,0,0) 100%);
175
+ }
176
+
177
+ menclose.bcancel {
178
+ background:
179
+ linear-gradient(to top right,
180
+ rgba(0,0,0,0) 0%,
181
+ rgba(0,0,0,0) calc(50% - 0.06em),
182
+ rgba(0,0,0,1) 50%,
183
+ rgba(0,0,0,0) calc(50% + 0.06em),
184
+ rgba(0,0,0,0) 100%);
185
+ }
186
+
187
+ menclose.xcancel {
188
+ background:
189
+ linear-gradient(to top left,
190
+ rgba(0,0,0,0) 0%,
191
+ rgba(0,0,0,0) calc(50% - 0.06em),
192
+ rgba(0,0,0,1) 50%,
193
+ rgba(0,0,0,0) calc(50% + 0.06em),
194
+ rgba(0,0,0,0) 100%),
195
+ linear-gradient(to top right,
196
+ rgba(0,0,0,0) 0%,
197
+ rgba(0,0,0,0) calc(50% - 0.06em),
198
+ rgba(0,0,0,1) 50%,
199
+ rgba(0,0,0,0) calc(50% + 0.06em),
200
+ rgba(0,0,0,0) 100%);
201
+ }