# How to place single comma after two equations so it's placed between two strings

I'm sorry for my English, please let me know how I should have formulated my question properly. So I have the code

    \begin{align*}
f(x) &= \sin(x) & x \in[0, 1] \\
g(x) &= \cos(x)
\end{align*}


and it gives the following result

I want this "x \in [0, 1]" part to be placed between these two strings with comma preceding it, something like this

You can use aligned to generate an align-like block, and then place the conditions after it. I don't particularly like the placement of ,, so suggest that you remove it since it makes sense without it. Alternatively one can use an rcases environment (from mathtools), perhaps.

\documentclass{article}

\usepackage{mathtools}

\begin{document}

\begin{aligned} f(x) &= \sin(x) \\ g(x) &= \cos(x) \end{aligned}, \qquad x \in [0, 1]

$\begin{rcases} f(x) = \sin(x) \\ g(x) = \cos(x) \end{rcases} \quad x \in [0, 1]$

\end{document}


Another possibility using the empheq package

\documentclass{article}

\usepackage{empheq}

\begin{document}

\begin{empheq}[right={\empheqrbrace, \qquad x \in [0, 1]}]{align*}
f(x) &= \sin(x) \\
g(x) &= \cos(x)
\end{empheq}

\begin{empheq}[right={, \qquad x \in [0, 1]}]{align*}
f(x) &= \sin(x) \\
g(x) &= \cos(x)
\end{empheq}

\end{document}


• thank you very much! – ioleg19029700 Jun 1 at 19:42
• +1 for mentioning empheq but I would not put a comma there. It looks very lonely and unhappy, and can be mistaken for a prime. – user194703 Jun 1 at 20:05
• @Schrödinger'scat, I wouldn't too, I actually started my answer based on Werner's ^^ – BambOo Jun 1 at 20:07

A last solution with the \ArrowBetweenLines command from mathtools:

\documentclass{article}
\usepackage{mathtools}

\begin{document}

\begin{alignat*}{2}
f(x) &= \sin(x) & & \\
\ArrowBetweenLines*[,\enspace \forall x\in {[0,1]}]
g(x) &= \cos(x) & &
\end{alignat*}

\end{document}