Skip to content

Commit

Permalink
Merge pull request #370 from randy3k/latex
Browse files Browse the repository at this point in the history
[LaTeX] rewrite syntaxes
  • Loading branch information
wbond authored Jul 22, 2016
2 parents 3e4e845 + 23f17cb commit 2b4f7e7
Show file tree
Hide file tree
Showing 14 changed files with 2,227 additions and 665 deletions.
41 changes: 32 additions & 9 deletions Haskell/Literate Haskell.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,45 @@ file_extensions:
- lhs
scope: text.tex.latex.haskell
contexts:
prototype:
- include: scope:text.tex.latex#comments

main:
- match: '^((\\)begin)({)code(})(\s*\n)?'
- include: scope:text.tex.latex#unique-latex
- include: scope:text.tex.latex#packages
- include: haskell-code
- include: scope:text.tex.latex#plain-tex
- include: scope:text.tex.latex#begin-end-commands
- include: scope:text.tex.latex#general-commands
- include: global-braces

global-braces:
- match: '\{'
scope: punctuation.definition.group.brace.begin.latex
push:
- meta_scope: meta.group.brace.latex
- match: '\}'
scope: punctuation.definition.group.brace.end.latex
pop: true
- include: main

haskell-code:
- match: '(?:\s*)((\\)begin)(\{)(code)(\})'
captures:
1: support.function.be.latex
2: punctuation.definition.function.latex
3: punctuation.definition.arguments.begin.latex
4: punctuation.definition.arguments.end.latex
2: punctuation.definition.backslash.latex
3: punctuation.definition.group.brace.begin.latex
4: variable.parameter.function.latex
5: punctuation.definition.group.brace.end.latex
push:
- meta_scope: meta.function.embedded.haskell.latex
- meta_content_scope: source.haskell.embedded.latex
- match: '^((\\)end)({)code(})'
- match: '((\\)end)(\{)(code)(\})'
captures:
1: support.function.be.latex
2: punctuation.definition.function.latex
3: punctuation.definition.arguments.begin.latex
4: punctuation.definition.arguments.end.latex
2: punctuation.definition.backslash.latex
3: punctuation.definition.group.brace.begin.latex
4: variable.parameter.function.latex
5: punctuation.definition.group.brace.end.latex
pop: true
- include: scope:source.haskell
- include: scope:text.tex.latex
14 changes: 14 additions & 0 deletions LaTeX/Indentation Rules.tmPreferences
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>scope</key>
<string>text.tex</string>
<key>settings</key>
<dict>
<key>decreaseIndentPattern</key>
<string>^\s*\\end\s*\{(?:itemize|enumerate|description)\*?\}\s*$</string>
<key>increaseIndentPattern</key>
<string>^\s*\\begin\s*\{(?:itemize|enumerate|description)\*?\}\s*$</string>
</dict>
</dict>
</plist>
36 changes: 0 additions & 36 deletions LaTeX/LaTeX Beamer.sublime-syntax

This file was deleted.

68 changes: 0 additions & 68 deletions LaTeX/LaTeX Memoir.sublime-syntax

This file was deleted.

4 changes: 4 additions & 0 deletions LaTeX/LaTeX.sublime-settings
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"spelling_selector": "-(comment, source, constant, keyword, storage, support, variable, markup.underline.link, meta.tag, meta.preamble, meta.include, meta.function.citation, meta.function.reference, meta.function.label, meta.function.includegraphics)",
"word_separators": "_./\\()\"'-:,.;<>~!@#$%^&*|+=[]{}`~?"
}
Loading

0 comments on commit 2b4f7e7

Please sign in to comment.