       4: name: 'variable.parameter.environment.$5.latex'
       # 5: Used for meta scope name (basically just non starred version)
       6: name: 'punctuation.definition.arguments.end.latex'
+      7: name: 'punctuation.definition.arguments.optional.begin.latex'
+      8:
+        name: 'variable.parameter.optional.function.environment.tikz.latex'
+        patterns: [
+          { include: '#tikzOptions' }
+          { include: '$self' }
+        ]
+      9: name: 'punctuation.definition.arguments.optional.end.latex'
     end: '((\\\\)end)(\\{)(\\4)(\\})'
     endCaptures:
       1: name: 'support.function.environment.end.latex'

    match: '(\\d*\\.\\d+|(\\d+\\.)?\\d*)'
    name: 'constant.numeric.math.latex'
  }

# Unfortunate necessity (mainly making a unique grammar for each coding language)
  mintGeneric: {

    comment: 'The manual shows it can take an optional argument that may be several lines. This will be ignored for now.'
    name: 'meta.environment.embedded.$5.latex'
    contentName: 'source.embedded.tikz'
    begin: '((\\\\)begin)(\\{)((tikzpicture)\\*?)(\\})(?:(\\[)(.*?)(\\]))?'
    beginCaptures:
      1: name: 'support.function.environment.begin.latex'
      2: name: 'punctuation.definition.function.begin.latex'
