Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

what I want to do is:

enter image description here

what I have done is:

\begin{align}
\tag*{(1)}  &  v_t(\mathrm{\textbf{K}})= \mathbb{E}\left[_{0\leq x_j\leq D_{jt},j     \in J} \max_{\mathbf x \in \mathcal J(\mathbf K)}\right]
\end{align}

Output enter image description here

Anyone has any idea about how to code the first part, I guess I have troubles with the subscript of the square parenthesis, I will really appreciate any help. Thanks a lot

share|improve this question

4 Answers 4

up vote 3 down vote accepted

I would second the advice in daleif's answer: specifically, using \substack and using \Biggl, \Biggr, \biggl, \biggr, etc. when appropriate to help make the expression easier to read. (I would add: using the spacing commands \!, \,, \:, and \; to improve the space to keep things from being too cluttered or too offset.) The following example is meant to suggest useful practises in (a) typesetting such expressions, and (b) formatting mathematics to keep it easy to read.

\documentclass{article}
\usepackage{amsmath, amssymb, amsthm, amsfonts}

\renewcommand\vec[1]{\mathbf{#1}}
\newcommand\cJ{\mathcal{J}}
\newcommand\bE{\mathbb{E}}
\renewcommand\le{\leqslant}

\begin{document}
\begin{equation}
        v_t(\vec{K})
    =
        \bE\Biggl[\,
            \max_{\substack{
                \vec{x} \in \cJ(\vec{K})    \\
                0 \le x_j \le D_{jt} \forall j \in J
            }}
            \;\,
            \sum_{j \in J} r_j x_j
            +
            v_{t-1} \Biggl(
                \biggl\{
                    K_f - \sum_{j \in J_f} x_j
                \biggr\}_{\!\!f \in F}
            \Biggr)
        \Biggr]
\end{equation}

\end{document}

Sample equation

share|improve this answer
    
Thanks a lot, my apologies about the wrong title and description. –  stefy buri Apr 4 at 16:52
1  
Did you try with \biggl (or \biggr) all around? Possibly adding some space after the opening bracket. –  egreg Apr 4 at 16:53
    
@egreg: I didn't actually. With the \max there I would prefer myself to have the huge brackets; though I would personally choose to avoid having an expectation of a maximum with so many conditions. –  Niel de Beaudrap Apr 4 at 16:57
    
@NieldeBeaudrap I tried; there's no reason for the brackets to fully enclose the subscript to \max. The white space at the top is surely worse. –  egreg Apr 4 at 17:04
    
@egreg: After some consideration I've edited the answer, because while I'm not convinced that the result with \Biggl and \Biggr in the outer parens looks much better, it certainly does better illustrate the point of the answer: how to pick and choose your delimiter sizes. –  Niel de Beaudrap Apr 7 at 17:54

Several problems

  1. No need for \tag, one should never manually number equations; let LaTeX do its thing
  2. Don't use \left...\right excessively as in the example, it makes it much harder to read; use manual scaling, ie \big, \Big or \bigg (there is one level more)
  3. That is not a subscript to the [; that is a two level limit to max, typeset via \max_{\substack{limit 1 \\ limit 2}}
  4. Next time please post a full minimal example including preamble, easier for us to copy'n'paste, much more likely you will get help

It might be an idea to read the manual for amsmath, you will find many interesting things.

share|improve this answer

I agree with daleif's answer that this is not a subscript to the left square bracket but a second subscript line for \max.

The following example also plays with the sizes of the fences until the size of the subscripts are ignored for the fences in the last equation:

\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{mleftright}

\begin{document}
\begin{gather}
  v_t(\mathbf K) = \mathbb E
  \left[\,
    \max_{\substack{\mathbf x \in \mathcal J (\mathbf K)\\
                      0 \leq x_j \leq D_{jt},\,
                      j \in J}}
    \,\sum_{j \in J}
    r_j x_j + v_{t-1}
    \mleft(
      \Biggl\{ K_f - \sum_{j \in J_f} x_j \Biggr\}_{\!j \in F}
    \mright)
  \right]
\\
  v_t(\mathbf K) = \mathbb E
  \left[
    \,
    \max_{\substack{\mathbf x \in \mathcal J (\mathbf K)\\
                      0 \leq x_j \leq D_{jt},\,
                      j \in J}}
    \;
    \sum_{j \in J}
    r_j x_j + v_{t-1}
    \Biggl(
      \biggl\{ K_f - \sum_{j \in J_f} x_j \biggr\}_{\!j \in F}
    \Biggr)
  \right]
\\
  v_t(\mathbf K) = \mathbb E
  \left[
    \,
    \smash{
      \max_{\substack{\mathbf x \in \mathcal J (\mathbf K)\\
                        0 \leq x_j \leq D_{jt},\,
                        j \in J}}
      \;
      \sum_{j \in J}
      r_j x_j + v_{t-1}
      \mleft(
        \smash{
          \mleft\{
             \smash{K_f - \sum_{j \in J_f} x_j}
             \vphantom{\sum}
          \mright\}
          _{\!j \in F}
        }
        \vphantom{\mleft\{\sum\mright\}}
      \mright)
    }
    \vphantom{\mleft\{\sum\mright\}}
  \right]
\end{gather}
\end{document}

Result

  • I have added some spaces \, and \; for clarity.
  • \mleft and \mright of package mleftright avoid additional horizontal spacing that is not needed for being a argument of v.
  • \Biggl and \Biggr uses a smaller set of braces that \left and \right would do. IMHO the formula looks nicer, because the braces do not need to cover the full subscript of the sum symbol.
  • \! moves the subscript a little to the left of the curly closing brace.
  • \smash sets the contents, but tells TeX that the height and depth are zero.
  • \vphantom does not set its contents, but occupies the vertical space that would be needed by the contents.
  • The vertical line, especially its height in the question's image is unclear to me.
share|improve this answer
1  
I would make the fences even smaller, there is no need for them to be in different sizes when they are of different type. At the the curly and round ones ought to be smaller –  daleif Apr 4 at 18:01
    
why use gather when there's only one line? equation would be more appropriate. –  barbara beeton Apr 4 at 18:05
    
@barbarabeeton: Easier to extend it to three equations as in the last edit. –  Heiko Oberdiek Apr 4 at 18:18
1  
@daleif: I have added two more variants. The latest even ignores the sizes of the subscripts for the fence sizes. –  Heiko Oberdiek Apr 4 at 18:19
    
Nice one, this also show quite clearly how much space is wasted by excessive fence scaling –  daleif Apr 4 at 18:27

I'd be for avoiding \left and \right here, using, as others have shown, \substack:

\documentclass{article}
\usepackage{amsmath, amssymb, amsthm, amsfonts}

\renewcommand\vec[1]{\mathbf{#1}}
\newcommand\cJ{\mathcal{J}}
\newcommand\bE{\mathbb{E}}

\begin{document}
\begin{equation}
v_t(\vec{K}) =
\bE\biggl[\,
\max_{\substack{
  \vec{x} \in \cJ(\vec{K})    \\
  0 \le x_j \le D_{jt},\, j \in J
}}
\,
\sum_{j \in J} r_j x_j + v_{t-1}
  \biggl(
  \biggl\{
    K_f - \sum_{j \in J_f} x_j
  \biggr\}_{\!f \in F}
  \biggr)
\biggr]
\end{equation}
\end{document}

enter image description here

There's no real reason for the outer bracket to encompass the big subscript, taking into account the big white space that would result at the top.

Probably the problem with the subscript could be solved in another way, by extending the notation, say by setting

\[
\cJ(\vec{K},\vec{D}_t)=\{\,\vec{x}\in\cJ(\vec{K}):0 \le x_j \le D_{jt},\, j \in J\,\}
\]

enter image description here

so that the big formula becomes possibly clearer:

\begin{equation}
v_t(\vec{K}) =
\bE\biggl[\,
\max_{\vec{x} \in \cJ(\vec{K},\vec{D}_t)}\,
\sum_{j \in J} r_j x_j + v_{t-1}
  \biggl(
  \biggl\{
    K_f - \sum_{j \in J_f} x_j
  \biggr\}_{\!f \in F}
  \biggr)
\biggr]
\end{equation}

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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