PlantUML supports math via AsciiMath and Latex (via JLaTeXMath). The comparison presents a view of a legacy approach to generating diagrams into LaTeX versus rendering diagrams with LaTeX.
(Here's a similar project for rendering PlantUML into LaTeX: )
For rendering math in PlantUML see this area.
Go here to see the recent changes and evolution.
I created an example to test:
@startuml
skinparam componentStyle rectangle
skinparam defaultTextAlignment center
skinparam defaultFontSize 14
skinparam defaultFontName Arial
skinparam component {
borderColor DarkBlue
backgroundColor MOTIVATION
}
[plankton] -r-> [formula \n\n\n <latex>\lim_{h \rightarrow 0 } \frac{f(x+h)-f(x)}{h}</latex> \n]: <latex>\dfrac{d}{dx}f(x)=\lim\limits_{h \to 0}\dfrac{f(x+h)-f(x)}{h}</latex>
@enduml
Paste the above at the following links to see it render:
I came across D2 as I am starting a new project and evaluating the latest in text to diagrams prior to selection of the rest of my tooling. In doing a feature/capability comparison, I found the above.
Of note in my comparison, I didn't find a functional way to add/render LaTeX to labels for connection in D2. I provided that as part of this example.