Can you use LaTeX within mermaid diagrams?

I was trying a simple diagram:

```
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
```

which renders nicely in Obsidian as:

However when I try to insert an equation:

```
graph TD;
A-->$f(x)$;
A-->C;
B-->D;
C-->D;
```

it fails with a parsing error:

Error parsing Mermaid diagram!

Parse error on line 2:

…ph TD; A–>$f(x)$; A–>C; B-

----------------------^

Expecting ‘SEMI’, ‘NEWLINE’, ‘SPACE’, ‘EOF’, ‘STYLE_SEPARATOR’, ‘START_LINK’, ‘LINK’, got ‘PUNCTUATION’