其代码为:
\begin{equation}
\begin{aligned}
Centre~of~Mass \left \{ \bar{x}, \bar{y} \right \} = \left \{ \frac{M_{10}}{M_{00}} ,\frac{M_{01}}{M_{00}} \right \} = \left \{\frac{\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}xf(x, y)dxdy}{\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}f(x, y)dxdy}, \frac{\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}yf(x, y)dxdy}{\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}f(x, y)dxdy} \right\}\label{eq:COM}
\end{aligned}
\end{equation}
\end{center}
我尝试将它放在两行,这样看起来就不会那么拥挤。
请问我该如何做呢?
答案1
我会使用一个括号并将单词移到显示之前。
\documentclass{article}
\usepackage{amsmath}
\begin{document}
The coordinates of the center of mass are given by
\begin{equation}\label{eq:COM}
\left\{
\begin{aligned}
\bar{x} &= \frac{M_{10}}{M_{00}} =
\frac{\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}xf(x, y)\,dx\,dy}
{\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}f(x, y)\,dx\,dy},
\\[1ex]
\bar{y} &= \frac{M_{01}}{M_{00}} =
\frac{\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}yf(x, y)\,dx\,dy}
{\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}f(x, y)\,dx\,dy}.
\end{aligned}
\right.
\end{equation}
\end{document}
您可能更喜欢积分的显示样式(我不会):
\documentclass{article}
\usepackage{amsmath}
\newcommand{\lfrac}[2]{\frac{\displaystyle#1}{\displaystyle#2}}
\begin{document}
The coordinates of the center of mass are given by
\begin{equation}\label{eq:COM}
\left\{
\begin{aligned}
\bar{x} &= \frac{M_{10}}{M_{00}} =
\lfrac{\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}xf(x, y)\,dx\,dy}
{\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}f(x, y)\,dx\,dy},
\\[1ex]
\bar{y} &= \frac{M_{01}}{M_{00}} =
\lfrac{\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}yf(x, y)\,dx\,dy}
{\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}f(x, y)\,dx\,dy}.
\end{aligned}
\right.
\end{equation}
\end{document}
一般情况下,不要在积分或微分形式中的微分之前使用center
aroundequation
和 Remember \,
(当然,不是在莱布尼茨风格的导数中)。
答案2
\!
您没有提供关于字体或页面大小的信息,但这是一个例子,我占用了比理想情况多一点的空间,但或多或少还可以
\documentclass[a4paper]{article}
\usepackage{amsmath}
\newcommand\ddfrac[2]{\frac{\displaystyle#1}{\displaystyle#2}}
\begin{document}
\begin{equation}
\begin{aligned}
\textrm{Centre\,of\,Mass} \{ \bar{x}, \bar{y} \}
& =\left\{ \ddfrac{M_{10}}{M_{00}} ,\ddfrac{M_{01}}{M_{00}} \right\} \\
&= \left \{\!\ddfrac{\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}\!\!xf(x, y)\,dxdy}{\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}\!f(x, y)\,dxdy}, \ddfrac{\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}\!\!yf(x, y)\,dxdy}{\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}\!f(x, y)\,dxdy}\! \right\}
\end{aligned}\label{eq:COM}
\end{equation}
\end{document}
答案3
您可以使用multlined
来自的环境mathtools
(的超集amsmath
)来执行此操作。我还添加了一些改进,例如作为直立差速器符号并写Center of mass
为文本:
\documentclass{article}
\usepackage{mathtools}
\newcommand*{\dd}{\mathop{}\!\mathrm{d}}
\begin{document}
\begin{equation}
\begin{multlined}
\text{Centre~of~Mass }\left \{ \bar{x}, \bar{y} \right \} = \left \{ \frac{M_{10}}{M_{00}} ,\frac{M_{01}}{M_{00}} \right \} \\
= \left \{\frac{\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}xf(x, y)\dd x \dd y} {\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}f(x, y)\dd x \dd y}, \frac{\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}yf(x, y)\dd x \dd y} {\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}f(x, y)\dd x \dd y} \right\}\label{eq:COM}
\end{multlined}
\end{equation}
\end{document}