Forgot password
 Register account
View 3614|Reply 2

请教矩阵里能不能把相同的元素都标上同一颜色?

[Copy link]

414

Threads

1641

Posts

15

Reputation

Show all posts

abababa posted 2020-12-16 20:19 |Read mode
如题。有些矩阵元素是有规律的,比如一个斜线上全是2,然后与这斜线垂直的一处也是2之类的。打完矩阵后,能不能简单地把这些相同的元素都标上同一种颜色?如果不用查找-替换的方法,在latex里有没有什么功能可以做到这个?因为查找-替换后,代码里的矩阵也显得很乱了。我希望的功能像这样:
\colormatrix{red}{1,2;2,3;3,4;3,1;}
就是用坐标点来定位元素,用分号来隔开坐标点这样。

3200

Threads

7827

Posts

52

Reputation

Show all posts

hbghlyj posted 2025-5-18 12:59

673

Threads

110K

Posts

218

Reputation

Show all posts

kuing posted 2025-5-18 15:11
优化一下楼上代码

Quick Reply

Advanced Mode
B Color Image Link Quote Code Smilies
You have to log in before you can reply Login | Register account

$\LaTeX$ formula tutorial

Mobile version

2025-7-15 15:26 GMT+8

Powered by Discuz!

Processed in 0.035220 seconds, 22 queries