有没有办法修复 RMarkdown 中有序列表的对齐方式?
Is there a way to fix the alignment of the ordered list in RMarkdown?
我的有序列表的位置出现在中间而不是top。有什么方法可以使 a) 在等式的第一行对齐?
这是我的代码:
a)
$\begin{aligned}
\hat{y} &= (\overline{x_1} - \overline{x_2})'S^{-1}_{pooled}x \
&= \left(\begin{bmatrix}3\6\end{bmatrix}-\begin{bmatrix}5\8\end{bmatrix}\right)'\begin{bmatrix}1&1\1&2\end{bmatrix}^{-1}\begin{bmatrix}x_1\x_2\end{bmatrix} \
&= \begin{bmatrix}-2&0\end{bmatrix} \begin{bmatrix}x_1\x_2\end{bmatrix} \
&= -2x_1
\end{aligned}$
您可以添加另一组$
标志;一个在开头,一个在结尾。
a)
$$\begin{aligned}
\hat{y} &= (\overline{x_1} - \overline{x_2})'S^{-1}_{pooled}x \
&= \left(\begin{bmatrix}3\6\end{bmatrix}-\begin{bmatrix}5\8\end{bmatrix}\right)'\begin{bmatrix}1&1\1&2\end{bmatrix}^{-1}\begin{bmatrix}x_1\x_2\end{bmatrix} \
&= \begin{bmatrix}-2&0\end{bmatrix} \begin{bmatrix}x_1\x_2\end{bmatrix} \
&= -2x_1
\end{aligned}$$
引用已接受的答案,两者的区别是:
$$ will produce a block element (a paragraph) while $ will produce an inline element. Thus, $$ is often used for equations.
我的有序列表的位置出现在中间而不是top。有什么方法可以使 a) 在等式的第一行对齐? 这是我的代码:
a)
$\begin{aligned}
\hat{y} &= (\overline{x_1} - \overline{x_2})'S^{-1}_{pooled}x \
&= \left(\begin{bmatrix}3\6\end{bmatrix}-\begin{bmatrix}5\8\end{bmatrix}\right)'\begin{bmatrix}1&1\1&2\end{bmatrix}^{-1}\begin{bmatrix}x_1\x_2\end{bmatrix} \
&= \begin{bmatrix}-2&0\end{bmatrix} \begin{bmatrix}x_1\x_2\end{bmatrix} \
&= -2x_1
\end{aligned}$
您可以添加另一组$
标志;一个在开头,一个在结尾。
a)
$$\begin{aligned}
\hat{y} &= (\overline{x_1} - \overline{x_2})'S^{-1}_{pooled}x \
&= \left(\begin{bmatrix}3\6\end{bmatrix}-\begin{bmatrix}5\8\end{bmatrix}\right)'\begin{bmatrix}1&1\1&2\end{bmatrix}^{-1}\begin{bmatrix}x_1\x_2\end{bmatrix} \
&= \begin{bmatrix}-2&0\end{bmatrix} \begin{bmatrix}x_1\x_2\end{bmatrix} \
&= -2x_1
\end{aligned}$$
引用已接受的答案
$$ will produce a block element (a paragraph) while $ will produce an inline element. Thus, $$ is often used for equations.