latex mode
This commit is contained in:
parent
aaa7abe505
commit
5379fa6647
2 changed files with 44 additions and 23 deletions
|
|
@ -6,29 +6,28 @@ var TextHighlightRules = require("ace/mode/text_highlight_rules").TextHighlightR
|
|||
var LatexHighlightRules = function()
|
||||
{
|
||||
this.$rules = {
|
||||
"start" : [
|
||||
{
|
||||
// A tex command e.g. \foo
|
||||
token : "keyword",
|
||||
regex : "\\\\(?:[^a-zA-Z]|[a-zA-Z]+)",
|
||||
},
|
||||
{
|
||||
// Curly and square braces
|
||||
token : "keyword",
|
||||
regex : "[\\{\\}\\]\\[]"
|
||||
},
|
||||
{
|
||||
// Inline math between two $ symbols
|
||||
token : "string",
|
||||
regex : "\\$(?:(?:\\\\.)|(?:[^\\$\\\\]))*?\\$"
|
||||
},
|
||||
{
|
||||
// A comment. Tex comments start with % and go to
|
||||
// the end of the line
|
||||
token : "comment",
|
||||
regex : "%.*$"
|
||||
}
|
||||
]
|
||||
"start" : [{
|
||||
// A tex command e.g. \foo
|
||||
token : "keyword",
|
||||
regex : "\\\\(?:[^a-zA-Z]|[a-zA-Z]+)",
|
||||
}, {
|
||||
// Curly and square braces
|
||||
token : "lparen",
|
||||
regex : "[[({]"
|
||||
}, {
|
||||
// Curly and square braces
|
||||
token : "rparen",
|
||||
regex : "[\\])}]"
|
||||
}, {
|
||||
// Inline math between two $ symbols
|
||||
token : "string",
|
||||
regex : "\\$(?:(?:\\\\.)|(?:[^\\$\\\\]))*?\\$"
|
||||
}, {
|
||||
// A comment. Tex comments start with % and go to
|
||||
// the end of the line
|
||||
token : "comment",
|
||||
regex : "%.*$"
|
||||
}]
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue