how to add a letter above a matrix in latex

Viewed 197

I am trying to write this in latex (using overleaf): enter image description here

I wrote this code:

$\Theta = i\begin{bmatrix}
                 & \vdots & \\
                 \cdots &  \cdot &  \cdots\\
                 & \vdots & \\
                \end{bmatrix}$

enter image description here

I can't manage to write the j outside the matrix. how can I do that?

1 Answers

You can use the nicematrix package:

\documentclass{article}

\usepackage{mathtools}
\usepackage{nicematrix}

\begin{document}


$\Theta = \begin{bNiceArray}[first-row,first-col]{ccc}
                 & & j & \\
                 & & \vdots & \\
                 i &\cdots &  \cdot &  \cdots\\
                 & & \vdots & \\
                \end{bNiceArray}$


\end{document}
Related