HOME      NEWS      MAP

Introduction

You can use AsciiMath notation within PlantUML:
@startuml
:<math>int_0^1f(x)dx</math>;
:<math>x^2+y_1+z_12^34</math>;
note right
Try also
<math>d/dxf(x)=lim_(h->0)(f(x+h)-f(x))/h</math>
end note
@enduml
AsciiMath on activity diagram
Or:
@startuml
Bob -> Alice : Can you solve: <math>ax^2+bx+c=0</math>
Alice --> Bob: <math>x = (-b+-sqrt(b^2-4ac))/(2a)</math>
@enduml
AsciiMath on sequence diagram

Standalone diagram

You can also use @startmath/@endmath to create standalone AsciiMath formula.
@startmath
f(t)=(a_0)/2 + sum_(n=1)^ooa_ncos((npit)/L)+sum_(n=1)^oo b_n\ sin((npit)/L)
@endmath
standalone math formula

How is this working ?

To draw those formulas, PlantUML uses two OpenSource projects: 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.

HOME      NEWS      MAP