1

I am trying to write a set definition like the picture below in latex:

enter image description here

How can I make such a clean set definition?

5
  • 1
    Welcome to TSE. What did you try? Feb 3, 2022 at 22:56
  • @JoséCarlosSantos I tried to make the set definition with & and \\, but it was quiet deviating from the clean picture I provided above... I guess there should be kind of template to make such set definition... Feb 3, 2022 at 23:05
  • Can you post the minimal code for what you tried? That would give us something to start from.
    – Teepeemm
    Feb 3, 2022 at 23:20
  • 1
    you should show a small complete document with the code you tried, don't make pope testing answers have to type it all in from an image. Also people can then tell you what is wrong with the code Feb 3, 2022 at 23:20
  • This was my first time using latex stack exchange, so I did not know how things usually works here... I will definitely have those in my mind for the next time. Thanks all. Feb 4, 2022 at 0:19

1 Answer 1

3

You want \left\{...\middle|...\right\}; with alignedat you can set the conditions.

However, you also want to simplify your input to avoid errors.

\documentclass{article}
\usepackage{amsmath,amssymb,bm}

\newcommand{\bE}{\mathbb{E}}
\newcommand{\bF}{\mathbb{F}}
\newcommand{\bQ}{\mathbb{Q}}
\newcommand{\bR}{\mathbb{R}}
\newcommand{\cP}{\mathcal{P}}
\newcommand{\cZ}{\mathcal{Z}}
\newcommand{\vv}[1]{\ifcat#1\relax\bm{#1}\else\mathbf{#1}\fi}
\newcommand{\barvv}[1]{\bar{\vv{#1}}}

\begin{document}

\[
\bar{\bF}=
\left\{
  \bQ \in \cP_{0}(\bR^{M}\times\bR^{I})
\;\middle|\;
\begin{alignedat}{2}
  & (\barvv{z},\barvv{v})\sim\bQ \\
  & \bE_{\bQ}(\barvv{z} \mid \bar{\vv{v}}\in\Omega_{l})=\vv{\mu}_{l},{}
    && \forall l \in [L] \\
  & \bE_{\bQ}((\bar{z}_{jl}-\mu_{jl})^{2} \mid \barvv{v}\in\Omega_{l})\le\sigma_{jl}^2,{}
    && \forall l \in [L], j \in [M] \\
  & \bQ(\barvv{v}\in\Omega_{l})=p_l,{}
    && \forall l \in [L] \\
  & \bQ(\barvv{z}\in\cZ_{l} \mid \barvv{v}\in\Omega_{l})=1,
    && \forall l \in [L]
\end{alignedat}
\right\}
\]

\end{document}

enter image description here

However, your readers will be happier if you do in the following way:

\documentclass{article}
\usepackage{amsmath,amssymb,bm}

\newcommand{\bE}{\mathbb{E}}
\newcommand{\bF}{\mathbb{F}}
\newcommand{\bQ}{\mathbb{Q}}
\newcommand{\bR}{\mathbb{R}}
\newcommand{\cP}{\mathcal{P}}
\newcommand{\cZ}{\mathcal{Z}}
\newcommand{\vv}[1]{\ifcat#1\relax\bm{#1}\else\mathbf{#1}\fi}
\newcommand{\barvv}[1]{\bar{\vv{#1}}}

\begin{document}

Let $\bar{\bF}$ be the set of all snarfs $\bQ \in \cP_{0}(\bR^{M}\times\bR^{I})$
such that
\begin{alignat*}{2}
  & (\barvv{z},\barvv{v})\sim\bQ \\
  & \bE_{\bQ}(\barvv{z} \mid \bar{\vv{v}}\in\Omega_{l})=\vv{\mu}_{l},{}
    &\quad& \forall l \in [L] \\
  & \bE_{\bQ}((\bar{z}_{jl}-\mu_{jl})^{2} \mid \barvv{v}\in\Omega_{l})\le\sigma_{jl}^2,{}
    &\quad& \forall l \in [L], j \in [M] \\
  & \bQ(\barvv{v}\in\Omega_{l})=p_l,{}
    &\quad& \forall l \in [L] \\
  & \bQ(\barvv{z}\in\cZ_{l} \mid \barvv{v}\in\Omega_{l})=1,
    &\quad& \forall l \in [L]
\end{alignat*}

\end{document}

Replace snarfs with the appropriate name. ;-)

enter image description here

1
  • Thanks a lot. Did not know about alignedat...! Feb 4, 2022 at 0:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .