Closed huizezhang-sherry closed 2 years ago
In fig.cap="This is a plot created by **ggplot** and \\textbf{ggplot}.", **ggplot**only works for html while \\textbf{ggplot} only works for pdf
fig.cap="This is a plot created by **ggplot** and \\textbf{ggplot}."
**ggplot**
\\textbf{ggplot}
This is Table \@ref(tab:mytable) | var1 | var2 | Var3 | |-------|-------|------| | 1 | 2 | 3 | | 6 | 5 | 4 | Table: (\#tab:mytable) The caption of mytable
is properly rendered in html:
but not in pdf:
Similar issue with equations:
In equation \@ref(eq:binom), ... \begin{equation} f\left(k\right) = \binom{n}{k} p^k\left(1-p\right)^{n-k} (\#eq:binom) \\ \end{equation}
The html syntax should work with bookdown::pdf_document2.
bookdown::pdf_document2
add preamble: \usepackage{longtable} in the YAML for tables
preamble: \usepackage{longtable}
To bold a keyword in the caption
In
fig.cap="This is a plot created by **ggplot** and \\textbf{ggplot}."
,**ggplot**
only works for html while\\textbf{ggplot}
only works for pdfCaption and label for markdown table:
is properly rendered in html:
but not in pdf:
Reference and numbering equation
Similar issue with equations:
is properly rendered in html:
but not in pdf:
The html syntax should work with
bookdown::pdf_document2
.