2

I'm needing to create a matrix enclosed with brackets [], not parentheses (), with row labels on right side. Is this possible using \kbordermatrix?

For instance, in the following:

\kbordermatrix{\mbox{}& C_1 & C_2& C_3\\
R_1&1&2&7\\
R_2&2&1&8
}

I would like the labels R_1 and R_2 to be on the right side of the matrix not the left.

  • 1
    Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – user31729 Jul 25 '14 at 7:41
1
% arara: pdflatex

\documentclass{article}
\usepackage{blkarray}
\newcommand{\mLabel}[1]{\mbox{$\scriptstyle{#1}$}}

\begin{document}
\[
\begin{blockarray}{c@{}ccc@{\hspace{4pt}}cl}
    & \mLabel{C_1} & \mLabel{C_2} & \mLabel{C_3} & & \\
    \begin{block}{[c@{\hspace{5pt}}ccc@{\hspace{5pt}}c]l}
      & 1 & 2 & 7 & & \mLabel{R_1} \\
      & 2 & 1 & 8 & & \mLabel{R_2} \\
    \end{block}
  \end{blockarray}
\]
\end{document}

enter image description here

1

If you need it only for the 2x3 matrix:

\documentclass{article}
\usepackage{array}
\let\SC\scriptstyle
\def\Biggg#1{\makebox(0,0){\put(0,-20){\bigg#1}}}
\begin{document}
$ \begin{array}{r@{\kern5pt}ccc@{}l>{\SC}l} 
        & \SC C_1 &\SC C_2 &\SC C_3\\
\Biggg[ & 1       & 2      & 7      & \Biggg] & R_1 \\
        & 2       & 1      & 8      &         & R_2
\end{array} $

\end{document}

enter image description here

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.