#LaTeX linebreaks not working

1 messages · Page 1 of 1 (latest)

unique timber
#

Hi, I'm writing LaTeX within R Markdown and exporting to PDF. Currently have an issue where my linebreaks are showing up fine in R but then in the PDF version are not working.

$$
\bar{x} = 162.33 \:\: s_x=9.54
\\\bar{y}=71.28 \:\: s_y =13.89
\\r=0.60172 \:\: n=12
\\
\text{(a) Slope estimate }b_1\text{ for the regression line that predicts weight given height is: }
\\b_1=r\frac{s_y}{s_x} = .60172*\frac{13.89}{9.54}\approx 0.8761
$$

Shows like Image 1 within RStudio.

However, when I Knit to PDF it appears like Image 2.

How can I fix this?

(P.S. I realize my other alignment is atrocious and learned to use & for spacing but this is what I had at the start)

olive smelt
#
\begin{align*}
\bar{x} = 162.33, \quad s_x=9.54\\
\bar{y}=71.28, \quad s_y =13.89\\
r=0.60172, \quad n=12
\end{align*}
(a) Slope estimate $b_1$ for the regression line that predicts weight given height is:
\[b_1=r\frac{s_y}{s_x}\] and when evaluated gives \[b_1=0.60172\cdot\frac{13.89}{9.54}\approx0.8761\]```
mild gullBOT
#

Angetenar

olive smelt
#

I took some liberties because your original code was really bad