# Row Curly Brackets

Could you help me please to write this on latex ?

• What have you tried so far? Maybe you should have a look at the \underbrace/\overbrace commands. – epR8GaYuh Jul 29 '17 at 11:55
• The problem is that I am dealing with arrays, not with normal text. I know how to use these comments in the normal text, but I don't know how to use these comments here. Many columns entries have the same underbrace. Thanks a lot. – Ahmed Jul 29 '17 at 12:18

A simple solution with the \mathclap command from mathtools, applied to a matrix environment nested in pmatrix. Also, note the correct \coloneqq instead of := (the latter has the colon not centred on the math axis).

\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{mathtools}

\begin{document}

$\mathbf{B}_j \coloneqq \begin{pmatrix} 0 & \dotsm & 0 & b^{-1} & 0 & 0 & 0 & \dotsm \\ & \mathclap{\underbrace{\begin{matrix}0 & \dotsm & 0\end{matrix}}_{\left\lceil\frac{d}{2}\right\rceil = \ell_2}} & & 0 & 0 & b^{-1} & 0 &\dotsm \\[-1ex] & & & & & & & \ddots \\[-1ex] & & & & & & & b^{-1} & \overbrace{\begin{matrix}0 & \dotsm & 0\end{matrix}}^{\left\lfloor\frac{d}{2}\right\rfloor = \ell_1} \end{pmatrix}$

\end{document}


you already have answer on similar question ... considering AboAmmar answer and epR8GaYuh comment above and your claim, that you are familiar with \underbrace should not be difficult to construct your wished matrix:

\documentclass[12pt]{article}
\usepackage{amsmath}
\begin{document}

\setlength{\arraycolsep}{1.5em}
$\setlength\arraycolsep{2pt} \left( \begin{array}{lcr} \underbrace{ \begin{array}{ccc} 0 & \dots & 0 \\ 0 & \dots & 0 \end{array}}_{\left\lceil\frac i2\right\rceil=\ell_1} \begin{array}{cccc} b^{-1} & 0 & 0 & 0 \\ 0 & 0 & b^{-1} & 0 \end{array} & & \\ & \ddots & \\ & & \overbrace{ \begin{array}{ccc} b^{-1} & \dots & 0 \end{array}}^{\left\lceil\frac i2\right\rceil=\ell_2} \end{array} \right)$
\end{document}


Some matrix nesting; we need array so we can use the [t] option.

\documentclass[11pt]{article}
\usepackage{mathtools}

\begin{document}

$\mathbf{B}_j \coloneqq \begin{pmatrix} \smash[b]{ \underbrace{ \begin{array}[t]{@{\,}ccc@{}} 0 & \dots & 0 \\ 0 & \dots & 0 \end{array} }_{\left\lceil\frac{d}{2}\right\rceil=\ell_2} } & \begin{array}[t]{@{}ccccccc@{\,}} b^{-1} & 0 & 0 & 0 & \dots \\ 0 & 0 & b^{-1} & 0 & \dots \\ & & & & \ddots \\ & & & & & b^{-1} & \smash[t]{ \overbrace{ \begin{matrix} 0 & \dots & 0 \end{matrix} }^{\left\lfloor\frac{d}{2}\right\rfloor = \ell_1} } \end{array} \end{pmatrix}$

\end{document}


With \smash the height of the material for \underbrace and \overbrace is ignored.

You can give a bit more air by adding some vertical space:

\documentclass[11pt]{article}
\usepackage{mathtools}

\begin{document}

$\mathbf{B}_j \coloneqq \begin{pmatrix} \smash[b]{ \underbrace{ \begin{array}[t]{@{\,}ccc@{}} 0 & \dots & 0 \\ 0 & \dots & 0 \end{array} }_{\left\lceil\frac{d}{2}\right\rceil=\ell_2} } & \begin{array}[t]{@{}ccccccc@{\,}} b^{-1} & 0 & 0 & 0 & \dots \\ 0 & 0 & b^{-1} & 0 & \dots \\[1ex] & & & & \ddots \\[1ex] & & & & & b^{-1} & \smash[t]{ \overbrace{ \begin{matrix} 0 & \dots & 0 \end{matrix} }^{\left\lfloor\frac{d}{2}\right\rfloor = \ell_1} } \end{array} \end{pmatrix}$

\end{document}