gather
我在环境中使用环境enumerate
。创建项目后/进入gather
环境之前,LaTeX 会添加换行符,我不喜欢。
\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}
使用的软件包:
\usepackage{enumerate}
\usepackage{amsfonts,amsthm, mathtools}
\usepackage{amsmath}
答案1
有几种方法可以做你想做的事情;我将展示两种,第一种是我喜欢的。
\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}
请注意,这些定义使您免于使用\mathrm
; 顺便说一句,您应该说\mathrm{e}
而不是{\mathrm e}
。 我也使用过 ,enumitem
它比 强大得多enumerate
。