如何改善分母中根号下的和的出现?

如何改善分母中根号下的和的出现?

如何在分母中的和与根之间以及分数线和根之间添加空格?

\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}

相关内容