rjournal / rjtools

Tools for AUTHORS to use for checking and submitting articles to the R Journal
https://rjournal.github.io/rjtools/
Other
31 stars 14 forks source link

inconsistency in pdf and html render #26

Closed huizezhang-sherry closed 2 years ago

huizezhang-sherry commented 2 years ago

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 pdf

Caption and label for markdown table:

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:

Screen Shot 2022-01-12 at 12 18 57 pm

but not in pdf:

Screen Shot 2022-01-12 at 12 23 12 pm

Reference and numbering equation

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} 

is properly rendered in html:

Screen Shot 2022-01-12 at 3 42 18 pm

but not in pdf:

Screen Shot 2022-01-12 at 3 42 35 pm

The html syntax should work with bookdown::pdf_document2.

huizezhang-sherry commented 2 years ago

add preamble: \usepackage{longtable} in the YAML for tables