title: Consistent math equation numbering in bookdown across pdf, docx, html output
body: <p>In bookdown, is there a LaTeX math environment which numbers each equation, regardless of whether the ouptut is .pdf, .docx, .html? Adding this LaTeX:</p>
  
  <pre><code>\begin{align}
     X &amp;= Y \\
     Z &amp;= W
  \end{align}
  </code></pre>
  
  <p>Into the <a href="https://github.com/rstudio/bookdown-demo" rel="nofollow noreferrer">bookdown-demo</a> outputs the following:</p>
  
  <p><strong>PDF:</strong> works as expected. </p>
  
  <p><a href="https://i.stack.imgur.com/3QwMH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3QwMH.png" alt="pdf"></a></p>
  
  <p><strong>DOCX:</strong> missing equation numbers. </p>
  
  <p><a href="https://i.stack.imgur.com/WHGpA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WHGpA.png" alt="docx"></a></p>
  
  <p><strong>HTML:</strong> missing equation numbers.</p>
  
  <p><a href="https://i.stack.imgur.com/OiV4Z.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OiV4Z.png" alt="gitbook"></a></p>
  
  <p>Notes: </p>
  
  <ul>
  <li>The output was generated using <code>pdf_book</code>, <code>word_document2</code>, <code>gitbook</code>.  </li>
  <li>This is related to an unanswered question of mine: <a href="https://stackoverflow.com/questions/47912278/align-environment-in-r-markdown-which-works-for-both-docx-and-pdf-output">Align environment in R Markdown which works for both docx and pdf output?</a></li>
  </ul>
  
  <p><strong>UPDATE:</strong> Merging Ralf's answer below along with other learnings of mine, in bookdown, the following all work consistently and as expected across .pdf, .docx, .html output.</p>
  
  <pre><code>Add a single un-numbered equation:
  
  \begin{equation*}
    X = Y
  \end{equation*}
  
  Add a single numbered equation:
  
  \begin{equation}
    X = Y
    (\#eq:eq02)
  \end{equation}
  
  I refer to previous, equation \@ref(eq:eq02).
  
  Add multiple un-numbered equations:
  
  \begin{align*}
    X &amp;= Y \\
    Z &amp;= W   
  \end{align*}
  
  Add multiple equations with numbering for each:
  
  \begin{align}
    X &amp;= Y (\#eq:eq05)\\
    Z &amp;= W (\#eq:eq06)  
  \end{align}
  
  I refer to previous, equation \@ref(eq:eq05) and equation \@ref(eq:eq06).
  
  Add multiple equations with a single numbering for all:
  
  \begin{equation}
     \begin{aligned}
        X &amp;= Y \\
        Z &amp;= W   
     \end{aligned}
     (\#eq:eq04)
  \end{equation}
  
  I refer to previous, equation \@ref(eq:eq04).
  </code></pre>