Skip to content

Commit

Permalink
Fix merge
Browse files Browse the repository at this point in the history
  • Loading branch information
JelteF committed Jul 23, 2024
1 parent 0875e40 commit 6eb087a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pylatex/math.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ def __init__(self, matrix, *, mtype="p", alignment=None, replace_zeros=False):
self.latex_name = mtype + "matrix"
self._mtype = mtype
if alignment is not None:
self.latex_name += "*"
self._replace_zeros = replace_zeros

super().__init__(arguments=alignment)
Expand All @@ -147,8 +148,10 @@ def dumps_content(self):

for (y, x), value in np.ndenumerate(self.matrix):
if x:
string += '&'
string += str(value) if not (value == 0 and self._replace_zeros) else '\cdot'
string += "&"
string += (
str(value) if not (value == 0 and self._replace_zeros) else "\cdot"
)

if x == shape[1] - 1 and y != shape[0] - 1:
string += r"\\" + "%\n"
Expand Down

0 comments on commit 6eb087a

Please sign in to comment.