Skip to content

Commit

Permalink
more documentation in table reference
Browse files Browse the repository at this point in the history
  • Loading branch information
huizezhang-sherry committed Jan 3, 2024
1 parent 72734b3 commit b453331
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion vignettes/format-details.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,13 @@ Alt text is read by a screen reader for people with visual disability and author

# Tables

To use a simple markdown table, you need to add `preamble: \usepackage{longtable}` in the YAML for the tex file to render the pdf output. Another option is to use `knitr::kable()`, where you need to set up two chunks similar to the figures with different `format` arguments:
For simple markdown tables, please use the rmarkdown syntax for cross-referencing, i.e.

* in-line: ````The table \@ref(tab:foo) summarizes ...````

* markdown table caption: ````Table: (\#tab:foo) An overview of the ...````

For tables generated using `knitr::kable()`, set up two chunks similar to the figures with different `format` arguments:

````rmarkdown
`r ''````{r penguins-interactive, eval = knitr::is_html_output()}
Expand Down

0 comments on commit b453331

Please sign in to comment.