[Tex/LaTex] Right justify columns in border matrix

bordermatrix

I would like to right justify the columns in a border matrix. Is this possible? Default seems to be centre

 \documentclass{article} 
 \begin{document}

    $
     \bordermatrix{~ & 5 & 6\cr
                  5 & 1 & 0 \cr
                  6 & 0 & -1 \cr}
    $
 \end{document}

Best Answer

I don't know if it is possible with bordermatrix, but it is with kbordermatrix by issuing

\kbalignrighttrue

The following lines are to simulate the behavior of bordermatrix

\renewcommand{\kbldelim}{(}
\renewcommand{\kbrdelim}{)}
\renewcommand{\kbrowstyle}{\displaystyle}
\renewcommand{\kbcolstyle}{\displaystyle}

MWE:

\documentclass{article}

\usepackage{kbordermatrix}
\kbalignrighttrue
\renewcommand{\kbldelim}{(}
\renewcommand{\kbrdelim}{)}
\renewcommand{\kbrowstyle}{\displaystyle}
\renewcommand{\kbcolstyle}{\displaystyle}

\begin{document}

    $
     \kbordermatrix{~ & 5 & 6\cr
                  5 & 1 & 0 \cr
                  6 & 0 & -1 \cr}
    $

\end{document} 

Output

enter image description here