以下代码在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正确渲染方程式:
但是,当我编织文件并使用chrome打开HTML或乳胶未正确呈现时:
有没有办法解决这个问题?
答案 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}
$$