Equal (=) sign within TikZ label
As already pointed out by Jake, the =
is detected by TikZ that parses the options based on ,
and =
.
This works:
\node[label=below:{$\mathcal{L}^*(B)=\mathcal{L}(D)$}]
As well as that:
\node[label={below:$\mathcal{L}^*(B)=\mathcal{L}(D)$}]
If you want to include a :
in the label but do not specify a direction (here: below
), then you will need to protect the colon, too:
\tikzset{label position=below}
\node[label=here's{:} a colon]
The same bracing is needed if you use ,
(in a label
and elsewhere), for example:
\tikzset{nodes={draw, fill, font=\tiny}}
Defining a macro \equal
as
\newcommand*{\equal}{=}
hides the =
from the parser, too, but may not be the favorite way to input formulas.
\node[label=below:$\mathcal{L}^*(B)\equal\mathcal{L}(D)$]
At least the spacing is correct as opposed to that work-around of \text{$=$}
where the braces { }
from \text
hides =
from the parser as well. Note that $L{=}L$
still produces wrong spacing and isn’t an option here.