0

Possible Duplicate:
Highlight elements in the matrix

I have a big matrix as follows:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

    \[
\tilde{M}_{R+1,N}=
  \begin{pmatrix}
  r_{1,(1)}^{(1)},r_{1,(2)}^{(1)} \cdots, r_{1,(n)}^{(1)}, r_{2,(1)}^{(1)}, r_{2,(2)}^{(1)}, \cdots, r_{2,(n)}^{(1)}, \cdots, r_{m,(1)}^{(1)}, r_{m,(2)}^{(1)}, \cdots, r_{m,(n)}^{(1)}\\
  r_{1,(1)}^{(2)},r_{1,(2)}^{(2)} \cdots, r_{1,(n)}^{(2)}, r_{2,(1)}^{(2)}, r_{2,(2)}^{(2)}, \cdots, r_{2,(n)}^{(2)}, \cdots, r_{m,(1)}^{(2)}, r_{m,(2)}^{(2)}, \cdots, r_{m,(n)}^{(2)}\\
  \vdots \\
  r_{1,(1)}^{(R)},r_{1,(2)}^{(R)} \cdots, r_{1,(n)}^{(R)}, r_{2,(1)}^{(R)}, r_{2,(2)}^{(R)}, \cdots, r_{2,(n)}^{(R)}, \cdots, r_{m,(1)}^{(R)}, r_{m,(2)}^{(R)}, \cdots, r_{m,(n)}^{(R)} \\
  r_{1,(1)}^{(0)},r_{1,(2)}^{(0)} \cdots, r_{1,(n)}^{(0)}, r_{2,(1)}^{(0)}, r_{2,(2)}^{(0)}, \cdots, r_{2,(n)}^{(0)}, \cdots, r_{m,(1)}^{(0)}, r_{m,(2)}^{(0)}, \cdots, r_{m,(n)}^{(0)}
  \end{pmatrix}
\]

\end{document}

Resulting in:

image

Now I want to draw several boxes on this big matrix. The first box contains elements from the first n columns and all rows; the second box contains elements from the next n columns and all rows, and so on. When I use \boxed command, it can only take characters that are 'together'.

How can I make such boxes in the math environment that contain "non-together" characters?

  • 3
    Typically tikz is used for this. See for example http://tex.stackexchange.com/questions/40028/highlight-elements-in-the-matrix or http://tex.stackexchange.com/questions/69726/tikz-marking-several-blocks-in-a-matrix – JLDiaz Jan 06 '13 at 00:32
  • 3
    Not an answer: You probably want to use & instead of a , to get a real (multi-columned) matrix instead of a vector (a single-columned matrix). – Qrrbrbirlbel Jan 06 '13 at 00:35
  • Please let us know if the links provided by @JLDiaz resolve the issue- if so we might close this as a duplicate :) If it is different, please provide details :) – cmhughes Jan 06 '13 at 00:57
  • @cmhughes: yes, I think the question is solved. Please close the post. Thank you! – alittleboy Jan 06 '13 at 01:39

0 Answers0