如何在分母中的和与根之间以及分数线和根之间添加空格?
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\begin{document}
\begin{equation}
r = \frac{\sum_{i=1}^n(x_i - \overline{x})(y_i - \overline{y})}{\sqrt{\sum_{i = 1}^n(x_i - \overline{x})^2} \sqrt{\sum_{i = 1}^n(y_i - \overline{y})^2}},
\end{equation}
\end{document}
答案1
\displaystyle
您可以在分子和分母中同时添加:
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\begin{document}
\begin{equation}
r = \frac{\displaystyle\sum_{i=1}^n(x_i - \overline{x})(y_i - \overline{y})}{\displaystyle\sqrt{\sum_{i = 1}^n(x_i - \overline{x})^2} \sqrt{\sum_{i = 1}^n(y_i - \overline{y})^2}},
\end{equation}
\end{document}
或者你可以\strut
在每个平方根内放置一个:
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\begin{document}
\begin{equation}
r = \frac{\sum_{i=1}^n(x_i - \overline{x})(y_i - \overline{y})}{\sqrt{\strut\sum_{i = 1}^n(x_i - \overline{x})^2} \sqrt{\strut\sum_{i = 1}^n(y_i - \overline{y})^2}},
\end{equation}
\end{document}