# LaTeX file for matrix

I'm trying to typeset the matrix depicted in the diagram, I've considered many examples, and in particular easybmat. But nothing came closer than the approach I settled on given below. However it does not quite produce the accuracy I wanted. Is there a way to make the diagram closer to the required picture?

This is my code:

\documentclass{article}
\usepackage{amsmath}
\usepackage{multirow}
\usepackage{easybmat}

\begin{document}

$\sbox0{\begin{array}{c |}a_1\\ \hline\end{array}} \sbox1{\begin{array}{c c |}b_1&b_2\\ \hline\end{array}} \sbox2{\begin{array}{c c c |}c_1& \ c_2&c_3\\ \hline\end{array}} \sbox3{\begin{array}{c c c c |}...&...&... &...\\ \hline\end{array}} \sbox4{\begin{array}{c c c c c |}...&...&...&...&...\\ \hline\end{array}} \sbox5{\begin{array}{c c c c c c |}\alpha_n &\beta_n&\gamma_n&\epsilon_n&\delta_n& ...............\\ \hline\end{array}} % A=\left( \begin{array}{c c c c c c c } \usebox{0} \ a_2 \ \ \ a_3 \ \ a_4 \ a_5 \ ... \ ... \ ... \ ... \ ... \ a_n\\ \usebox{1} \ b_3 \ \ b_4 \ b_5 \ ... \ ... \ ... \ ... \ ... \ b_n\\ \usebox{2} \ c_4 \ c_5 \ ... \ ... \ ... \ ... \ ..\ c_n\\ \usebox{3} \ ... \ ... \ ... \ ... \ ... \ ... \ ... \\ \usebox{4} \ ... \ ... \ ... \ ... \ ... \\ \usebox{5} \\ \end{array} \right)$

\end{document}

• Possible duplicate of Latex typesetting – Henri Menke Jun 24 '17 at 5:39
• Welcome to TeX SX! Just a question aside: shouldn't P_n be P_{n-1} really? – Bernard Jun 24 '17 at 9:20

You could also use a tikz matrix:

\documentclass{article}
\usepackage{amsmath,tikz}
\usetikzlibrary{matrix, positioning}

\begin{document}
A=\begin{tikzpicture}[baseline=-.8ex] \matrix[% matrix of math nodes, nodes in empty cells, column 6/.style={nodes={text width=1.2em}}, nodes={minimum height=4ex, text width=1.5em, align=center, inner sep=4pt}, left delimiter={(},right delimiter={)}, inner xsep=-1pt, column sep=0pt, ] (m) {% a_1 & a_2 & a_3 & a_4 & \dots &[2pt] a_n \\ b_1 & b_2 & b_3 & b_4 & \dots & b_n \\ c_1 & c_2 & c_3 & c_4 & \dots & c_n \\ \dots & \dots & \dots & \dots & \dots & \dots \\ \alpha_{n} &\beta_{n}&\gamma_{n}&\delta_{n}& \dots & \mu_{n} \\ }; \foreach \n in {1,...,3}{% \draw [->] (m-\n-1.south west) -- (m-\n-\n.south east) -- (m-1-\n.north east) node[above]{P_{\n}}; } \draw [->] (m-4-1.south west) -- (m-4-5.south east) -- (m-1-5.north east) node[above]{P_{n}}; \end{tikzpicture}
\end{document}


You can use the tikzmark library to mark the points at line joints and later draw these lines using normal tikz paths

\documentclass{article}
\usepackage{amsmath,tikz}
\usetikzlibrary{tikzmark}

\begin{document}

$A=\left( \begin{array}{*7c} \tikzmark{11}\,a_2\,\tikzmark{12} & a_3 & a_4 & a_5 & \dots & \dots& a_n\\ \tikzmark{21}\,b_3 & \,b_4\,\tikzmark{22} & b_5 & \dots& \dots& \dots& b_n\\ \tikzmark{31}\,c_4 & c_5 & \dots\tikzmark{32}& \dots& \dots& \dots& c_n\\ \tikzmark{41}\dots& \dots& \dots& \dots\tikzmark{42}& \dots& \dots& \dots\\ \tikzmark{51}\dots& \dots& \dots& \dots& \dots\tikzmark{52}& \dots& \dots \\ \end{array} \right)$

\begin{tikzpicture}[remember picture, overlay]
\foreach \n in {1,...,5}
\draw [->] ([yshift=-3pt]pic cs:\n1) -- ([yshift=-3pt]pic cs:\n2) --++(0,\n\baselineskip)node[above]{$p_\n$};
\end{tikzpicture}

\end{document}