如何将其拆分成两行

如何将其拆分成两行

这是我的代码:

\begin{equation}
\text{Diluted EPS}=\frac{\text{Net Income}}{\text{Weighted average number of shares outstanding + New common shares that would have been issued at conversion}}
\end{equation}

看起来像这样......太可怕了:

在此处输入图片描述

答案1

您也可以添加一些换行符。实现此目的的一种方法是使用\substack。这通常会减小字体大小,这通常是合适的,但可以使用 将其改回正常\normalfontsize。同样,添加括号虽然并非总是必需的,但应始终考虑。作为示例输出:

在此处输入图片描述

\documentclass{book}
\usepackage{amsmath}
\begin{document}

\begin{equation}
\text{Diluted EPS}=\dfrac{\text{Net
Income}}{\substack{\text{Weighted average number}\\ \text{of shares
outstanding}}+ \substack{\text{New common shares that}\\ \text{would have been}\\ \text{issued
at conversion}}}
\end{equation}

\end{document}

答案2

欢迎来到 TeX.SE...

尝试使用\splitfracfrom mathtools.sty,结果MWE是:

\documentclass{book}
\usepackage{mathtools}
\begin{document}

\begin{equation}
\text{Diluted EPS}=\frac{\text{Net
Income}}{\splitdfrac{\text{Weighted average number of shares
outstanding}}{+ \text{New common shares that would have been issued
at conversion}}}
\end{equation}

\end{document}

相关内容