Skip to content

Commit

Permalink
fixing formatting in fractions and square roots
Browse files Browse the repository at this point in the history
  • Loading branch information
mmatera committed Nov 9, 2024
1 parent 1cd0bc8 commit baa276e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mathics/format/pane_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def fraction(a: Union[TextBlock, str], b: Union[TextBlock, str]) -> TextBlock:
a = TextBlock(a)
if isinstance(b, str):
b = TextBlock(b)
width = max(b.width, a.width) + 2

This comment has been minimized.

Copy link
@rocky

rocky Nov 9, 2024

Member

Please, instead of hacking original code like this which will ultimately get ripped out, look into how SymPy does this and use that. Thanks.

width = max(b.width, a.width)
frac_bar = TextBlock(width * "-")
result = frac_bar.stack(a)
result = b.stack(result)
Expand Down Expand Up @@ -416,7 +416,7 @@ def sqrt_block(
"\n".join("|" + line for line in a.text.split("\n")), base=a.base
)
result_2 = result_2.stack((a.width + 1) * "_", align="l")
half_height = int(a_height / 2)
half_height = int(a_height / 2 + 1)

result_1 = TextBlock(
"\n".join(
Expand Down

0 comments on commit baa276e

Please sign in to comment.