Maths
Within PlantUML, you can use AsciiMath notation:
or JLaTeXMath notation:
@startuml
:\int_0^1f(x)dx ;
:x^2+y_1+z_{12}^{34} ;
note right
Try also
\dfrac{d}{dx}f(x)=\lim\limits_{h \to 0}\dfrac{f(x+h)-f(x)}{h}
P(y|\mathbf{x}) \mbox{ or } f(\mathbf{x})+\epsilon
end note
@enduml
Here is another example:
Standalone diagram
You can also use @startmath
/@endmath
to create standalone AsciiMath formula.
Or use @startlatex
/@endlatex
to create standalone JLaTeXMath formula.
How is this working?
To draw those formulas, PlantUML uses two open source projects:
-
AsciiMath that converts AsciiMath notation to LaTeX expression;
-
JLatexMath that displays mathematical formulas written in LaTeX. JLaTeXMath is the best Java library to display LaTeX code.
ASCIIMathTeXImg.js is small enough to be integrated into PlantUML standard distribution.
Since JLatexMath is bigger, you have to download it separately, then unzip the 4 jar files (batik-all-1.7.jar, jlatexmath-minimal-1.0.3.jar, jlm\_cyrillic.jar and jlm\_greek.jar) in the same folder as PlantUML.jar.