# How to write brackets in a matrix

I can't describe it, just i can't do it. Can you help me please. Note that there is an arrow showing the position "t". • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. I don't have an answer for you, but I have another suggestion: Are you sure that this is the best thing to do? Can't the problem be described in an easier way than with a 10-centimeter-high vector? – yo' Mar 24 '15 at 20:31
• i am writing a thesis and i need write it like this, Thank you! – Luis Felipe Mar 24 '15 at 20:34

## 3 Answers

For fun I tried to make what you specified with my limited knowledge. A short look on this wikibook chapter brought me a long way.

I am sure it can be done much more elegant, shorter, logical, etc, but this was as close I could get. I am not sure how to add the little bars in the right delimiter, I hope they are not mandatory. From your drawing it is also not clear to me if the middle parts should be smaller or in the same size. Perhaps it can serve you as a starting point.

\documentclass{article}

\usepackage{amsmath}
\usepackage{mathtools}

\begin{document}
$\begin{bmatrix} \begin{pmatrix} 0 \\ \vdots \\ 0 \end{pmatrix} \\ \vdots \\ \begin{pmatrix} 0 \\ \vdots \\ t \\ \vdots \\ 0 \end{pmatrix} \\ \vdots \\ \begin{pmatrix} 0 \\ \vdots \\ 0 \end{pmatrix} \\ \end{bmatrix} \begin{matrix*}[l] \left. \vphantom{\begin{pmatrix} 0 \\ \vdots \\ 0 \end{pmatrix} } \right\} 1\\ \vphantom{\vdots} \\ \left. \vphantom{\begin{pmatrix} 0 \\ \vdots \\ t \\ \vdots \\ 0 \end{pmatrix} } \right\} \ell \\ \vphantom{\vdots} \\ \left. \vphantom{\begin{pmatrix} 0 \\ \vdots \\ 0 \end{pmatrix} } \right\} N \end{matrix*}$
\end{document} Your notation is not only inconvenient for the reader but also wrong or ambiguous. I start reading from the top: it is a zero vector then ellipsis mean that it is repeated and I arrive to a nonzero vector. Weird but OK I continue; then next ellipsis mean that it is also repeated but then I arrive again another zero vector. I start from the middle a nonzero vector is repeated both sides but both ends up in zero vectors. Besides you didn't even manage to denote the individual vector sizes which would make this even more crowded.

When do exactly these vectors switch meanings? Before the ellipsis? Is it only the middle is different or only the end points are zero vectors.

Long story short ellipsis were used when there was no other way but to place these symbols manually hand written to typewritten documents. We are long beyond those times so please consider using ellipses sparingly and take advantage of LaTeX instead.

You can do all kinds of things drawing lines with TikZ or using size information such as $0_{1\times k}$ etc. but for such repeated patterns use Kronecker products. Otherwise you can search the site for all kinds of matrix embellishments asked before and use them but I doubt that they will ever be able to help in this case.

\documentclass{article}
\usepackage{mathtools}%<-- fixes enhances amsmath
\begin{document}
$M = \begin{pmatrix}0_{l-1}\\[1mm] 1\\0_{N-l}\end{pmatrix} \otimes \begin{pmatrix}0_{t-1}\\[1mm] 1\\0_{k-t}\end{pmatrix}$
\end{document}


I found helpfull the answer of Todd Davies in LaTeX help and I did this:

\documentclass{article}
\usepackage{amsmath}
\newcommand\MyLBrace{%
\left.\rule{0pt}{#1}\right\}\text{#2}}
\begin{document}
$$\begin{bmatrix} \left(\begin{smallmatrix}0\\ \vdots\\0\end{smallmatrix}\right)\\ \vdots\\ \left(\begin{smallmatrix}0\\ \vdots\\1\\ \vdots \\0\end{smallmatrix}\right) \!\!\!\!\!\! \begin{smallmatrix} \\ \\ \rightarrow t\\ \\ \end{smallmatrix}\\ \vdots\\ \left(\begin{smallmatrix}0\\ \vdots\\0\end{smallmatrix}\right)\\ \end{bmatrix}\!\!\!\!\!\! \begin{array}{l} \MyLBrace{3ex}{1} \\ \\ \\ \MyLBrace{5.5ex}{l} \\ \\ \\ \MyLBrace{3ex}{N} \end{array}$$
\end{document} And it works fine, Thanks to all

• Don't the (non-)alignment of the middle group and inconsistent vertical spacings bother you‽ – Paul Gessler Mar 24 '15 at 23:13
• oh yes, i solved it with \vspace* – Luis Felipe Mar 25 '15 at 2:56