text: /*
   * Author: Constantin Jucovschi (c.jucovschi@jacobs-university.de)
   * Licence: MIT
   */(function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)})(function(e){"use strict";e.defineMode("stex",function(){function e(e,t){e.cmdState.push(t)}function t(e){return e.cmdState.length>0?e.cmdState[e.cmdState.length-1]:null}function n(e){var t=e.cmdState.pop();t&&t.closeBracket()}function r(e){var t=e.cmdState;for(var n=t.length-1;n>=0;n--){var r=t[n];if(r.name=="DEFAULT")continue;return r}return{styleIdentifier:function(){return null}}}function i(e,t,n){return function(){this.name=e,this.bracketNo=0,this.style=t,this.styles=n,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}function o(e,t){e.f=t}function u(n,i){var u;if(n.match(/^\\[a-zA-Z@]+/)){var c=n.current().slice(1);return u=s[c]||s.DEFAULT,u=new u,e(i,u),o(i,l),u.style}if(n.match(/^\\[$&%#{}_]/))return"tag";if(n.match(/^\\[,;!\/\\]/))return"tag";if(n.match("\\["))return o(i,function(e,t){return f(e,t,"\\]")}),"keyword";if(n.match("$$"))return o(i,function(e,t){return f(e,t,"$$")}),"keyword";if(n.match("$"))return o(i,function(e,t){return f(e,t,"$")}),"keyword";var h=n.next();if(h=="%")return n.eol()||o(i,a),"comment";if(h=="}"||h=="]")return u=t(i),u?(u.closeBracket(h),o(i,l),"bracket"):"error";return h=="{"||h=="["?(u=s.DEFAULT,u=new u,e(i,u),"bracket"):/\d/.test(h)?(n.eatWhile(/[\w.%]/),"atom"):(n.eatWhile(/[\w\-_]/),u=r(i),u.name=="begin"&&(u.argument=n.current()),u.styleIdentifier())}function a(e,t){return e.skipToEnd(),o(t,u),"comment"}function f(e,t,n){if(e.eatSpace())return null;if(e.match(n))return o(t,u),"keyword";if(e.match(/^\\[a-zA-Z@]+/))return"tag";if(e.match(/^[a-zA-Z]+/))return"variable-2";if(e.match(/^\\[$&%#{}_]/))return"tag";if(e.match(/^\\[,;!\/]/))return"tag";if(e.match(/^[\^_&]/))return"tag";if(e.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(e.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var r=e.next();return r=="{"||r=="}"||r=="["||r=="]"||r=="("||r==")"?"bracket":r=="%"?(e.eol()||e.skipToEnd(),"comment"):"error"}function l(e,r){var i=e.peek(),s;return i=="{"||i=="["?(s=t(r),s.openBracket(i),e.eat(i),o(r,u),"bracket"):/[ \t\r]/.test(i)?(e.eat(i),null):(o(r,u),n(r),u(e,r))}var s={};return s.importmodule=i("importmodule","tag",["string","builtin"]),s.documentclass=i("documentclass","tag",["","atom"]),s.usepackage=i("usepackage","tag",["atom"]),s.begin=i("begin","tag",["atom"]),s.end=i("end","tag",["atom"]),s.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}},{startState:function(){return{cmdState:[],f:u}},copyState:function(e){return{cmdState:e.cmdState.slice(),f:e.f}},token:function(e,t){return t.f(e,t)}}}),e.defineMIME("text/x-stex","stex"),e.defineMIME("text/x-latex","stex")});