Is the latex equation supported?

0 votes
asked Dec 11, 2016 in Wanted features by cnglen (140 points)

Is the latex equation supported?  rather than ascii math?

 

@startuml
$\sum_{i=0}^{n-1} (a_i + b_i^2)$;
@enduml
 

 

1 Answer

+1 vote
answered Dec 12, 2016 by plantuml (132,110 points)

It was not.

But not very difficult to add.
So in last beta https://dl.dropboxusercontent.com/u/13064071/plantuml.jar

You can have:

@startuml
:<math>int_0^1f(x)dx</math>;
:<latex>\sum_{i=0}^{n-1} (a_i + b_i^2)</latex>;
@enduml


Note that you have to install JLatexMath as explain at http://plantuml.com/ascii-math
This has not been very tested, so feeback welcome!

commented Dec 13, 2016 by cnglen (140 points)
Thanks.
1. When setting larger dpi, for example:  skinparam dpi 200, the equation in png is ambiguous
2. The background color of equation can't be set independently.

#+BEGIN_SRC plantuml :file ../image/machine_learning_theory_frame.png
  left to right direction
  skinparam dpi 200
  skinparam componentStyle uml2
  [<latex>P(y|\mathbf{x}) \mbox{ or } f(\mathbf{x})+\epsilon</latex>] as fx
  [<latex>\mathcal{D}</latex>] as D
  [<latex>\mathcal{H}</latex>] as H
  [<latex>\mathcal{g}</latex>] as g
  [<latex>P(\mathbf{x})</latex>] as Px
  (<latex>\mathcal{A}</latex>) as A
  Px --> D
  fx --> D
  D --> A
  H --> A
  A --> g
  g .-> fx: <latex>\mbox{Loss}(f,g)</latex>
#+END_SRC
commented Dec 13, 2016 by plantuml (132,110 points)
Ok, thanks.
With last beta https://dl.dropboxusercontent.com/u/13064071/plantuml.jar
You can have:
@startuml
left to right direction
skinparam dpi 192
skinparam componentStyle uml2
[<back:gray><latex>P(y|\mathbf{x}) \mbox{ or } f(\mathbf{x})+\epsilon</latex></back>] as fx
[<color:blue><latex>\mathcal{D}</latex></color>] as D
[<latex>\mathcal{H}</latex>] as H
[<latex>\mathcal{g}</latex>] as g
[<latex>P(\mathbf{x})</latex>] as Px
(<latex>\mathcal{A}</latex>) as A
Px --> D
fx --> D
D --> A
H --> A
A --> g
g .-> fx: <latex>\mbox{Loss}(f,g)</latex>
@enduml
...