How can we write the following statement with the matrix form in the LaTeX ? (We wish to represent it in the matrix form)

By $\delta_{ij}(a)$  we mean a n by n matrices 
in $M_n(\mathbb{R})$ which has only one nonzero 
entry $a$ at $i$, th row and j th column.

2 Answers 2


If I understand well, is it something like this you want?

\usepackage{blkarray, bigstrut}


    & & \makebox[0pt]{column $j$} \\[-0.5ex]
    & & \,\downarrow \\[-0.5ex]
    & \makebox[3.1em]{\Large $0$\bigstrut[t]} & \vdots &\makebox[4.2em]{\Large $0$} \\[-0.2ex]
    \text{row }i \to \mkern-9mu & \raisebox{0.5ex}{\makebox[3.2em][l]{\dotfill}} & 1 & \raisebox{0.5ex}{\makebox[4.2em][r]{\dotfill}} \\[-1ex]
    & \makebox[3.1em]{\Large $0$} & \vdots &\makebox[4.2em]{\bigstrut\Large $0$} \\


enter image description here


With {NiceMatrix} of the package nicematrix.




                  &        & \clap{column $j$}   \\
                  &        & \downarrow          \\[1mm]
                  & \zero  & \Vdots     & \zero  \\
\text{row } i \to & \Cdots & 1          & \Cdots \\
                  & \zero  & \Vdots     & \zero 


You need several compilations (because nicematrix uses PGF/Tikz nodes under the hood).

Output of the above code

  • Thank you very much for your answer May 4, 2021 at 15:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.