0
\begin{equation*}
\centering
P = 
\begin{pmatrix}
p_{1,1} & p_{1,2} & \cdots & p_{1,10} \\
p_{2,1} & p_{2,2} & \cdots & p_{2,10} \\
\vdots  & \vdots  & \ddots & \vdots  \\
p_{10,1} & p_{10,2} & \cdots & p_{10,10} 
\end{pmatrix}
\end{equation*}

I'm trying to add labels for my row and columns as follows:

For the row, I want one single heading "Home Score", and then for individual rows, I want 0,1,........,9.

For columns, I want a heading "Away Score", and for individual columns, I want 0,1,........,9.

Is this possible with latex?

5

1 Answer 1

1

Like this, done with blockarray?

\documentclass{article}
\usepackage{amsmath}
\usepackage{blkarray}

\begin{document}

\begin{equation*}
P =
\begin{blockarray}{rcccc}
\text{Home} & \BAmulticolumn{4}{c}{\text{Away Score}}\\
\text{Score} & 0 & 1 & \dots & 9 \\
\begin{block}{r(cccc)}
0 & p_{1,1} & p_{1,2} & \cdots & p_{1,10} \\
1 & p_{2,1} & p_{2,2} & \cdots & p_{2,10} \\
\vdots & \vdots & \vdots & \ddots & \vdots \\
9 & p_{10,1} & p_{10,2} & \cdots & p_{10,10}\\[1ex]
\end{block}
\end{blockarray}
\end{equation*}

\end{document} 

enter image description here

2
  • Looks good, probably as good as I can get? would be nice to see home score label aligned with the rows though
    – P123
    Nov 13, 2021 at 14:45
  • @eoghanPerill: It is quite possible: delete \text{Home} in the first row and use \text{Home Score} at the beginning of the second row. I plit it in to rows because I thought the labels column looked didproportionately wide. However, one can also use small, or even \footnotesize for this label (preferably, the same size for Away Score).
    – Bernard
    Nov 13, 2021 at 15:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .