做出最佳对齐估计的技巧

做出最佳对齐估计的技巧

嘿,所以我继续使用

\ \ {text} 

以确保我的所有方程式都对齐。除了使用间距系统之外,还有其他好方法可以做到这一点吗?比如我不得不打印我的项目两次,因为使用上述想法方程式没有完全对齐。无论如何,这是我的代码,希望它能给你们一些提示:

\section*{Calculation}

Since the quantile plot does not show indications that the sample came from a normally distributed population, we can find the $95\%$ confidence interval for the population by using the following:

\begin{multialign}

 P_{2.5} < \mu < P_{97.5}

\end{multialign}

This means that $\mu$ lies between the interval of the mean of the 12th and 13th scores and the mean of the 487th and 488th scores in the sorted list of means. Hence we get:

\begin{multialign}

\ \ P_{2.5} &< \mu < P_{97.5} \\

\ \ \frac{35.833+37.417}{2} &< \mu < \frac{198.917+200.583}{2} \\

\ \ \frac{73.250}{2} &< \mu <\frac{399.554}{2}\\

\ \ 36.625 &< \mu < 199.777 \\

\end{multialign}

Therefore the $95\%$ confidence interval of our sample data is:

\begin{multialign}

36.6 < \mu < 200.\ \text{or} \ 

\mu \in (36.6, 200.)

\end{multialign}

这是没有使用的图片

\ \ {文本}

在此处输入图片描述

这是猜多次的图片

\ \ {文本}

在此处输入图片描述

比如有没有办法可以消除这个猜测和检查的过程?

答案1

我不知道您需要使用哪个包multialign,也不知道该环境的用途。我能够使用标准align环境重现所需的输出,而无需使用添加空格\。宏\intertext(来自amsmath)可以解决问题,但仅适用于特殊情况,例如您发布的示例,其中您想要对齐的单独方程式很接近并且中间几乎没有文本:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\section*{Calculation}

Since the quantile plot does not show indications that the sample came from a normally distributed population, we can find the $95\%$ confidence interval for the population by using the following:

\begin{align*}
P_{2.5} &< \mu < P_{97.5}
\intertext{%
This means that $\mu$ lies between the interval of the mean of the 12th and 13th scores and the mean of the 487th and 488th scores in the sorted list of means. Hence we get:
}
P_{2.5} &< \mu < P_{97.5} \\
\frac{35.833+37.417}{2} &< \mu < \frac{198.917+200.583}{2} \\
\frac{73.250}{2} &< \mu <\frac{399.554}{2}\\
36.625 &< \mu < 199.777 \\
\end{align*}

Therefore the $95\%$ confidence interval of our sample data is:

\begin{align*}
36.6 < \mu < 200.\ \text{or} \ 
\mu \in (36.6, 200.)
\end{align*}
\end{document}

结果

答案2

在我看来,你不需要一行与四行显示共享对齐:它们由三行文本分隔,而且一行是一个通用公式。

然而,这不需要猜测:只需挤压外部的材料即可。

\documentclass{article}
\usepackage{mathtools}
\newcommand{\LHS}[1]{\mathllap{#1}}
\newcommand{\RHS}[1]{\mathrlap{#1}}
\begin{document}
\section*{Calculation}

Since the quantile plot does not show indications that the sample came from a normally 
distributed population, we can find the $95\%$ confidence interval for the population by using 
the following:
\begin{equation*}
\LHS{P_{2.5}} < \mu < \RHS{P_{97.5}}
\end{equation*}
This means that $\mu$ lies between the interval of the mean of the 12th and 13th scores and 
the mean of the 487th and 488th scores in the sorted list of means. Hence we get:
\begin{align*}
\LHS{P_{2.5}} &< \mu < \RHS{P_{97.5}} \\
\LHS{\frac{35.833+37.417}{2}} &< \mu < \RHS{\frac{198.917+200.583}{2}} \\
\LHS{\frac{73.250}{2}} &< \mu < \RHS{\frac{399.554}{2}} \\
\LHS{36.625} &< \mu < \RHS{199.777} \\
\end{align*}
Therefore the $95\%$ confidence interval of our sample data is:
\begin{equation*}
36.6 < \mu < 200 \text{ or } \mu \in (36.6, 200)
\end{equation*}

\end{document}

切勿在数学显示之前和其中留下空行;在数学显示后面留空行意味着开始一个新段落,这几乎肯定不是您在此文本片段中想要的。

在此处输入图片描述

这是没有挤压的结果;看到结果后,我确认了我的想法,即不应该费心尝试对齐“mu”符号。

在此处输入图片描述

笔记。如果multialign是我在其中一个答案中定义的环境,在这种情况下使用它:它是为一个非常具体的目的而定义的,与你的目的无关。


我会用不同的方式来写:重复不等式的展示可能适合高中教科书,但不适合研究论文。

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\section*{Calculation}

Since the quantile plot does not show indications that the sample came from a normally
distributed population, we can find the $95\%$ confidence interval for the population by using
the following inequalities
\begin{equation*}
P_{2.5} < \mu < P_{97.5}.
\end{equation*}
This means that $\mu$ lies between the interval of the mean of the 12th and 13th scores and
the mean of the 487th and 488th scores in the sorted list of means. With easy computations,
\begin{gather*}
P_{2.5}=\frac{35.833+37.417}{2}=\frac{73.250}{2}=36.625, \\[1ex]
P_{97.5}=\frac{198.917+200.583}{2}=\frac{399.554}{2}=199.777,
\end{gather*}
and therefore the $95\%$ confidence interval of our sample data is
\begin{equation*}
36.6 < \mu < 200 
\end{equation*}
or $\mu \in (36.6, 200)$.
\end{document}

请注意,等式前面省略了冒号(它们不是必需的,甚至可能是错误的);不等式的最后一个版本,带有区间的表示,只是对主要公式的非本质重写,因此它的位置是一致的。

在此处输入图片描述

相关内容