4

With the TeX code

\begin{equation}
  \max\left\{ \sum_{i=1}^{n}|\langle x^{(i)},b\rangle|^2\;\mid\vbox{
  \hbox{Condition 1}
  \hbox{Condition 2}
  \hbox{Condition 3}
}\right\}
\end{equation}

I get the output

output of code sample

How can I achieve the following two things?

  1. The separator produced by \mid shall have the same height as the curly brackets.
  2. The three conditions shall be centered vertically.
Werner
  • 603,163
phinz
  • 289

2 Answers2

4

Use \middle\vert to draw a full-height vertical bar. Use an array environment to hold the conditions -- I assume the conditions will be mostly math-mode material.

enter image description here

\documentclass{article} 
\usepackage{amsmath} % for "\text" macro
\begin{document}
\begin{equation}
  \max
  \left\{ 
  \sum_{i=1}^{n}|\langle x^{(i)},b\rangle|^2
  \;\middle\vert\;
  \begin{array}{@{}l@{}}
  \text{Condition 1}\\
  \text{Condition 2}\\
  \text{Condition 3}
  \end{array}
  \right\}
\end{equation}
\end{document}
Mico
  • 506,678
  • This is also a perfect answer. Can \middle be also applied to different things than \vert to stretch them? – phinz Dec 06 '16 at 19:41
  • 2
    @phinz: \middle can be applied to any stretchable "fence" symbol, not just \vert. Give \Vert a try, say. – Mico Dec 06 '16 at 19:44
2

You can use a tabular instead of the \vbox:

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\begin{equation}
  \max\left\{ \sum_{i=1}^{n}|\langle x^{(i)},b\rangle|^2\;
    \begin{tabular}{|l}
      Condition 1 \\
      Condition 2 \\
      Condition 3
\end{tabular}
\right\}
\end{equation}
\end{document}

enter image description here

phinz
  • 289
Torbjørn T.
  • 206,688