I have a matrix and need to highlight some elements in the matrix. I have found how to highlight a single element (I want to put the cell in the square):
$$ A = \begin{bmatrix}
\fbox{0} & \fbox{0} & 0 \\
\fbox{0} & \fbox{0} & 0 \\
1 & 1 & 1 \\
\end{bmatrix}$$
But how can I outline elements of the submatrix like in the picture below? I need just a frame where some elements are located.
Best Answer
You could use TikZ, and
fit
library for creating nodes fitting the desired area,overlay
andremember picture
, so you can later refer to those nodes, for example for drawing arrows and annotations later.To demonstrate why it's useful to have nodes for reference, I created an example, which shows transposing a matrix, highlights a submatrix both in the original matrix and the result, connected by an arrow and annotated: