latex equation with xaringan?

I'm trying to write a xaringan presentation that has some latex equations. This is what I wrote:

    lib_dir: libs
      highlightStyle: github
      highlightLines: true
      highlightSpans: true
      countIncrementalSlides: false
      ratio: "16:9"


# Model without clusters

Let $y_i$ be the standardized outcome for student $i$:

y_i \sim N(\mu_i,\sigma) \\
\sigma \sim N^+(0,1) \\
\mu_i = \alpha + \eta T_i + \beta X_i \\
\eta \sim N(0,1) \\
\beta \sim N(0,1)

Alas, \\ is not recognized as a line break so I end up with this:

What am I doing wrong?

Most probably, this is happening because \\ doesn't work inside $$. I recently asked a question, and made a total fool of myself.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.