question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to color elements of latex matrices

See original GitHub issue

Hi, I wonder how to set a color to individual elements in a matrix.

matrix2 = TexMobject(r"\begin{pmatrix} 4 \\ 3 \end{pmatrix}")

I would like to colour the number 4 in red. When I break down the TexMobject for the matrix into tuples in order to run matrix2[x].set_color(COLOR) I get an error. Can somebody explain to me how I can split a matrix in Tex format. Greatly appreciate it!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
zavdencommented, Jan 14, 2020

Try matrix2[0][1]

0reactions
zavdencommented, Jan 14, 2020

Don’t forget close the issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

color - Matrix change row or column background - TeX
You can use \rowcolor , \columncolor , and \cellcolor from the colortbl package, loaded in my example through the xcolor package:
Read more >
Shading entries in matrix - Google Groups
To highlight specific elements or rows or columns in a matrix, I would like to be able to shade them. Is this possible...
Read more >
Matrix element coloring/Highlighting - narkive
Is there a trick to play so to be able to color an element in a matrix or highlight it some how (something...
Read more >
LaTeX/Mathematics - Wikibooks, open books for an open world
Typesetting mathematics is one of LaTeX's greatest strengths. It is also a large topic due to the existence of so much mathematical notation....
Read more >
nicematrix.pdf - CTAN
The LaTeX package nicematrix provides new environments similar to the classical environ- ments {tabular}, {array} and {matrix} of array and amsmath but with ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found