# Suppressing line break in enumerate environment

I'm using the gather environment within the enumerate environment. After creating an item/before entering the gather environment, LaTeX adds a linebreak which I don't like.

\begin{enumerate}[(a)]
\item
\begin{gather*}
\text{substitution:}\\ % SHOULD BE ON THE SAME LINE AS (a)
\begin{align*}
\Rightarrow u(x) &= x  &\Rightarrow v'(x) &= \sin(x)&&\\
\Rightarrow v(x) &= -\cos(x) &\Rightarrow u'(x) &= 1&&
\end{align*}\\
\begin{split}
\int u(x) \cdot v'(x)  {\mathrm d}x &= u(x) \cdot v(x) - \int u'(x) \cdot v(x)  {\mathrm d}x \\
&= x \cdot -\cos(x) - \int  -\cos(x)  {\mathrm d}x
\end{split}\\
\end{gather*}
\item
\begin{gather*}
\text{substitution:}\\
\begin{align*}
\Rightarrow u(x) &= (x-2)  &\Rightarrow v'(x) &= {\mathrm e}^{2x}&&\\
\Rightarrow v(x) &= -\cos(x) &\Rightarrow u'(x) &= 1&&
\end{align*}\\
\begin{split}
\int u(x) \cdot v'(x)  {\mathrm d}x &= u(x) \cdot v(x) - \int u'(x) \cdot v(x)  {\mathrm d}x \\
&= x \cdot -\cos(x) - \int  -\cos(x)  {\mathrm d}x
\end{split}\\
\end{gather*}
\end{enumerate}


Used packages:

\usepackage{enumerate}
\usepackage{amsfonts,amsthm, mathtools}
\usepackage{amsmath}

-
You shouldn't be using display environments, but rather $\begin{gathered}[t]...\end{gathered}$. –  egreg Mar 25 '13 at 9:55
Welcome to TeX.SX. Usually, we don't put a greeting or a "thank you" in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Accepting and upvoting answers is the preferred way here to say "thank you" to users who helped you. –  Claudio Fiandrino Mar 25 '13 at 9:59
You can still use \displaystyle if you need. And the -ed environments take an optional [t] if you want them to be aligned at the top with your enumeration. –  papabravo Mar 25 '13 at 10:02
What's the benefit of using the gathered environment over the gatherenvironment? Apparently begin{align} does not work within gathered. –  Patrick Mar 25 '13 at 10:19
all the *ed environments are to be used inside other environments because their bounding box is the size of the content. The other environments take care of spacing around them (among other things) and therefore can not be nested. –  papabravo Mar 25 '13 at 12:03

There are several ways to do what you want; I'll show two, the first one is what I'd prefer.

\documentclass{article}
\usepackage{enumitem}
\usepackage{amsfonts,amsthm, mathtools}
\usepackage{amsmath}

\newcommand{\diff}{\mathop{}\!\mathrm{d}}
\newcommand{\euler}{\mathrm{e}}

\begin{document}
\begin{enumerate}[label=(\alph*)]
\item substitution:
\begin{gather*}
\begin{aligned}
\Rightarrow u(x) &= x  &\Rightarrow v'(x) &= \sin(x)\\
\Rightarrow v(x) &= -\cos(x) &\Rightarrow u'(x) &= 1
\end{aligned}\\
\begin{aligned}
\int u(x) \cdot v'(x)  \diff x &= u(x) \cdot v(x) - \int u'(x) \cdot v(x) \diff x \\
&= x \cdot -\cos(x) - \int  -\cos(x) \diff x
\end{aligned}\\
\end{gather*}
\item
\begin{gathered}[t] \text{substitution:}\\ \begin{aligned} \Rightarrow u(x) &= (x-2) &\Rightarrow v'(x) &= \euler^{2x}\\ \Rightarrow v(x) &= -\cos(x) &\Rightarrow u'(x) &= 1 \end{aligned}\\ \begin{aligned} \int u(x) \cdot v'(x) \diff x &= u(x) \cdot v(x) - \int u'(x) \cdot v(x) \diff x \\ &= x (-\cos(x)) - \int -\cos(x) \diff x \end{aligned}\\ \end{gathered}
\end{enumerate}
\end{document}


Notice the definitions that free you from the burden of using \mathrm; by the way you should say \mathrm{e} rather than {\mathrm e}. I've also used enumitem that's much more powerful than enumerate.

-
Awesome, thanks (as my reputation doesn't allow me to upvote your answer). Just learned a bunch of useful things! –  Patrick Mar 25 '13 at 10:21