# How to represent the following math equation (border matrix) in Latex?

I am frustrated in setting the above attached picture to my manuscript. All things are feasible by using the \begin{cases} or matrices environment. The placing of T1, T2, ... , Tn and V1, V2, ..., Vn in the respective columns and rows are quite disgusting. Please Help through suggesting how to represent the following.

Furthermore, is there exist anyway to place a big left brace, bigger than even the size of \Biggl. I have tried all combinations, but fail to produce the desire output.

• Could you include a picture showing what placement you want? – Ian Thompson Oct 27 '15 at 14:27
• The picture has been included in the question itself. I just want the all the things specified in the question itself, to be represented in a single column document @Ian. – M S Oct 27 '15 at 14:31
• @IanThompson. I am completely bewildered - how to use both equation and matrix. – M S Oct 27 '15 at 14:32
• this is a common variation of a bordermatrix. there are quite a few questions and answers here on that topic, although i couldn't find an exact match to cite. the example in this one [\bordermatrix with brackets [ ] instead of parentheses ( )](tex.stackexchange.com/q/55054/579) shows most of the same features along with guidance on how to change the delimiters. – barbara beeton Oct 27 '15 at 14:36
• @barbarabeeton Madam. Exactly, you are right. Its the border matrix. Thanking You. – M S Oct 27 '15 at 14:45

One option using blkarray:

\documentclass{article}
\usepackage{blkarray}
\usepackage{amsmath}

\begin{document}

$ETC_{ij}= \begin{blockarray}{ccccc} & V_{1} & V_{2} & \cdots & V_{m} \\ \begin{block}{c\{cccc} T_{1} & ETC_{11} & ETC_{12} & \cdots & ETC_{1m} \\ T_{2} & ETC_{21} & ETC_{22} & \cdots & ETC_{2m} \\ \vdots & \vdots & \vdots & \vdots & \vdots \\ T_{n} & ETC_{n1} & ETC_{n2} & \cdots & ETC_{nm} \\ \end{block} \end{blockarray}$

\end{document}


As Bernard mentions in his comment, suppressing some horizontal spacing with @{} at the beginning of the blocks, and increasing the value of \arraystretch improves the result:

\documentclass{article}
\usepackage{blkarray}
\usepackage{amsmath}

\begin{document}

$\renewcommand\arraystretch{1.3} ETC_{ij}= \begin{blockarray}{ccccc} & V_{1} & V_{2} & \cdots & V_{m} \\ \begin{block}{@{}c\{cccc} T_{1} & ETC_{11} & ETC_{12} & \cdots & ETC_{1m} \\ T_{2} & ETC_{21} & ETC_{22} & \cdots & ETC_{2m} \\ \vdots & \vdots & \vdots & \vdots & \vdots \\ T_{n} & ETC_{n1} & ETC_{n2} & \cdots & ETC_{nm} \\ \end{block} \end{blockarray}$

\end{document}


• I would add a @{} at the beginning of the blocks, and increase the value of \arraystretch. – Bernard Oct 27 '15 at 15:28
• @Bernard Answer updated incorporating your suggestions. Thanks. – Gonzalo Medina Oct 28 '15 at 14:10
• @GonzaloMedina. How to add \Biggl'' or \{ (case type structure) in the first column in the above mentioned matrix? Like, suppose i need a brace to cover T1 and T2 or V1 and V2 only, to write something. How to incorporate that? I have tried by using \smash{\raisebox{2pt}{$\Biggl\{$}} option, but it fails. – M S Jan 5 '17 at 8:45
• @GonzaloMedina. Please help. Is there exist anyway to put a big left brace, bigger than \Biggl. I have tried but fail to produce the desire output. – M S Jan 10 '17 at 10:19

Quote from The TEXbook:

Sometimes a matrix is bordered at the top and left by formulas that give labels to the rows and columns. Plain TEX provides a special macro called \bordermatrix for this situation.

Definition of \bordermatrix can be found on page 361 of The TEXbook or in latex.ltx. A little tweak should suffice:

\documentclass{article}
\usepackage{mathtools}

\makeatletter

\def\cbordermatrix#1{\begingroup \m@th
\@tempdima 8.75\p@
\setbox\z@\vbox{%
\def\cr{\crcr\noalign{\kern2\p@\global\let\cr\endline}}%
\ialign{\hfil$##$\hfil\kern2\p@\kern\@tempdima&\thinspace\hfil$##$\hfil
&&\quad\hfil$##$\hfil\crcr
\omit\strut\hfil\crcr\noalign{\kern-\baselineskip}%
#1\crcr\omit\strut\cr}}%
\setbox\tw@\vbox{\unvcopy\z@\global\setbox\@ne\lastbox}%
\setbox\tw@\hbox{\unhbox\@ne\unskip\global\setbox\@ne\lastbox}%
\setbox\tw@\hbox{$\kern\wd\@ne\kern-\@tempdima\left\{\kern-\wd\@ne \global\setbox\@ne\vbox{\box\@ne\kern2\p@}% \vcenter{\kern-\ht\@ne\unvbox\z@\kern-\baselineskip}\,\right.$}%
\null\;\vbox{\kern\ht\@ne\box\tw@}\endgroup}

\makeatother

\begin{document}

$ETC_{ij}=\cbordermatrix{ & V_{1} & V_{2} & \cdots & V_{m} \cr T_{1} & ETC_{11} & ETC_{12} & \cdots & ETC_{1m} \cr T_{2} & ETC_{21} & ETC_{22} & \cdots & ETC_{2m} \cr \vdots & \vdots & \vdots & \vdots & \vdots \cr T_{n} & ETC_{n1} & ETC_{n2} & \cdots & ETC_{nm} \cr}$

\end{document}