Skip to content

Commit af7bf8e

Browse files
author
Matthias Koeppe
committed
src/sage/geometry/polyhedron/representation.py (repr_pretty): Handle prefix
1 parent 8aece91 commit af7bf8e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/sage/geometry/polyhedron/representation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1670,7 +1670,7 @@ def repr_pretty(coefficients, type, prefix='x', indices=None,
16701670
- ``type`` -- either ``0`` (``PolyhedronRepresentation.INEQUALITY``)
16711671
or ``1`` (``PolyhedronRepresentation.EQUATION``)
16721672
1673-
- ``prefix`` -- a string
1673+
- ``prefix`` -- a string (default: ``x``)
16741674
16751675
- ``indices`` -- a tuple or other iterable
16761676
@@ -1705,9 +1705,9 @@ def repr_pretty(coefficients, type, prefix='x', indices=None,
17051705
indices = range(len(coeffs)-1)
17061706
vars = [1]
17071707
if latex:
1708-
vars += ['x_{{{}}}'.format(i) for i in indices]
1708+
vars += [f'{prefix}_{{{i}}}' for i in indices]
17091709
else:
1710-
vars += ['x{}'.format(i) for i in indices]
1710+
vars += [f'{prefix}{i}' for i in indices]
17111711
if type == PolyhedronRepresentation.EQUATION:
17121712
rel = '=' if latex else '=='
17131713
elif type == PolyhedronRepresentation.INEQUALITY:

0 commit comments

Comments
 (0)