Skip to content

Commit

Permalink
latex support
Browse files Browse the repository at this point in the history
it closes the long term issue #164
  • Loading branch information
randy3k committed Jul 24, 2017
1 parent 4fa5ccd commit 53d9594
Showing 1 changed file with 28 additions and 10 deletions.
38 changes: 28 additions & 10 deletions Syntaxes/Markdown Extended.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ contexts:
scope: markup.heading.2.markdown
captures:
1: punctuation.definition.heading.markdown
- include: latex-display

html_comment:
- match: <!--
captures:
Expand Down Expand Up @@ -1196,11 +1196,12 @@ contexts:
- match: ^\s*$
pop: true
- match: '^\s{0,4}([*+-]|([0-9]+)\.)(?=\s)'
captures:
captures:
1: punctuation.definition.list_item.markdown
2: punctuation.definition.list_item.number.markdown
- include: inline
raw:
- include: latex-display
- match: '(`+)([^`]|(?!(?<!`)\1(?!`))`)*+(\1)'
scope: markup.raw.inline.markdown
captures:
Expand Down Expand Up @@ -1280,17 +1281,34 @@ contexts:
- include: link-ref
latex-inline:
- match: '(?=\$)'
- match: \\\$
- match: |-
(?x)
(\$)(?=\S)
(?=
(?:
\\\\
|\\\$
|[^\$]
)*?
\S\$(?:[^a-zA-Z0-9]|$)
)
scope: string.other.math.latex punctuation.definition.string.begin.latex
push:
- meta_scope: text.tex.latex
- match: '(?<=\$)'
- meta_scope: text.tex.latex meta.environment.math.latex
- include: scope:text.tex.latex#macros
- include: scope:text.tex.latex#math-content
- match: \$
scope: string.other.math.latex punctuation.definition.string.end.latex
pop: true
- include: scope:text.tex.latex
latex-display:
- match: '(?=\$\$)'
- match: \$\$
scope: string.other.math.latex punctuation.definition.string.begin.latex
push:
- meta_scope: text.tex.latex
- match: '(?<=\$\$)'
- meta_scope: text.tex.latex meta.environment.math.latex
- include: scope:text.tex.latex#macros
- include: scope:text.tex.latex#math-content
- match: \$\$
scope: string.other.math.latex punctuation.definition.string.end.latex
pop: true
- include: scope:text.tex.latex

0 comments on commit 53d9594

Please sign in to comment.