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?

  • 1
    Welcome to TSE. What did you try? – José Carlos Santos Feb 03 '22 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... – Applicable Math Feb 03 '22 at 23:05
  • Can you post the minimal code for what you tried? That would give us something to start from. – Teepeemm Feb 03 '22 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 – David Carlisle Feb 03 '22 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. – Applicable Math Feb 04 '22 at 00:19

1 Answers1

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

egreg
  • 1,121,712