In an attempt to improve PlantUML documentation...
Wiki Toc Recent changes View page history Add new chapter Reorder page Raw
![]() |
![]() |
|
MathsYou can use AsciiMath or JLaTeXMath notation within PlantUML:
or:
|
|
Standalone diagramYou 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:
new ScriptEngineManager().getEngineByName("JavaScript"); ) to load a JavaScript engine and execute JavaScript code. Java 8 includes a JavaScript engine called Nashorn but it was deprecated in Java 11.
If you are using AsciiMath in Java 11 you see the following warnings:
Warning: Nashorn engine is planned to be removed from a future JDK release
Nashorn was removed in Java 15.
Fortunately, you can use the GraalVM JavaScript Engine instead by adding the following dependencies:
You can even use the GraalVM JavaScript Engine in Java 11 to get rid of the warning messages. 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. |