Search code examples
r-markdownpdflatextinytex

Align equations already created with {equation*}?


I think this is simple.

I am using LaTeX in Rmarkdown, with the amsmath package. I am using \begin{equation} XX \end{equation} so that I can label my equations throughout the document.

However, I have a set of equations that I would like aligned for simplicity. I have tried the following:

\begin{align*}
\begin{equation}
\frac{dF}{dt} &= - j_{FI}
\end{equation} \\
\begin{equation}
\frac{dV}{dt} &= j_{VG}
\end{equation} 
\end{align*}

But it won't run. I get the following error: LaTeX Error: Bad math environment delimiter. I can either align{} or do equation{} but not both. Any insight?


Solution

  • By adding a * to the normal align environment, you remove the numbering and possibility to use labels. Just don't do that if you want to label your expressions:

    \documentclass{article}
    
    \usepackage{amsmath}
    
    
    \begin{document}
    
    \begin{align}
    %\begin{equation}
    \frac{dF}{dt} &= - j_{FI}\label{eq1}
    %\end{equation} 
    \\
    %\begin{equation}
    \frac{dV}{dt} &= j_{VG}\label{eq2}
    %\end{equation} 
    \end{align}
    
    
    \ref{eq1}
    
    
    \ref{eq2}
    
    \end{document}
    

    enter image description here