Skip to content

Commit

Permalink
[Latex] Match sizes using dots as optional argument to newline command (
Browse files Browse the repository at this point in the history
sublimehq#1761)

Previously, commands like `\\[1.5ex]` that use a dot in the size were not matched correctly (while `\\[1ex]̀  was recognized). This is fixed.
  • Loading branch information
tobiasdiez authored and wbond committed Jul 29, 2019
1 parent 5163f2e commit 81f6c7e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion LaTeX/LaTeX.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ contexts:
- include: macro-braces
general-constants:
- match: '(\\\\)(?:(\[)\s*-?([[:digit:]]*)\s*(\w*)\s*(\]))?'
- match: '(\\\\)(?:(\[)\s*-?((?:[[:digit:]]|\.)*)\s*(\w*)\s*(\]))?'
captures:
1: constant.character.newline.latex
2: punctuation.definition.group.bracket.begin.newline.latex
Expand Down
13 changes: 13 additions & 0 deletions LaTeX/syntax_test_latex.tex
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,19 @@
% ^ support.function.begin.latex keyword.control.flow.begin.latex
% ^ variable.parameter.function.latex


% TEX INTERNAL COMMANDS
\\
% <- constant.character.newline.latex

\\[1.5ex]
% <- constant.character.newline.latex
% ^ punctuation.definition.group.bracket.begin.newline.latex
% ^^^ constant.numeric.newline.latex
% ^^ keyword.other.newline.latex
% ^ punctuation.definition.group.bracket.begin.newline.latex


% SECTION COMMANDS

\part{name}
Expand Down

0 comments on commit 81f6c7e

Please sign in to comment.