QUESTION:
In R Markdown, what is the right way to add a LaTeX align
-like environment (with and without equation numbering) which will compile and display for both docx and pdf output?
DETAIL:
Option 1 below is what I'm going with. But I'd still like the option to have equation numbering and not give up that functionality when I move between docx and pdf output.
This compiles and displays in both docx and pdf output. Hooray! But what if I want equation numbering?
\[
\begin{aligned}
AR(p): Y_i &= c + \epsilon_i + \phi_i Y_{i-1} \dots \\
Y_{i} &= c + \phi_i Y_{i-1} \dots
\end{aligned}
\]
This will not compile for pdf or docx output.
\[
\begin{aligned*}
AR(p): Y_i &= c + \epsilon_i + \phi_i Y_{i-1} \dots \\
Y_{i} &= c + \phi_i Y_{i-1} \dots
\end{aligned*}
\]
These compile for both docx and pdf output. But these only display in pdf output.
\begin{align}
AR(p): Y_i &= c + \epsilon_i + \phi_i Y_{i-1} \dots \\
Y_{i} &= c + \phi_i Y_{i-1} \dots
\end{align}
\begin{align*}
AR(p): Y_i &= c + \epsilon_i + \phi_i Y_{i-1} \dots \\
Y_{i} &= c + \phi_i Y_{i-1} \dots
\end{align}
These will compile and display for docx output. But these will not even compile for pdf output.
\[
\begin{align}
AR(p): Y_i &= c + \epsilon_i + \phi_i Y_{i-1} \dots \\
Y_{i} &= c + \phi_i Y_{i-1} \dots
\end{align}
\]
\[
\begin{align*}
AR(p): Y_i &= c + \epsilon_i + \phi_i Y_{i-1} \dots \\
Y_{i} &= c + \phi_i Y_{i-1} \dots
\end{align*}
\]
The following works for me:
I am using the
*
-environments to get unnumbered equations in PDF. To get numbererd equations, you should use the environments without*
and add labels.