6

enter image description here

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.

Thank You in Advance.

7
  • Could you include a picture showing what placement you want? Commented Oct 27, 2015 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
    Commented Oct 27, 2015 at 14:31
  • @IanThompson. I am completely bewildered - how to use both equation and matrix.
    – M S
    Commented Oct 27, 2015 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. Commented Oct 27, 2015 at 14:36
  • @barbarabeeton Madam. Exactly, you are right. Its the border matrix. Thanking You.
    – M S
    Commented Oct 27, 2015 at 14:45

3 Answers 3

14

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}

enter image description here

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}

enter image description here

4
  • I would add a @{} at the beginning of the blocks, and increase the value of \arraystretch.
    – Bernard
    Commented Oct 27, 2015 at 15:28
  • 1
    @Bernard Answer updated incorporating your suggestions. Thanks. Commented Oct 28, 2015 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
    Commented Jan 5, 2017 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
    Commented Jan 10, 2017 at 10:19
4

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}

enter image description here

1

With {NiceArray} of nicematrix.

\documentclass{article}
\usepackage{nicematrix}

\begin{document}

\[
\renewcommand\arraystretch{1.5}
ETC_{ij}= 
\begin{NiceArray}{c\left\lbrace cccc}[first-row,baseline=line-3]
    & V_{1} & V_{2} & \cdots & V_{m} \\
    T_{11} & ETC_{11,1} & ETC_{11,2} & \cdots & ETC_{11,m} \\
    T_{12} & ETC_{12,1} & ETC_{12,2} & \cdots & ETC_{12,m} \\
    \vdots & \vdots & \vdots & \vdots & \vdots \\
    T_{1p1} & ETC_{1p1,1} & ETC_{1p1,2} & \cdots & ETC_{1p1,m} \\
\end{NiceArray}
\]

\end{document}

Output of the above code

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .