Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ based on http://keepachangelog.com/en/1.0.0/
- Grammar for `comment` environment.

### Changed
- Changed `'include': '$base'` to `'include': '$self'`. This improves highlighting when embedded in another grammar, such as Markdown.
- Set 'softWrap' to be true by default in LaTeX files.
- Changed inline math snippet from `$...$` to `\(...\)`.

Expand Down
19 changes: 19 additions & 0 deletions grammars/latex-beamer.cson
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,25 @@
'match': '((\\\\)frametitle)(\\{)(.*)(\\})'
'name': 'meta.function.frametitle.latex'
}
# The following rule is repeated from `latex.cson` in order to support the use
# of `$self` instead of `$base`. This allows for correct embedding of
# LaTeX rules within other grammars, for example Markdown.
{
'begin': '\\{'
'beginCaptures':
'0':
'name': 'punctuation.section.group.begin.tex.latex.beamer'
'end': '\\}'
'endCaptures':
'0':
'name': 'punctuation.section.group.end.tex.latex.beamer'
'name': 'meta.group.braces.tex.latex.beamer'
'patterns': [
{
'include': '$self'
}
]
}
{
'include': 'text.tex.latex'
}
Expand Down
19 changes: 19 additions & 0 deletions grammars/latex-memoir.cson
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,25 @@
}
]
}
# The following rule is repeated from `latex.cson` in order to support the use
# of `$self` instead of `$base`. This allows for correct embedding of
# LaTeX rules within other grammars, for example Markdown.
{
'begin': '\\{'
'beginCaptures':
'0':
'name': 'punctuation.section.group.begin.tex.latex.memoir'
'end': '\\}'
'endCaptures':
'0':
'name': 'punctuation.section.group.end.tex.latex.memoir'
'name': 'meta.group.braces.tex.latex.memoir'
'patterns': [
{
'include': '$self'
}
]
}
{
'include': 'text.tex.latex'
}
Expand Down
54 changes: 35 additions & 19 deletions grammars/latex.cson
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
'name': 'support.variable.expl3.latex'
}
{
'include': '$base'
'include': '$self'
}
]
}
Expand All @@ -147,7 +147,7 @@
'name': 'support.variable.expl3.latex'
}
{
'include': '$base'
'include': '$self'
}
]
}
Expand Down Expand Up @@ -1448,7 +1448,7 @@
'name': 'meta.function.environment.math.latex'
'patterns': [
{
'include': '$base'
'include': '$self'
}
]
}
Expand Down Expand Up @@ -1476,7 +1476,7 @@
'name': 'meta.function.environment.math.latex'
'patterns': [
{
'include': '$base'
'include': '$self'
}
]
}
Expand Down Expand Up @@ -1504,7 +1504,7 @@
'name': 'meta.function.environment.math.latex'
'patterns': [
{
'include': '$base'
'include': '$self'
}
]
}
Expand All @@ -1526,7 +1526,7 @@
'name': 'meta.function.environment.math.latex'
'patterns': [
{
'include': '$base'
'include': '$self'
}
]
}
Expand Down Expand Up @@ -1580,17 +1580,17 @@
'name': 'meta.cell.environment.tabular.latex'
'patterns': [
{
'include': '$base'
'include': '$self'
}
]
}
{
'include': '$base'
'include': '$self'
}
]
}
{
'include': '$base'
'include': '$self'
}
]
}
Expand All @@ -1611,7 +1611,7 @@
'name': 'meta.function.environment.list.latex'
'patterns': [
{
'include': '$base'
'include': '$self'
}
]
}
Expand Down Expand Up @@ -1673,7 +1673,7 @@
'name': 'meta.function.environment.general.latex'
'patterns': [
{
'include': '$base'
'include': '$self'
}
]
}
Expand Down Expand Up @@ -1712,7 +1712,7 @@
'name': 'punctuation.definition.marginpar.end.latex'
'patterns': [
{
'include': '$base'
'include': '$self'
}
]
}
Expand Down Expand Up @@ -1745,7 +1745,7 @@
'name': 'punctuation.definition.footnote.end.latex'
'patterns': [
{
'include': '$base'
'include': '$self'
}
]
}
Expand All @@ -1766,7 +1766,7 @@
'name': 'meta.function.emph.latex'
'patterns': [
{
'include': '$base'
'include': '$self'
}
]
}
Expand All @@ -1788,7 +1788,7 @@
'name': 'meta.function.textit.latex'
'patterns': [
{
'include': '$base'
'include': '$self'
}
]
}
Expand All @@ -1809,7 +1809,7 @@
'name': 'meta.function.textbf.latex'
'patterns': [
{
'include': '$base'
'include': '$self'
}
]
}
Expand All @@ -1830,7 +1830,7 @@
'name': 'meta.function.texttt.latex'
'patterns': [
{
'include': '$base'
'include': '$self'
}
]
}
Expand Down Expand Up @@ -2018,7 +2018,7 @@
'name': 'string.other.math.latex'
'patterns': [
{
'include': '$base'
'include': '$self'
}
]
}
Expand All @@ -2034,7 +2034,7 @@
'name': 'string.other.math.latex'
'patterns': [
{
'include': '$base'
'include': '$self'
}
]
}
Expand All @@ -2054,6 +2054,22 @@
'match': '(?:<|>)(\\{)\\$(\\})'
'name': 'meta.column-specials.latex'
}
{
'begin': '\\{'
'beginCaptures':
'0':
'name': 'punctuation.section.group.begin.tex.latex'
'end': '\\}'
'endCaptures':
'0':
'name': 'punctuation.section.group.end.tex.latex'
'name': 'meta.group.braces.tex.latex'
'patterns': [
{
'include': '$self'
}
]
}
{
'include': 'text.tex'
}
Expand Down
2 changes: 1 addition & 1 deletion grammars/tex.cson
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
'name': 'meta.group.braces.tex'
'patterns': [
{
'include': '$base'
'include': '$self'
}
]
}
Expand Down