# How to put more than one side braces for a vector

This code gives a single side brace for the vector (shown in black in image below).How can I modify this code to get two side braces (as shown in pink picture below) instead of single $${\bf x} = \left.\left( \begin{array}{c} x_1\\ \vdots\\ x_{n_1}\\ x_{n_1+1}\\ \vdots\\ x_n \end{array} \right) \right\}n$$

• – Werner Sep 27 '16 at 0:17

There may be easier ways, but here it is with stacks.

\documentclass{article}
\usepackage[usestackEOL]{stackengine}
\stackMath
\begin{document}
${\bf x} = \left( \begin{array}{c} x_1\\ \vdots\\ x_{n_1}\\ x_{n_1+1}\\ \vdots\\ x_n \end{array} \right) \setstackgap{L}{1.2\normalbaselineskip} \vcenter{\hbox{\stackunder[1pt]{% \left.{\Centerstack{\\ \\}}\right\}n_1% }{ \left.{\Centerstack{\\ \\}}\right\}n_2% }}}$
\end{document} If the braces need to be asymmetric:

\documentclass{article}
\usepackage[usestackEOL]{stackengine}
\stackMath
\begin{document}
${\bf x} = \left( \begin{array}{c} x_1\\[-6pt] \vdots\\[-6pt] x_{n_1}\\ x_{n_1+1}\\[6pt] \vdots\\[6pt] x_n \end{array} \right) \setstackgap{L}{1.2\normalbaselineskip} \vcenter{\hbox{\stackunder[2pt]{% \left.{\Centerstack{\\}}\right\}n_1% }{ \left.{\Centerstack{\\ \\ \\}}\right\}n_2% }}}$
\end{document} • +1 for Asymmetric braces. So good to have a general solution – NAASI Sep 27 '16 at 16:26

You can create this using a number of well-placed arrays and some \vphantoms: \documentclass{article}

\newcommand{\noleftdelimiter}{\left.\kern-\nulldelimiterspace}

\begin{document}

$\setlength{\arraycolsep}{0pt} \mathbf{x} = \noleftdelimiter \left( \begin{array}{c} \begin{array}{c} x_1 \\ \vdots \\ x_{n_1} \end{array} \\ \begin{array}{c} x_{n_1+1} \\ \vdots \\ x_n \end{array} \end{array} \right) \right\} n ~ % Some space \begin{array}{c} \noleftdelimiter \vphantom{\begin{array}{c} x_1 \\ \vdots \\ x_{n_1} \end{array}} \right\} n_1 \\ \noleftdelimiter \vphantom{\begin{array}{c} x_{n_1+1} \\ \vdots \\ x_n \end{array}} \right\} n_2 \end{array}$

\end{document}