What I want to do is to include two lines at the begging in an one-line equation, just like in the following picture.

enter image description here

Does anyone have any idea in order to achieve it? Thanks a lot.

  • \max_{x\in\mathcal{J}(k)}\left\{... Apr 2 '14 at 13:27
  • 1
    \max requires amsmath. for a more general discussion of math operators, see newcommand vs. DeclareMathOperator. for a list of operators defined in this way, see the amsmath documentation -- texdoc amsmath on a tex live system. Apr 2 '14 at 13:32
  • 1
    Depending on how new you are to LaTeX, note that barbara's comment about amsmath means that you need \usepackage{amsmath} in the preamble of your document. Apr 2 '14 at 13:34
  • 1
    @barbarabeeton try latex \\show\\max :-) Apr 2 '14 at 13:46
  • 1
    @Werner Ehm, I don't think this question is about the vertical bar, but about the max with subscript. Apr 2 '14 at 17:55

Using mathtools (that loads amsmathanyway) and its DeclarePairedDelimiterX command, you can have a better spacing for |, and a better control on the size of the braces:


\usepackage{amssymb, mathtools}

\DeclarePairedDelimiterX{\set}[2]{\{}{\}}{#1 \delimsize\vert #2}


\tag*{With \texttt{\textbackslash Big}:}       &  \max_{\mathbf x \in \mathcal J(\mathbf K)}\!{\set[\Big]{\sum_{i\in I}\mathcal G_{i  \abs{C_i}}(\mathbf{\Pi}_i, y_i, \emptyset)}{(\mathbf\Pi, y_i)\in \mathcal N(\mathbf x_i)}} \\
\tag*{With \texttt{\textbackslash bigg}:}       & \max_{\mathbf x \in \mathcal J(\mathbf K)}\!{\set[\bigg]{\sum_{i\in I}\mathcal G_{i  \abs{C_i}}(\mathbf{\Pi}_i, y_i, \emptyset)}{(\mathbf\Pi, y_i)\in \mathcal N(\mathbf x_i)}}\\
\tag*{With an implicit \texttt{\textbackslash left}:}        & \max_{\mathbf x \in \mathcal J(\mathbf K)}\!{\Set{\sum_{i\in I}\mathcal G_{i  \abs{C_i}}(\mathbf{\Pi}_i, y_i, \emptyset)}{(\mathbf\Pi, y_i)\in \mathcal N(\mathbf x_i)}}


enter image description here


enter image description here

Please always post a complete document not just a fragment:



\max_{x\in\mathcal{J}(k)}\left\{ \sum_a^b something \middle| something\right\}

  • I'd say that the outer fences a excessively large and the \middle| needs spacing around it. My solution to a similar problem tex.stackexchange.com/a/167749/3929
    – daleif
    Apr 2 '14 at 14:04
  • @daleif yes, agreed. and something shouldn't be set in math italic, but I decided not to address those here and concentrate on the question about the subscript to max. Apr 2 '14 at 14:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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