0

I want to assign an equation number to the following matrix equation; I want a number in brackets on the right side, after the equation.

 \documentclass{article}
    \usepackage{rotating}
    \usepackage{kbordermatrix}
    \begin{document}
    \[ C = \raisebox{-2\baselineskip}{%
       \begin{tabular}[b]{c@{\hspace*{0.5em}}c}
       & To node
       \\
         \begin{sideways}
           From node
         \end{sideways}
       & \raisebox{0.5\height}%
           {\(\kbordermatrix
                { &  1  &   2 &  3  &  4  &  5  \\
                1 &  1  & x_1 & x_5 &  0  &  0 \\
                2 & x_1 &  1  & x_2 & x_3 & x_4 \\
                3 & x_5 & x_2 &  1  & x_6 &  0  \\
                4 &  0  & x_3 & x_6 &  1  & x_7 \\
                5 &  0  & x_4 &  0  & x_7 & 1
                }
            \)%
           }
       \end{tabular}}
    \]
    \end{document}

As shown in the picture. I tried several attempts but errors appear. enter image description here

  • 3
    Change \[...\] to \begin{equation}...\end{equation}. – Steven B. Segletes Nov 7 '17 at 17:42
2
\documentclass{article}
    \usepackage{rotating}
    \usepackage{kbordermatrix}
    \begin{document}
   % \[
    \begin{equation} % here
 C = \raisebox{-2\baselineskip}{%
       \begin{tabular}[b]{c@{\hspace*{0.5em}}c}
       & To node
       \\
         \begin{sideways}
           From node
         \end{sideways}
       & \raisebox{0.5\height}%
           {\(\kbordermatrix
                { &  1  &   2 &  3  &  4  &  5  \\
                1 &  1  & x_1 & x_5 &  0  &  0 \\
                2 & x_1 &  1  & x_2 & x_3 & x_4 \\
                3 & x_5 & x_2 &  1  & x_6 &  0  \\
                4 &  0  & x_3 & x_6 &  1  & x_7 \\
                5 &  0  & x_4 &  0  & x_7 & 1
                }
            \)%
           }
       \end{tabular}}
   % \]
    \end{equation}
    \end{document}

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.