                 name: 'variable.parameter.optional.latex'
             9:
                 name: 'punctuation.definition.optional.end.latex'
-        end: '(\\\\)(end)(\\{)(figure)(\\})'
+        end: '(\\\\)(end)(\\{)(\\4)(\\})'
         endCaptures:
             1:
                 name: 'punctuation.definition.function.latex'

            }
            {
                include: '#figureEnvironment'
            }
            {
                include: '#genericEnvironment'

        #     }
        # ]
    }
    mathEnvironmentMeta: {
        comment: 'Matches math environments'
        patterns: [
            {
                include: '#alignMathEnvironment'
            }
        ]
    }
    alignMathEnvironment: {
        comment: 'Matches align environment'
        contentName: 'support.environment.math.align.latex'
        begin: '(\\\\)(begin)(\\{)(align(\\*)?)(\\})'
        beginCaptures:
            1:
                name: 'punctuation.definition.function.latex'
            2:
                name: 'support.function.environment.begin.latex'
            3:
                name: 'punctuation.definition.argument.begin.latex'
            4:
                name: 'variable.parameter.argument.latex'
            6:
                name: 'punctuation.definition.argument.end.latex'
        end: '(\\\\)(end)(\\{)(\\4)(\\})'
        endCaptures:
            1:
                name: 'punctuation.definition.function.latex'
            2:
                name: 'support.function.environment.end.latex'
            3:
                name: 'punctuation.definition.argument.begin.latex'
            4:
                name: 'variable.parameter.argument.latex'
            5:
                name: 'punctuation.definition.argument.end.latex'
        patterns: [
            {
                include: '$base'
            }
        ]
    }
    makeatsomething: {
        comment: 'Matches the makeat(letter|other) commands so that they get custom highlighting (because @ is now a character)'
        name: 'support.function.makeat.latex'
