2

Consider the following integral:

$$\int_{\text{One line \\ Second line}} \text{Loss}\left(\text{Foo, Bar} \vert \alpha\right)$$

which renders:

enter image description here

How can I have One line and Second line on two separate and consecutive lines at the bottom of the integral?

  • amsmath \substack command – David Carlisle Apr 30 '15 at 19:51
  • 2
    Consider also using \[…\] or \begin{align*}…\end{align*} rather than $$. Source : http://tex.stackexchange.com/q/503/34551 – Clément Apr 30 '15 at 20:17
  • 1
    @Clément just FYI, I know you had good intentions with your suggested edit, but I rejected it because the answer likely has the $$ only because the OP had the $$. Your comment here will hopefully help the OP to learn about the differences, and this will be sufficient because the post is a duplicate anyway. In general, when I think an answer should be changed, I simply leave a comment below it and let the author decide. Cheers! – Paul Gessler Apr 30 '15 at 20:30
  • 2
    @PaulGessler Thanks for explaining that decision, which is perfectly sensible! – Clément Apr 30 '15 at 23:23

1 Answers1

4

You can use \substack or \subarray from amsmath. With \subarray you can control the justification.

\[ \int_{\substack{\text{One line} \\ \text{Second line}}}
\text{Loss}\left(\text{Foo, Bar} \vert \alpha\right) \]

\[ \int_{\begin{subarray}{l}\text{One line} \\ \text{Second line} \end
{subarray}} \text{Loss}\left(\text{Foo, Bar} \vert \alpha\right) \]

enter image description here

James
  • 4,587
  • 1
  • 12
  • 27
  • 3
    I think you should read http://tex.stackexchange.com/questions/503/why-is-preferable-to?lq=1, as well as @Clement already noted about the usage of $$....$$ –  Apr 30 '15 at 21:11