2
votes

I am using rmarkdown to generate my homework which also involves including some equations in latex, but rmarkdown will not recognize line endings if I create a pdf file.

\[
Y = f(X) \\
X \in [0,1]
\]

If I specify the output as html, this will appear correctly as two lines, but when outputting to pdf, it will put the entire latex block on the same line. I have tried \newline and that still does not work.

1

1 Answers

4
votes

You can do

\begin{align*}
Y = f(X) \\
X \in [0,1]
\end{align*}

This works for html and pdf.