Including special character and subcript properly in DiagrammeR

36 Views Asked by At

suppose I want to include

in a flowchart using DiagrammeR. However,

DiagrammeR::grViz("
  digraph test {
    node[shape = rectangle]
    node1 [label = <u<sub>T</sub>: &mu;<sub>T</sub> &le;>]
    node2 [label = B]

    node1 -> node2
  }
")

enter image description here

cause large gap between mu and its subscript T. The issue seems to have been raised in github years ago.

On the other hand,

DiagrammeR::mermaid("
      graph LR; 
      A[u<sub>T</sub>: &mu;<sub>T</sub> ]--> B")
DiagrammeR::mermaid("
      graph LR; 
      A[u<sub>T</sub>: &mu;<sub>T</sub> &le;]--> B")

cause special character ≤ %le; to break the plot. enter image description here enter image description here

Is there an alternative solution? Thank you.

0

There are 0 best solutions below