Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Possible Duplicate:
bordermatrix with blocks

I need to put a vertical line between two columns of a matrix in \bordermatrix. I know how to do it in the array environment, but \bordermatrix isn't the same. Does anyone know how?

share|improve this question
    
Welcome to TeX.sx! Usually, we don't put a greeting or a "thank you" in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Upvoting is the preferred way here to say "thank you" to users who helped you. –  Torbjørn T. Dec 14 '11 at 8:28
add comment

marked as duplicate by egreg, Werner, Joseph Wright Dec 19 '11 at 19:21

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2 Answers

\documentclass{article}
\def\VR{\kern-\arraycolsep\strut\vrule &\kern-\arraycolsep}
\def\vr{\kern-\arraycolsep & \kern-\arraycolsep}
\begin{document}

$\bordermatrix{
   & 0 & 1 & 2 \cr
 0 & A & B & C \cr
 1 & d & e & f \cr
 2 & 1 & 2 & 3 }$
%
$\bordermatrix{
   & 0 & \vr 1 & 2 \cr
 0 & A & \VR B & C \cr
 1 & d & \VR e & f \cr
 2 & 1 & \VR 2 & 3 }$

\end{document}​

enter image description here

share|improve this answer
add comment

You can use the package kbordermatrix. You need to install manually because this package is not in TL or CTAN. The documentation is inside the package.

enter image description here

Complete code

\documentclass[11pt]{scrartcl}
\usepackage{kbordermatrix}

\begin{document}
\kbordermatrix{\mbox{indices}&
1&2&\vrule&3&4\\
1&M_{1,1}&M_{1,2}&\vrule&M_{1,3}&M_{1,4}\\
2&M_{2,1}&M_{2,2}&\vrule&M_{2,3}&M_{2,4}
}
\end{document} 

enter image description here

share|improve this answer
add comment

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