5

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

enter image description here

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

6

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.

enter image description here

\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}
| improve this answer | |
4

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}

enter image description here

| improve this answer | |
  • thank you very much! – ioleg19029700 Jun 1 at 19:42
  • 1
    +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
  • 1
    @Schrödinger'scat, I wouldn't too, I actually started my answer based on Werner's ^^ – BambOo Jun 1 at 20:07
3

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} 

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.