| 1 | initial version |
If you're using an interface that supports LaTeX output, such as a Jupyter notebook:
sage: show(["1", LatexExpr(r"{\color{red} 2}"), "3"])
$$\displaystyle \left[1, {\color{red} 2}, 3\right]$$
To automate it, you could do e.g.
sage: show([LatexExpr(r"{\color{red} " + x + "}") if x == "2" else x for x in L])
or
sage: show([LatexExpr(r"{\color{red} " + x + "}") if k == 1 else x for k, x in enumerate(L)])
| 2 | No.2 Revision |
If you're using an interface that supports LaTeX output, such as a Jupyter notebook:
sage: show(["1", LatexExpr(r"{\color{red} 2}"), "3"])
$$\displaystyle \left[1, {\color{red} 2}, 3\right]$$
To automate it, you could do e.g.
sage: show([LatexExpr(r"{\color{red} " + x latex(x) + "}") if x == "2" else x for x in L])
or
sage: show([LatexExpr(r"{\color{red} " + x latex(x) + "}") if k == 1 else x for k, x in enumerate(L)])
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.