我想要以下方程的 LaTeX 代码。有人能帮我吗?
正如下面的代码所示,项 (n/r) 并不小,我该如何像在源图中那样做呢?
图片来源:
代码:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{equation}
\begin{split}
\int_{0}^{1} (f_{n}-{\tiny \frac{n}{r}} f_{n})^{2}
r~dr~+2n\int_{0}^{1}f_{n}f_{n}dr\\
= \int_{0}^{1}(f_{n}-{\tiny \frac{n}{c}} f_{n})^{2} r~dr + nf^{n}_{2}(1)
\end{split}
\end{equation}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
我的输出:
答案1
在每行开头添加\textstyle
。删除\tiny
(这是文本指令,不是数学样式)。
默认情况下,$...$
将数学放在 中\textstyle
。但是,\[...\]
以及,以及其他默认\begin{equation}...\end{equation}
将数学放在更大的 中。\displaystyle
\documentclass{article}
\usepackage{amsmath}
\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{equation}
\begin{split}\textstyle
\int_{0}^{1} (f_{n}-{\frac{n}{r}} f_{n})^{2}
r~dr~+2n\int_{0}^{1}f_{n}f_{n}dr\\\textstyle
= \int_{0}^{1}(f_{n}-{\frac{n}{c}} f_{n})^{2} r~dr + nf^{n}_{2}(1)
\end{split}
\end{equation}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}
答案2
你可以选择以下其中之一:
\documentclass{article}
\usepackage{mathtools, nccmath}
\begin{document}
\begin{equation}
\begin{split}\textstyle
\prescript{}{0}{\int^{1}}(f_{n} - \frac{n}{r} f_{n})^{2}
r\,dr + 2n \prescript{}{0}{\int^{1}}f_{n}f_{n}\,dr\\
\textstyle = \prescript{}{0}{\int^{1}}(f_{n}- \frac{n}{c} f_{n})^{2} r\,dr + nf^{n}_{2}(1)
\end{split}
\end{equation}
\begin{equation}
\begin{split}
\prescript{}{0}{\int^{1}}\!\bigl(f_{n} - \tfrac{n}{r} f_{n}\bigr)^{2}
r\,dr + 2n \prescript{}{0}{\int^{1}}\!f_{n}f_{n}\,dr\\
= \prescript{}{0}{\int^{1}}\!\bigl(f_{n}- \tfrac{n}{c} f_{n}\bigr)^{2} r\,dr + nf^{n}_{2}(1)
\end{split}
\end{equation}
\begin{equation}
\begin{split}
\prescript{}{0}{\int^{1}}\! \Bigl(f_{n} - \mfrac{n}{r} f_{n}\Bigr)^{\!2}
r\,dr + 2n \prescript{}{0}{\int^{1}}\!f_{n}f_{n}\,dr\\
= \prescript{}{0}{\int^{1}}\!\Bigl(f_{n} - \mfrac{n}{c} f_{n}\Bigr)^{\!2} r\,dr + nf^{n}_{2}(1)
\end{split}
\end{equation}
\end{document}