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.

does anyone know how can I avoid the free space between the sum sign and the indicator function. I guess it's caused by the width of the upper block above the overbrace. So is there a way to allow this block to go "beyond the scope" of the overbrace, which is defined by the lower part?

Basically I would like to get something like this:

desired output

instead of

actual output

Thank you very much in advance for any suggestions. Regards, Serge

\documentclass[pdftex,a4paper]{scrartcl}
\usepackage[latin1]{inputenc}
\usepackage[left=2.5cm,top=2.5cm]{geometry}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{bbm} %for indicator function
%Source Printer
\usepackage{verbatim}
\usepackage{array}
\usepackage{graphicx}

\begin{document}
\begin{align*}
\min \biggl(\omega_1 \cdot \sum\limits_{i\in\mathcal{F}}\sum\limits_{c\in\mathcal{C}} 
\sum\limits_{e\in\mathcal{E}_c}\sum\limits_{\tau\in\mathcal{S}^i_{e}}
\mathbf{w}^i_{c,e,\tau} \cdot x_{i,c,e,\tau} + & \omega_2 \cdot  \sum\limits_{t \in 
\mathcal{T}}\sum\limits_{c \in \mathcal{C}}\overbrace{\mathbbm{1}_{\{ u_{t, c} \geq 0.8
\cdot \kappa^{\text{cap}}_c \}}(t,c)}^{\eta_{0.7}\mathbbm{1}_{\{ u_{t, c} \geq 0.7 \cdot 
\kappa^{\text{cap}}_c\}}(t,c) + \eta_{0.8}\mathbbm{1}_{\{ u_{t, c} \geq 0.8 \cdot
\kappa^{\text{cap}}_c\}}(t,c) + \eta_{0.9}\mathbbm{1}_{\{ u_{t, c} \geq 0.9 \cdot 
\kappa^{\text{cap}}_c\}}(t,c)} + \omega_3 \cdot \frac{1}{2}\sum\limits_{t \in \mathcal{T}}
\sum\limits_{c \in \mathcal{C}}n_{t,c} \biggr) 
\\& \text{with} \quad \omega_i \in \left[0,1\right], \sum\nolimits_{i=1}^3\omega_i = 1
\label{cost}
\end{align*}
\end{document}
share|improve this question
    
Welcome to TeX.sx! As new user without image posting privileges simply include the image as normal and remove the ! in front of it to turn it into a link. A moderator or another user with edit privileges can then reinsert the ! to turn it into an image again. –  Qrrbrbirlbel Nov 4 '12 at 15:23
1  
Thank you for this hint. Just added the images. –  Serge Nov 4 '12 at 15:39
add comment

2 Answers

up vote 4 down vote accepted

You can achieve directly what you want withmathtools' \mathclap. I also provide another variant that uses amsmaths \substack macro that gives you a multilined over-brace text (note also the \hfill to right-align the first line).

I also added a pair of braces {} between the + and the column separater & to get the right spacing around the plus sign. (This would be also necessary in \substack with the plus signs at the start of the lines, but since we're in script-style no horizontal space is added anyway.)

I get overfull boxes, by the way, so maybe you should split the equation onto different lines (see below).

Code

\documentclass[pdftex,a4paper]{scrartcl}
\usepackage[latin1]{inputenc}
\usepackage[left=2.5cm,top=2.5cm]{geometry}
\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{bbm}

\begin{document}
\begin{align*}
\min \biggl(
    \omega_1 \cdot \sum_{i \in \mathcal{F}  } \sum_{c    \in \mathcal{C}    }
                 \sum_{e \in \mathcal{E}_c} \sum_{\tau \in \mathcal{S}^i_e}
                 \mathbf{w}^i_{c,e,\tau} \cdot x_{i,c,e,\tau} + {} &
  \omega_2 \cdot  \sum_{t \in \mathcal{T}} \sum_{c \in \mathcal{C}}
                 \overbrace{\mathbbm{1}_{\{ u_{t, c} \geq 0.8 \cdot \kappa^{\text{cap}}_c \}} (t,c) }^
                   {\mathclap{ \eta_{0.7} \mathbbm{1}_{\{ u_{t, c} \geq 0.7 \cdot \kappa^{\text{cap}}_c\}} (t,c)
                             + \eta_{0.8} \mathbbm{1}_{\{ u_{t, c} \geq 0.8 \cdot \kappa^{\text{cap}}_c\}} (t,c)
                             + \eta_{0.9} \mathbbm{1}_{\{ u_{t, c} \geq 0.9 \cdot \kappa^{\text{cap}}_c\}} (t,c)}
                   }
                 + \omega_3 \cdot \frac{1}{2}\sum\limits_{t \in \mathcal{T}} \sum_{c \in \mathcal{C}} n_{t,c}
     \biggr) \\
  & \text{with} \quad \omega_i \in \left[0,1\right], \sum\nolimits_{i=1}^3\omega_i = 1
\end{align*}

\begin{align*}
\min \biggl(
    \omega_1 \cdot \sum_{i \in \mathcal{F}  } \sum_{c    \in \mathcal{C}    }
                 \sum_{e \in \mathcal{E}_c} \sum_{\tau \in \mathcal{S}^i_e}
                 \mathbf{w}^i_{c,e,\tau} \cdot x_{i,c,e,\tau} + {} &
  \omega_2 \cdot  \sum_{t \in \mathcal{T}} \sum_{c \in \mathcal{C}}
                 \overbrace{\mathbbm{1}_{\{ u_{t, c} \geq 0.8 \cdot \kappa^{\text{cap}}_c \}} (t,c) }^
                   {\mathclap{\substack{ \hfill\eta_{0.7} \mathbbm{1}_{\{ u_{t, c} \geq 0.7 \cdot \kappa^{\text{cap}}_c\}} (t,c) \\
                             + \eta_{0.8} \mathbbm{1}_{\{ u_{t, c} \geq 0.8 \cdot \kappa^{\text{cap}}_c\}} (t,c) \\
                             + \eta_{0.9} \mathbbm{1}_{\{ u_{t, c} \geq 0.9 \cdot \kappa^{\text{cap}}_c\}} (t,c)}
                   }}
                 + \omega_3 \cdot \frac{1}{2}\sum\limits_{t \in \mathcal{T}} \sum_{c \in \mathcal{C}} n_{t,c}
     \biggr) \\
  & \text{with} \quad \omega_i \in \left[0,1\right], \sum\nolimits_{i=1}^3\omega_i = 1
\end{align*}
\end{document}

Output

enter image description here

No overfull boxes

\begin{multline*}
\min \biggl(
    \omega_1 \cdot \sum_{i \in \mathcal{F}  } \sum_{c    \in \mathcal{C}    }
                 \sum_{e \in \mathcal{E}_c} \sum_{\tau \in \mathcal{S}^i_e}
                 \mathbf{w}^i_{c,e,\tau} \cdot x_{i,c,e,\tau} \\ {} +
  \omega_2 \cdot  \sum_{t \in \mathcal{T}} \sum_{c \in \mathcal{C}}
                 \overbrace{\mathbbm{1}_{\{ u_{t, c} \geq 0.8 \cdot \kappa^{\text{cap}}_c \}} (t,c) }^
                   {\mathclap{ \eta_{0.7} \mathbbm{1}_{\{ u_{t, c} \geq 0.7 \cdot \kappa^{\text{cap}}_c\}} (t,c)
                             + \eta_{0.8} \mathbbm{1}_{\{ u_{t, c} \geq 0.8 \cdot \kappa^{\text{cap}}_c\}} (t,c)
                             + \eta_{0.9} \mathbbm{1}_{\{ u_{t, c} \geq 0.9 \cdot \kappa^{\text{cap}}_c\}} (t,c)}
                   }
                 + \omega_3 \cdot \frac{1}{2}\sum\limits_{t \in \mathcal{T}} \sum_{c \in \mathcal{C}} n_{t,c}
     \biggr) \\
  \text{with} \quad \omega_i \in \left[0,1\right], \sum\nolimits_{i=1}^3\omega_i = 1
\end{multline*}

No overfull boxes

share|improve this answer
    
Thanks a lot, this is exactly I was looking for. –  Serge Nov 4 '12 at 15:30
    
@Serge But wait, there's more! (See updated answer.) –  Qrrbrbirlbel Nov 4 '12 at 15:43
    
Thank you, looks great! Right now it's just a draft version. I'm not sure if I gonna use all of the equations above the overbrace, but if I'll reconsider the layout changes. Just a short question regarding the multiline approach: what are the braces \cdot x_{i,c,e,\tau} \\ {} + \omega_2 \cdot good for? –  Serge Nov 4 '12 at 16:07
    
@Serge Correct handling of the + as a binary instead of an unitary operator (i.e. correct spacing). Take a look at mathmode for useful tips and hints about not only the spacing (section 11) and Werner's answer. –  Qrrbrbirlbel Nov 4 '12 at 16:27
    
Thanks, I'll definitely do it. –  Serge Nov 4 '12 at 23:40
show 1 more comment

Here are some additional suggestions regarding your current typesetting:

  1. align's alignment should use a & <sym> style rather than <sym> &. Taking yours as an example, do not use ... + & ... but instead use ... & + .... Note the difference:

    enter image description here

    \documentclass{article}
    \usepackage{amsmath}% http://ctan.org/pkg/amsmath
    \begin{document}
    \begin{align*}
      f(x) = ax^2 + bx +& c \\ % Wrong use of &
             c &+ bx + ax^2 = g(x) % Correct use of &
    \end{align*}
    \end{document}
    
  2. For large \overbrace descriptions, it may be better to use \overbrace{<stuff>}^{<sym>} and then define <sym> somewhere else. For example,

    enter image description here

    \documentclass{article}
    \usepackage{amsmath,bbm}% http://ctan.org/pkg/{amsmath,bbm}
    \begin{document}
    \begin{multline*}
      \min \biggl(\omega_1 \cdot \sum\limits_{i\in\mathcal{F}}\sum\limits_{c\in\mathcal{C}} 
      \sum\limits_{e\in\mathcal{E}_c}\sum\limits_{\tau\in\mathcal{S}^i_{e}}
      \mathbf{w}^i_{c,e,\tau} \cdot x_{i,c,e,\tau} + \omega_2 \cdot  \sum\limits_{t \in 
      \mathcal{T}}\sum\limits_{c \in \mathcal{C}}\overbrace{\mathbbm{1}_{\{ u_{t, c} \geq 0.8
      \cdot \kappa^{\text{cap}}_c \}}(t,c)}^{\alpha} \\
      \hspace{5em}{} + \omega_3 \cdot \frac{1}{2}\sum\limits_{t \in \mathcal{T}}
      \sum\limits_{c \in \mathcal{C}}n_{t,c} \biggr)
    \end{multline*}
    \vspace*{-\baselineskip}
    \begin{align*}
      \text{where\quad} \phantom{\textstyle\sum_{i=1}^3}\omega_i & \in \left[0,1\right], \\
      \textstyle\sum_{i=1}^3\omega_i & = 1, \\
      \alpha & =\eta_{0.7}\mathbbm{1}_{\{ u_{t, c} \geq 0.7 \cdot \kappa^{\text{cap}}_c\}}(t,c) + 
        \eta_{0.8}\mathbbm{1}_{\{ u_{t, c} \geq 0.8 \cdot \kappa^{\text{cap}}_c\}}(t,c) \\
        & \phantom{{}={}} \eta_{0.9}\mathbbm{1}_{\{ u_{t, c} \geq 0.9 \cdot \kappa^{\text{cap}}_c\}}(t,c)
    \end{align*}
    \end{document}
    
  3. Since you only have ω1, ω2 and ω3, it may be better to write this out in your where clause, rather than using sum notation over 3 elements.

share|improve this answer
    
Thank you for the tips! I'll consider them to enhance the look of my equations (there is a lot to do with the spacing) I like your 2. point, but in my case I'll use Qrrbrbirlbel's solution. It's just a draft version I want to discuss with my supervisor and show him that the indicator function could be replaced/improved by a weighted sum of several indicator functions. So it's better from the practical point of view to have both versions closer together. So incase in the final version I'll go with an additional sum and remove the overbrace completely. –  Serge Nov 4 '12 at 23:36
add comment

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.