I have asked this question in chat. How can I add the explanation borders to the below matrix?
\begin{align*}
C_{D_{1\succ 2}, \mathrm{increasing}} &= \underbrace{\begin{pmatrix} 1 & -1 & 1 & -1 & 1 & -1 & 1 & -1 \\ \end{pmatrix}}_{1\times 8\text{ matrix}} \\
A_{D_{1\succ 2}, \mathrm{increasing}} &=
\underbrace{\begin{pmatrix}
1 & 0 & 1 & 0 & 1 & 0 & 1 & 0 \\
0 & 1 & 0 & 1 & 0 & 1 & 0 & 1 \\
1 & 1 & 0 & 0 & 1 & 1 & 0 & 0 \\
0 & 0 & 1 & 1 & 0 & 0 & 1 & 1 \\
1 & 1 & 1 & 1 & 0 & 0 & 0 & 0 \\
1 & 1 & 1 & 1 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 1 & 1 & 1 & 1 \\
\end{pmatrix}}_{7\times 8 \text{ matrix}}.
\end{align*}
I want this kind of $p_1, p_2, …$ borders to the matrix above. I have been able to add them with blockarray and block here but now I need to add them to the existing pmatrix data-structure. How can I get it with the pmatrix?
Best Answer
You can use the
kbordermatrix
package which is for some reason not CTAN but you can download it from http://www.hss.caltech.edu/~kcb/LaTeX.shtml and there is a short documentation there too. Just save the.sty
file to the same folder with your actual document.