Ask Your Question

Revision history [back]

Use Python string formatting.

There are three flavours of that.

Using %:

r"A_1 = %s" % A_1

Using format:

r"A_1 = {}".format(A_1)

Using f-strings:

fr"A_1 = {A_1}"

Use any of these inside show(LatexExpr(...)).

Use Python string formatting.

There are three flavours of that.

Using %:

r"A_1 r"A = %s" % A_1
B

Using format:

r"A_1 r"A = {}".format(A_1)
{}".format(B)

Using f-strings:

fr"A_1 fr"A = {A_1}"
{B}"

Use any of these inside Not sure exactly how to combine with show(LatexExpr(...)).

Possibly show(LatexExpr(fr"A_1 = {latex(A_1)}") gives something useful?

Use Python string formatting.

There are three flavours of that.

Using %:

r"A = %s" % B

Using format:

r"A = {}".format(B)

Using f-strings:

fr"A = {B}"

Not sure exactly how to combine with show(LatexExpr(...)).

Possibly show(LatexExpr(fr"A_1 = {latex(A_1)}") gives something useful?

See it in action on SageCell:

Use Python string formatting.

There are three flavours of that.

Using %:

r"A = %s" % B

Using format:

r"A = {}".format(B)

Using f-strings:

fr"A = {B}"

Not sure exactly how to Now combine with show(LatexExpr(...)).:

Possibly

show(LatexExpr(fr"A_1 = {latex(A_1)}"){latex(A_1)}")
 gives something useful?

See it in action on SageCell: