How to add labels to the columns and rows (such as a
, b
, c
, d
and the like) which go above and to the left (both outside) of the matrix, but are obviously aligned with said columns and rows?
An example matrix:
\[
\begin{pmatrix}
t & 1-t & -1 & 0 & 0 \\
0 & t & 1-t & -1 & 0 \\
0 & 0 & t & 1-t & -1 \\
-1 & 0 & 0 & t & 1-t \\
1-t & -1 & 0 & 0 & t
\end{pmatrix}
\]
You may want to try the kbordermatrix package. Its documentation can be found here (note that the package is not part of CTAN). It is more modern and advanced than good old bordermatrix. An example follows below:
\usepackage{kbordermatrix} % include package @ document preamble
\renewcommand{\kbldelim}{(} % change default array delimiters to parentheses
\renewcommand{\kbrdelim}{)}
% ...
\[
\kbordermatrix{
\mbox{corner_text}&\alpha & \beta & \gamma & \delta \\ % column indices
1 & t & 1-t & -1 & 0 & 0 \\
2 & 0 & t & 1-t & -1 & 0 \\
3 & 0 & 0 & t & 1-t & -1 \\
4 & -1 & 0 & 0 & t & 1-t \\
5 & 1-t & -1 & 0 & 0 & t
% 1, 2, 3, 4, 5 are row indices
}
\]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With