Math mode ignoring new line markers

I have been having an issue recently where when I am typing in math mode in R Markdown it ignores any new line markers when I knit the document to PDF. For example, if I type

$$
H_0: E(Y) = \beta_0 + \beta_1X \\
H_a: E(Y) \neq \beta_0 +\beta_1X
$$

I get the following output when I knit the document:
Wrong Output

It's strange because in the preview when editing the document the output appears correctly with each hypothesis appearing on its own line. I should also note that this only seems to happen when knitting to PDF, and the formatting works perfectly fine when knitting to HTML.

Any help would be greatly appreciated.

try this

$$
\begin{split}
H_0: E(Y) = \beta_0 + \beta_1X \\
H_a: E(Y) \neq \beta_0 +\beta_1X
\end{split}
$$

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.