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.

M S
  • 1,552
  • 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 ( ) 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
  • @SibaMishra --- sorry, I thought the picture was a screenshot of the output that you didn't like. – Ian Thompson Oct 27 '15 at 17:00
  • Welcome to TeX.SX! On this site, a question should typically revolve around an abstract issue (e.g. "How do I get a double horizontal line in a table?") rather than a concrete application (e.g. "How do I make this table?"). Questions that look like "Please do this complicated thing for me" tend to get closed because they are either "off topic", "too broad", or "unclear". Please try to make your question clear and simple by giving a minimal working example (MWE): you'll stand a greater chance of getting help. – Martin Schröder Oct 27 '15 at 23:35

3 Answers3

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

Gonzalo Medina
  • 505,128
  • I would add a @{} at the beginning of the blocks, and increase the value of \arraystretch. – Bernard Oct 27 '15 at 15:28
  • 1
    @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 05 '17 at 08: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
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

Francis
  • 6,183
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

F. Pantigny
  • 40,250