# Breaking lines of array matrix

I have a line of matrix arrays such as the next figure

Below the code of that matrix.

\begin{figure}
$P=\left(\left\{\begin{array}{l} p^{(1)}(x_1,x_2,\cdots,x_{r_1}) \\ \vdots\\ p^{(m_1)}(x_1,x_2,\cdots,x_{r_1}) \end{array} \right.%%%%%%%%%%%%% \left\{\begin{array}{l} p^{(m_1+1)}(x_1,x_2,\cdots,x_{r_1}, x_{r_1+1},x_{r_1+2},\cdots,x_{r_2}) \\ \vdots\\ p^{(m_1+m_2)}(x_1,x_2,\cdots,x_{r_1}, x_{r_1+1},x_{r_1+2},\cdots,x_{r_2}) \end{array} \right.%%%%%%%%%%%% \right).$
\end{figure}


Could you help me to break each system such that the new figure approximately will be in this way (with the braces):

• I don't see the exact relation between what you have and what you want (e.g. $p^{m+1+m_2}$ becomes $p{m_2}$). – Bernard Apr 23 '16 at 15:14
• a mechanism for achieving output of this configuration is given in How do I left-align entries in a matrix with \begin{matrix}? – barbara beeton Apr 23 '16 at 15:31
• @Bernard I have edited my question – juaninf Apr 23 '16 at 15:31
• You could use the cases environment and hope they line up, or you can overlay the braces using \smash and \vphantom. – John Kormylo Apr 23 '16 at 16:19
• Your edit doesn't explain if you want $p^{(m_1+m_2)}$ or $p^{m2}$\$. Both systems of notation are not consistent. How would it end up? – Bernard Apr 23 '16 at 16:25

You need to nest array or matrix.

\documentclass{article}
\usepackage{mathtools}

\begin{document}
\begin{figure}[h]
\centering
$P = \left(\begin{array}{l} \left\{\begin{array}{l} p^{(1)}(x_1,x_2,\cdots,x_{r_1}) \\ \vdots \\ p^{(m_1)}(x_1,x_2,\cdots,x_{r_1}) \end{array}\right. \\ \left\{\begin{array}{l} p^{(m_1+1)}(x_1,x_2,\cdots,x_{r_1}, x_{r_1+1},x_{r_1+2},\cdots,x_{r_2}) \\ \vdots\\ p^{(m_1+m_2)}(x_1,x_2,\cdots,x_{r_1}, x_{r_1+1},x_{r_1+2},\cdots,x_{r_2}) \end{array}\right. \end{array}\right)$
\caption{nested arrays}
\end{figure}

\begin{figure}[h]
\centering
$P = \begin{pmatrix*}[l] \left\{\begin{array}{l} p^{(1)}(x_1,x_2,\cdots,x_{r_1}) \\ \vdots \\ p^{(m_1)}(x_1,x_2,\cdots,x_{r_1}) \end{array}\right. \\ \left\{\begin{array}{l} p^{(m_1+1)}(x_1,x_2,\cdots,x_{r_1}, x_{r_1+1},x_{r_1+2},\cdots,x_{r_2}) \\ \vdots\\ p^{(m_1+m_2)}(x_1,x_2,\cdots,x_{r_1}, x_{r_1+1},x_{r_1+2},\cdots,x_{r_2}) \end{array}\right. \end{pmatrix*}$
\caption{Arrays nested in matrix}
\end{figure}
\end{document}


Using the dcases environment inside a pmatrix:

\documentclass{article}
\usepackage{mathtools}
\usepackage{eqparbox}

\begin{document}

$P = \begin{pmatrix*}[l] \begin{dcases} \eqmakebox[V][l]{ p^{(1)}(x_1,x_2,\dots,x_{r_1}) } \\ \eqmakebox[V]{ \vdots } \\ \eqmakebox[V][l]{ p^{(m_1)}(x_1,x_2,\dots,x_{r_1}) } \end{dcases} \\ \begin{dcases} p^{(m_1+1)}(x_1,x_2,\dots,x_{r_1}, x_{r_1+1},x_{r_1+2},\dots,x_{r_2}) \\ \eqmakebox[V]{ \vdots } \\ p^{(m_1+m_2)}(x_1,x_2,\dots,x_{r_1}, x_{r_1+1},x_{r_1+2},\dots,x_{r_2}) \end{dcases}\\[-0.8ex] \hskip1em \vdots \\[-1.54ex] \hskip1em \vdots \\ \begin{dcases} p^{(\sum_{i=1}^{\ell-1} m_i+1)}(x_1,x_2,\dots,x_{r_1}, \dots \dots, x_{r_{\ell-1}}, x_{r_{\ell-1}+1},\dots,x_{r_\ell }) \\ \eqmakebox[V]{ \vdots } \\ p^{(\sum_{i=1}^{\ell-1} m_i+m_\ell )}(x_1,x_2,\dots,x_{r_1}, \dots \dots, x_{r_{\ell-1}}, x_{r_{\ell-1}+1},\dots,x_{r_\ell }) \end{dcases} \end{pmatrix*}$

\end{document}