                 comment: 'When in display math, the exit can only be $$ or \]'
                 name: 'invalid.illegal.latex'
                 match: '(?<=[^\\\\])(\\$)(?=[^\\$])|(\\\\(\\[|\\(|\\)))'
+            }
+            {
+                include: '$base'
             }
         ]
     }

                name: 'invalid.illegal.latex'
                match: '(\\\\(\\[|\\(|\\)))'
            }
        ]
    }
    displayMathMode: {

        comment: 'Considering making this give a warning, as brackets is best practice'
        name: 'punctuation.subscript.latex'
        match: '_\\s*(\\\\[a-zA-Z]+|.)?'
    }
    caretMeta: {
        comment: 'Like underscore, but superscript'
        patterns: [
            {
                include: '#caretWithArgument'
            }
            {
                include: '#caretNoArgument'
            }
        ]
    }
    caretWithArgument: {
        comment: 'Matches a caret and between curly brackets'
        name: 'punctuation.superscript.latex'
        begin: '\\^\\s*(?={)'
        end: '(?<=\\})'
        patterns: [
            {
                include: '#argumentScope'
            }
        ]
    }
    caretNoArgument: {
        comment: 'Matches a caret and next character or macro'
        comment: 'Considering making this give a warning, as brackets is best practice'
        name: 'punctuation.superscript.latex'
        match: '\\^\\s*(\\\\[a-zA-Z]+|.)?'
    }
    hashtagMeta: {
        comment: 'I dont like calling this the pound symbol. Catcode says it is a parameter.'
        match: '(\\#{3,}[0-9]+)|(\\#{2}[0-9]+)|(\\#[0-9]+)'
        captures:
            1:
                name: 'variable.parameter.hashtag.3.latex'
            2:
                name: 'variable.parameter.hashtag.2.latex'
            3:
                name: 'variable.parameter.hashtag.1.latex'
    }
    escapedCharacter: {
        comment: 'Finds escaped characters like \$ and \%. Uses this regex so unique capture groups can be used.'
