4

This question already has an answer here:

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.

marked as duplicate by egreg math-mode Dec 6 '16 at 20:58

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

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

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}
  • This is also a perfect answer. Can \middle be also applied to different things than \vert to stretch them? – phinz Dec 6 '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 6 '16 at 19:44

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