2024-10-30
$
’s to tell our Quarto doc where we are writing LaTeX code$...$
$a^2 + b^2 = c^2$
For equations that should be centered on their own line, use $$...$$
.
Example: We can make an equation with a new line using $$E = mc^2$$
\[E = mc^2\]
This makes the equation stand out
Greek letters
\mu
\sigma
\beta
\lambda
Math symbols
>
\geq
\neq
\cdot
\times
_
(underscore).
$x_1$
, $y_{ij}$
render as \(x_1\), \(y_{ij}\)^
(caret).
$x^2$
, $e^{5i}$
render as \(x^2\), \(e^{i5i}\){}
for multiple characters in subscripts or superscripts
LaTeX:
$$x_i^2 + y_j^3$$
Output in html:
\[x_i^2 + y_j^3\]
$\sum_{i=1}^n x_i^2$
\(\sum_{i=1}^n x_i^2\)
$$\sum_{i=1}^n x_i^2$$
\[\sum_{i=1}^n x_i^2\]
\frac{numerator}{denominator}
command
LaTeX:
$$\frac{a}{b}$$
Output in html:
\[\frac{a}{b}\]
$$\frac{\sqrt{a^2 + b^2}}{c}$$
\[\frac{\sqrt{a^2 + b^2}}{c}\]
$$\frac{\sum_{i=1}^n x_i}{n}$$
\[\frac{\sum_{i=1}^n x_i}{n}\]
\text{...}
.
LaTeX:
$$y = mx + \text{intercept}$$
Output:
\[ y = mx + \text{intercept} \]
$$P(A) = \frac{\text{Number of favorable outcomes}}{\text{Total outcomes}}$$
\[ P(A) = \frac{\text{Number of favorable outcomes}}{\text{Total outcomes}} \]
align
environment
LaTeX:
$$
\begin{align}
x + y &= 10 \\
x - 3y &= 6
\end{align}
$$
Output in html:
\[ \begin{align} x + y &= 10 \\ x - 3y &= 6 \end{align} \]
LaTeX:
$$SE = \frac{\sigma}{\sqrt{n}}$$
Output in html:
\[SE = \frac{\sigma}{\sqrt{n}}\]
$$z = \frac{x - \mu}{\sigma}$$
\[z = \frac{x - \mu}{\sigma}\]
R07 Slides