9

I was wondering what the proper LaTeX code would be to display something like this:

enter image description here

You don't have to include the mathematical symbols, what is important is the structure.

egreg
  • 1,121,712
index
  • 193

3 Answers3

11

You can set the multi-row contents using an array:

enter image description here

\documentclass{article}

\usepackage{braket}

\begin{document}

\[
  A = \left\{ b\ \middle\vert \begin{array}{l}
    C, d \\
    e, F, g
  \end{array}\right\}
\]

% Using braket; see http://tex.stackexchange.com/q/32051/5764
\[
  A = \Set{ b\ | \begin{array}{l}
    C, d \\
    e, F, g
  \end{array}}
\]

\end{document}
Werner
  • 603,163
  • What do you reckon is the difference between the two, except for the fact that the second approach requires the "braket" package? The second one also looks like it has a bit wider space around the middle line. – index Sep 12 '16 at 10:44
  • How do you obtain the high resolution images above? – gernot Sep 12 '16 at 12:27
  • @index: That's about it. It's always best to define some macro when you're doing something regularly, for consistency. That's why braket would be a good idea. – Werner Sep 12 '16 at 13:45
  • 1
    @gernot: I view the output in a PDF viewer where I can then zoom in (if needed). Then I take a screen grab of the portion of interest and copy-and-paste that as an image upload. Not sure how you go about with your lower-resolution image uploads. – Werner Sep 12 '16 at 13:46
  • Taking a screenshot works also in my case, great idea! – gernot Sep 12 '16 at 20:00
4

You should define a unique structure for this kind of objects and I propose a variant of the \Set command described in the documentation of mathtools.

\documentclass{article}
\usepackage{mathtools,bm}

\providecommand\given{} % ensure it exists
\newcommand\givensymbol[1]{%
  \nonscript\;\delimsize#1\allowbreak\nonscript\;\mathopen{}%
}
\DeclarePairedDelimiterX\Set[1]\{\}{%
  \renewcommand\given{\givensymbol{\vert}}%
  #1%
}

\begin{document}
\begin{gather*}
\Set{x\given y} \\
\Set[\big]{x\given (a+b)c} \\
\Set*{z \given
  \begin{aligned}
  & 1\le z_{(k,m)}^{l}\le 1+a_{(k,m)}^{l}\gamma_{(k,m)}^{l}(\bm{p}) \\
  & \forall k\in\mathcal{K}, \forall m\in\mathcal{M},
    \forall l\in\mathcal{L}, \forall\bm{a}\in\mathcal{A}^{\dagger},
    \forall \bm{p}\in\mathcal{P}
  \end{aligned}
}
\end{gather*}
\end{document}

enter image description here

egreg
  • 1,121,712
  • So this uses "aligned" rather than "array"? Are there any consequental differences between your approach and the other ones described above? – index Sep 14 '16 at 12:53
  • @index This approach is independent on what you put right of the bar. You can add anything, small or big: just set suitably the optional argument to \Set (\big, \Big, \bigg or \Bigg) or use * for automatic sizing if necessary. – egreg Sep 14 '16 at 13:38
3

For example:

\documentclass{article}

\usepackage{amsmath}
\begin{document}

\[
\mathcal{Z}=\left\{
z \biggm| \begin{array}{l}
1\leq\\
\forall k
\end{array}
\right\}
\]

\end{document}

enter image description here

Please observe, that there should be \biggm|, not simply \bigg|, giving the proper space. (Observe \middle\vert, not \vert, in Werner's answer).