R Markdown和Windows中的多线乳胶方程

时间:2017-12-20 19:52:01

标签: r r-markdown

以下代码在linux上运行正常:

---
title: "LaTeX test"
author: "Ignacio"
output: html_document
---


## Latex

$$ 
\begin{aligned}

y_j \sim N(\theta_j , \sigma_j^2) \\

\sigma_j = \nu/\sqrt{n_j}   \\

\theta = \mu +\tau \times \eta \\

\eta \sim N(0,1) \\

\mu + \tau\times\eta = \theta \sim N(\mu , \tau^2)

\end{aligned}
$$

在Windows上,rstudio正确渲染方程式:

enter image description here

但是,当我编织文件并使用chrome打开HTML或乳胶未正确呈现时:

enter image description here

有没有办法解决这个问题?

1 个答案:

答案 0 :(得分:4)

如果其他人遇到这个问题,@YihuiXie是对的。删除空行可以解决问题:

---
title: "LaTeX test"
author: "Ignacio"
output: html_document
---


## Latex

$$
\begin{aligned}
y_j \sim N(\theta_j , \sigma_j^2) \\
\sigma_j = \nu/\sqrt{n_j}   \\
\theta = \mu +\tau \times \eta \\
\eta \sim N(0,1) \\
\mu + \tau\times\eta = \theta \sim N(\mu , \tau^2)
\end{aligned}
$$