Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions src/draw_tree/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
import distinctipy
from typing import TYPE_CHECKING

from numpy import save

if TYPE_CHECKING:
import pygambit

Expand Down Expand Up @@ -1299,7 +1297,16 @@ def level(
# Add edge color to action label
if edge_color_style:
s += "," + edge_color_style
s += "] {$" + mov + "$\\strut};"

mov_display = mov
if "$" not in mov_display:
mov_display = re.sub(
r"(\\frac\s*\{[^}]*\}\s*\{[^}]*\})", r"$\1$", mov_display
)
mov_display = re.sub(r"(_[a-zA-Z0-9]+|_{[^}]+})", r"$\1$", mov_display)
mov_display = re.sub(r"(\^[a-zA-Z0-9]+|\^{[^}]+})", r"$\1$", mov_display)

s += "] {\\textsf{\\textit{" + mov_display + "}}\\strut};"
outs(s)
# output arrows
while arrowposlist:
Expand Down
Loading