How to put 2 left curly braces horizontally as in the same row?

I tried to put 2 left curly braces horizontally, each of which defines a variable. However, we I get is one on top of the other. This may leave too much empty space. So is there any way to put the second group on the right to the first one? Thanks.

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\begin{equation*}
y_{i}^{s}  =
\begin{cases}
(y_{i1}, \ldots, y_{iT-|s|}), \; s>0 \\
(y_{i1+|s|}, \ldots, y_{iT}), \; s<0, \\
\end{cases}
\end{equation*}

\begin{equation*}
x_{i}^{1s}  =
\begin{cases}
(x_{i1}, \ldots, x_{iT-|s|}), \; s>0 \\
(x_{i1+|s|}, \ldots, x_{iT}), \; s<0, \\
\end{cases}
\end{equation*}

\end{document}


Is this what you want?

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\begin{equation*}
y_{i}^{s}  =
\begin{cases}
(y_{i1}, \ldots, y_{iT-|s|}), \; s>0 \\
(y_{i1+|s|}, \ldots, y_{iT}), \; s<0, \\
\end{cases}
x_{i}^{1s}  =
\begin{cases}
(x_{i1}, \ldots, x_{iT-|s|}), \; s>0 \\
(x_{i1+|s|}, \ldots, x_{iT}), \; s<0, \\
\end{cases}
\end{equation*}

\end{document}


• Wow, I did not expect the solution is so simple. I tried something close to your proposal before, but may have left a line of empty space between the two "cases", so it did not work out. So it works fine by just deleting the space. Cool! – Jie Wei Sep 10 '15 at 4:03
• it's better to use ampersands instead of adjusting the spacing manually. Further, omit the last \ in each cases environment, – JPi Sep 10 '15 at 4:07
• It would also be a good idea to separate the cases by inserting either \quad or \qquad after the first \end{cases} statement. – Mico Sep 10 '15 at 4:08

Like this?

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\begin{gather} \notag
y_{i}^{s}  =
\begin{cases}
(y_{i1}, \ldots, y_{iT-|s|}), & s>0, \\
(y_{i1+|s|}, \ldots, y_{iT}), & s<0, \\
\end{cases}
x_{i}^{1s}  =
\begin{cases}
(x_{i1}, \ldots, x_{iT-|s|}), & s>0, \\
(x_{i1+|s|}, \ldots, x_{iT}), & s<0. \\
\end{cases}
\end{gather}

\end{document}


• Since there's only one "row" to the equation, why use a multi-row environment such as gather instead of equation*? – Mico Sep 10 '15 at 3:52
• I recall reading that there was some downside to equation under some circumstances. Don't recall the details. – JPi Sep 10 '15 at 3:57

You could encase the two equation* environments in minipage environments of width 0.5\textwidth. Note the use of the % (comment) symbols in three places to assure that no stray spaces creep in. If you decide you wanted numbered instead of unnumbered equations (still side-by-side), you could replace the two equation* environments with equation environments.

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\begin{minipage}{0.5\textwidth}%
\begin{equation*}
y_{i}^{s}  =
\begin{cases}
(y_{i1}, \ldots, y_{iT-|s|}), &  s>0 \\
(y_{i1+|s|}, \ldots, y_{iT}), &  s<0 \\
\end{cases}
\end{equation*}
\end{minipage}%
\begin{minipage}{0.5\textwidth}%
\begin{equation*}
x_{i}^{1s}  =
\begin{cases}
(x_{i1}, \ldots, x_{iT-|s|}), &  s>0 \\
(x_{i1+|s|}, \ldots, x_{iT}), &  s<0 \\
\end{cases}
\end{equation*}
\end{minipage}
\end{document}