Skip to content

Commit

Permalink
Update stringpict.py
Browse files Browse the repository at this point in the history
  • Loading branch information
mmatera authored Nov 11, 2024
1 parent 4020b8f commit c389a3d
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions sympy/printing/pretty/stringpict.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,27 @@ def chunks(line):
# Add spacers between sub-pictures
return "\n\n".join(pictures)


def subindex(self, index):
"""
Add a `sub index`.
"""
with_self = self.width()
width_index = index.width()
extended_self = self.right(width_subindex*stringPict(" "))
index = index.left(width_self*stringPict(" "))
return extended_self.bellow(index)

def superindex(self, index):
"""
Add a `super index`.
"""
with_self = self.width()
width_index = index.width()
extended_self = self.right(width_subindex*stringPict(" "))
index = index.left(width_self*stringPict(" "))
return extended_self.above(index)

def terminal_width(self):
"""Return the terminal width if possible, otherwise return 0.
"""
Expand Down

0 comments on commit c389a3d

Please sign in to comment.