# What is the best way to stacked subscripts for a matrix?

I use this code to generate subscript indexes for a matrix but stacked thanks to substack:

\documentclass{standalone}
\usepackage[utf8]{inputenc}

\usepackage{amsmath}

\begin{document}

$(v_j^h)_{\substack{1\le h\le p-1\\1\le j\le n}}$

\end{document}


I wonder how could I do a better formatting, what would be the best way. A really better way is trivially to left aligned instead of center the stacked subscripts but I have no idea how to do that. Do you know how to do it, or even better, do you know if there is a better way to represent those kind of subscripts and how to implant it?

Do you mean subarray? Note that \substack{...} is defined as \begin{subarray}{c} ... \end{subarray}.

\documentclass{article}
\usepackage{amsmath}

\begin{document}

$(v_j^h)_{\begin{subarray}{l} 1\le h\le p-1 \\ 1\le j\le n\end{subarray}}$

\end{document}


You could use the starred version of smallmatrix, which comes with mathtools.

\documentclass{standalone}
\usepackage[utf8]{inputenc}

\usepackage{mathtools}

\begin{document}

$(v_j^h)_{\begin{smallmatrix*}[l]1\le h\le p-1\\1\le j\le n\end{smallmatrix*}}$

\end{document}


tabstackengine offers additional alignment and size possibilities.

\documentclass{article}
\usepackage{amsmath,tabstackengine}
\TABstackMath
\setstacktabulargap{0pt}
\TABbinary
\begin{document}
$(v_j^h)_{\begin{subarray}{l} 1\le h\le p-1 \\ 1\le j\le n\end{subarray}}$
$\setstackgap{L}{7pt} (v_j^h)_{\tabularLongstack{rcccl}{ 23&\le& h_i&\le& p-1 \\ 1&\le& j&\le& n}}$
$\setstackgap{L}{6pt} (v_j^h)_{\tabularLongstack{rcccl}{ 23&\le& h_i&\le& p-1 \\ 1&\le& j&\le& n}}$