Consistent math equation numbering in bookdown across pdf, docx, html output
For equation numbering support in bookdown
you need to assign labels. the following works for me:
---
output:
bookdown::html_document2: default
bookdown::word_document2: default
bookdown::pdf_document2: default
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
\begin{equation}
\begin{aligned}
X &= Y \\
Z &= W
\end{aligned}
(\#eq:eq1)
\end{equation}
\begin{align}
X &= Y (\#eq:eq2) \\
Z &= W (\#eq:eq3)
\end{align}
See Equation \@ref(eq:eq1) or Equations \@ref(eq:eq2) and \@ref(eq:eq3).
HTML Output:
PDF output is similar. Word output as seen in LibreOffice is pretty bad, but the equation numbers including references are there. So I guess this is a local or LibreOffice specific problem.
auto-number equations in R markdown documents in RStudio
You can use \notag
or \nonumber
on an expression to prevent an automatic tag from being applied to it. So if you are using autoNuber: "all"
, you can do
$$E=mc^2\nonumber$$
to get the equation with no number.
Related Topics
How to Get Covariance Matrix for Random Effects (Blups/Conditional Modes) from Lme4
Independently Move 2 Legends Ggplot2 on a Map
R Dplyr Filter Based on Matching Search Term with First Words of Any Work in Select Columns
Shiny - How to Change the Font Size in Select Tags
How to Print the Name of Current Row When Using Apply in R
R Data.Table Join: SQL "Select *" Alike Syntax in Joined Tables
Knitr: Object Cannot Be Found When Converting Markdown File into HTML
Get(X) Does Not Work in R Data.Table When X Is Also a Column in the Data Table
Ggsave Png Error with Larger Size
How to Make Shinyapp to Use Environmental Variables When Deployed on the Web
Stacking an Existing Rasterstack Multiple Times
Is There a Command Similar to Matlab's "Close All" in R? (How to Close All Graphics Devices)
Why Do Rapply and Lapply Handle Null Differently
Specify Function Parameters in Do.Call
Syntax Highlighting for Python Chunks Does Not Work
Adding Shade to R Lineplot Denotes Standard Error
How to Scale the Size of Line and Point Separately in Ggplot2