4

I would like to create a matrix with round brackets as displayed on the following picture:enter image description here

I know how to create the following matrix as

\documentclass{article}
\usepackage{amsmath}
\usepackage{stackengine}
\usepackage{mathdots}

\begin{document}

\begin{bmatrix}
a & \hdots & \hdots & c & 0 & \hdots & 0 \\ 
\vdots &  & \iddots & \iddots &  & \iddots  & \\ 
\vdots &  \iddots &  0&  & 0 &  & \\ 
b &\iddots&  & \iddots &  &  & \\ 
0 &   & 0 &  &  &  & \\ 
\vdots & \iddots &  &  &  &  & \\ 
0 &  &  &  &  &  & 
\end{bmatrix}

\end{document}

But I do not know how to create those brackets with those labels. Any help would be much appriciated.

4 Answers 4

4

Without guessing too much (the only value I guessed is 0.9ex)

\documentclass{article}
\usepackage{amsmath}
\usepackage{mathdots}

\begin{document}

\[
% some preliminaries with local settings
\newcommand{\upperbrace}{%
  \overbrace{\hphantom{\begin{matrix} a & \hdots & \hdots & c \end{matrix}}}%^{k}
}%
\newcommand{\rightbrace}{%
  {\scriptstyle k+1}\,\left\{%
  \vphantom{\begin{matrix} a \\ \vdots \\ \vdots \\ b \end{matrix}}%
  \right.\kern-\nulldelimiterspace
}
% now the real job
\raisebox{\dimexpr-\height-0.9ex}{$\rightbrace$}
\begin{array}[t]{@{}l@{}}
\hphantom{\Bigg\lbrack}\upperbrace^k\hfill\\[-0.5ex]
\begin{bmatrix}
a & \hdots & \hdots & c & 0 & \hdots & 0 \\ 
\vdots &  & \iddots & \iddots &  & \iddots  & \\ 
\vdots &  \iddots &  0&  & 0 &  & \\ 
b &\iddots&  & \iddots &  &  & \\ 
0 &   & 0 &  &  &  & \\ 
\vdots & \iddots &  &  &  &  & \\ 
0 &  &  &  &  &  & 
\end{bmatrix}
\end{array}
\]

\end{document}

enter image description here

1
  • Thank you very much for your nice reply!! I was going through your code to understand it better and I was thinking if it possible for example to move the upperbrace, as a whole, to the left? Commented May 17, 2021 at 13:44
3

This is a bit of a kludge and it will require fussing with the lengths.

\documentclass[12pt]{article}

% List of packages
\usepackage{amsmath}
\usepackage{amssymb}

\usepackage{mathdots}

\begin{document}

\begin{align*}
&\phantom{0}\overbrace{\phantom{\hspace{6.5em}}}^{\displaystyle k}\\
\raisebox{2.3em}{$k+2 \left\{ \rule[3.5em]{0pt}{0pt} \right.$}
&\begin{bmatrix}
  a & \hdots & \hdots & c & 0 & \hdots & 0 \\ 
  \vdots &  & \iddots & \iddots &  & \iddots  & \\ 
  \vdots &  \iddots &  0&  & 0 &  & \\ 
  b &\iddots&  & \iddots &  &  & \\ 
  0 &   & 0 &  &  &  & \\ 
  \vdots & \iddots &  &  &  &  & \\ 
  0 &  &  &  &  &  & 
\end{bmatrix}
\end{align*}

\end{document}

enter image description here

2

A propose this solution with pstricks:

\documentclass{article}
\usepackage{mathtools}
\usepackage{blkarray}
\usepackage{stackengine}
\usepackage{mathdots}
\usepackage{pstricks-add}

\begin{document}

\[
\begin{bmatrix}
\pnode[-1ex, 1ex]{A}\rnode[tl]{a}{a} & \hdots & \hdots & \rnode[tr]{C}{c} & 0 & \hdots & 0 \\
\vdots & & \iddots & \iddots & & \iddots & \\
\vdots & \iddots & 0& & 0 & & \\
\pnode[-1ex, 0]{B}\rnode[bl]{b}{b} &\iddots& & \iddots & & & \\
0 & & 0 & & & & \\
\vdots & \iddots & & & & & \\
0 & & & & & &
\end{bmatrix}
\psset{braceWidth=0.6pt, braceWidthInner=4pt, braceWidthOuter=4pt;, nodesepB=-3pt, linejoin=1}
\psbrace[ref=C](C)(a){\simeq}
\psbrace[nodesepA=-2pt, nodesepB=3pt](A)(B){\mathllap{k+1}}
\]

\end{document} 

enter image description here

4
  • Hi, there is a \simeq instead of k in your code. Commented May 14, 2021 at 20:11
  • 1
    Hi, Sebastiano! Actually what was above the top brace was not very easy to read. I hesitated between a rotated \simeq and the number 12. That doesn't change the way to obtain something above that brace anyway Commented May 14, 2021 at 20:28
  • Ah, I have understood. :-)....Effectly it is a strange k that you have taken for \simeq. Commented May 14, 2021 at 20:30
  • 1
    I was not totally convinced it was a \simeq, but it was comparatively close what I was seeing… Commented May 14, 2021 at 20:35
0

Here is what you can do with nicematrix (≥ 6.4 of 2021-11-23):

\documentclass{article}
\usepackage{nicematrix}
\usepackage{tikz}

\begin{document}

$\begin{bNiceMatrix}[first-col]
\Block{4-1}{k\hspace*{3mm}}
& a      & \Ldots  &         & c       & 0 & \Ldots  & 0 \\
& \Vdots &         & \Iddots & \Iddots &   & \Iddots \\
&        &         & 0       &         & 0 \\
& b      & \Iddots &         & \Iddots \\
& 0      &         & 0 \\
& \Vdots & \Iddots \\
& 0 
\CodeAfter
  \SubMatrix{\{}{1-1}{4-1}{.}[xshift=1mm]
  \OverBrace{1-1}{1-4}{k}[shorten,yshift=1mm]
\end{bNiceMatrix}$

\end{document}

You need several compilations (because nicematrix uses PGF/Tikz nodes under the hood).

Output of the above code

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.