I'm trying to compile a picture with the following formula in the label

\node[label=left:$f_{23}(r(x_2,\tau)) $] (F012) at (0,2) {};

However, every time I put a comma inside the formula, TeX writes me an error message:

Missing \endcsname inserted.
<to be read again>
l.207 \node[label=left:$f_{23}(r(x_2,\tau)) $]

I understand that this comma violates some internal rule of tikz, but how can I overcome this problem?

  • 8
    Have you tried enclosing it with braces? \node[label=left:{$f_{23}(r(x_2,\tau)) $}]
    – cgnieder
    Jul 29, 2012 at 9:14

1 Answer 1


Almost everywhere in tikz where commas are part of a value, you must enclose that value in braces. The following should work:

\node[label=left:{$f_{23}(r(x_2,\tau)) $}] (F012) at (0,2) {};

You can find it in the section »Setting Keys« of chapter V (Utilities) in the pgfmanual (emphasis added):

\pgfkeys{ key list }
The key list should be a list of key–value pairs, separated by commas. A key–value pair can have the following two forms: key = value or just key . Any spaces around the key or around the value are removed. It is permissible to surround both the key or the value in curly braces, which are also removed. Especially putting the value in curly braces needs to be done quite often, namely whenever the value contains an equal-sign or a comma.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .