2

I have a sum symbol with a quite long index underneath. This produces too much space between the following signs.

\begin{equation}
 \sum_{X\leq-VaR_\alpha(X)}{P(X)\cdot x} 
\end{equation}

I would like to see the index to reach under the P(X)x but in a very specific way: The X in the index should be left-aligned with the \sum symbol and any overlap of the index on the right of the symbol should displace the operand.

Is there any way to do this? I don't want to use a two lines index.

2
  • 1
    @Mico: I see, that was added after the fact... I'll edit the question to ask this explicitly, since it would still be a duplicate without it (since it's not made clear).
    – Werner
    Jul 16, 2018 at 20:22
  • @Henros: I've updated your question to incorporate your comments. Is my assessment correct?
    – Werner
    Jul 16, 2018 at 20:26

2 Answers 2

2

Another solution, also provided by the mathtools package, is to use its \smashoperator macro. In fact, by writing \smashoperator[r]{...}, one can arrange that the material overlaps only on the right, rather than on both sides. (Observe that the word "Note" does not overlap with the material below the summation sign.)

Note that I would also create a macro, called (say) \VaR, to typeset the string VaR with upright letters. And, do note that there's no point in encasing P(X)\cdot x in curly braces.

enter image description here

\documentclass{article}
\usepackage{mathtools}
\newcommand\VaR{\mathrm{VaR}}
\begin{document}
\begin{equation}
\text{Note:}\smashoperator[r]{\sum_{X\leq\VaR_\alpha(X)}} P(X)\cdot x  
\end{equation}
\end{document}

Addendum to address the OP's follow-up question: You may achieve your typesetting objective by (a) switching to the basic, i.e., centered version of the \smashoperator directive and inserting a suitable "kern" at the start of the subscript material. I know it's not fruitful to argue about tastes, but in my opinion the result of right-shifting the subscript material is anything but good-looking.

enter image description here

\documentclass{article}
\usepackage{mathtools}
\newcommand\VaR{\mathrm{VaR}}
\begin{document}
\[
\text{Note:}\smashoperator{\sum_{\mkern70mu X\leq\VaR_\alpha(X)}} P(X)\cdot x  
\]
\end{document}
4
  • Thank you! Is there also a way to align the index, so that it begins in line with the sum symbol?
    – Henros
    Jul 16, 2018 at 19:24
  • Please clarify what you mean by "begins in line with the sum symbol". (I can think of at least two ways in which this expression might be interpreted.)
    – Mico
    Jul 16, 2018 at 19:30
  • Sorry, that was unclear. I wish the first "X" in the index to be under the left end of the sum symbol (kind of left align the index). In your example, the space between "Note:" and the sum would not be necessary anymore.
    – Henros
    Jul 16, 2018 at 19:48
  • @Henros - I've posted an addendum to my answer to address your follow-up request. Speaking for myself, I can't say that the resulting, highly asymmetric result is all that appealing, visually speaking.
    – Mico
    Jul 16, 2018 at 20:17
1

You could use \mathclap from the mathtools package:

\documentclass{article}
\usepackage{mathtools}
\begin{document}
\begin{equation}
\sum_{\mathclap{X\leq-VaR_\alpha(X)}}{P(X)\cdot x} 
\end{equation}
\end{document}

enter image description here

edit2: Note, however, as Mico pointed out in the comment, that this also works on the left side. See Mico's answer for a version doing this on the right side only.

edit: A little explanation. \mathclap reduces the width of its content to zero and centers it. So, Latex does not see the true width of the box and shrinks the space to the usual space after a sum. You could use it in conjunction with another box with a specific width, if this looks too tight for you.
Note: There is also \mathrlap and \mathllap available. They don't center their content but put it ragged-right or -left.

4
  • The \mathclap command makes the material below the summation sign overlap in both directions. The OP asked only for that material to overlap on the right only.
    – Mico
    Jul 16, 2018 at 19:10
  • @Mico indeed, but isn't this a good thing? I think it would look strange otherwise, i.e., to have space on the left but no space on the right...
    – nox
    Jul 16, 2018 at 19:14
  • We don't know why the OP asked for an overlap to be created just on the right-hand side. Maybe his/her use case has some tall (and deep) construct immediately before the summation symbol, and that construct might tangle with the subscript below the summation symbol?
    – Mico
    Jul 16, 2018 at 19:16
  • @Mico Thanks, you're right, added that info.
    – nox
    Jul 16, 2018 at 19:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .