View source: R/github_document.R
github_document | R Documentation |
Format for converting from R Markdown to GitHub Flavored Markdown.
github_document(
toc = FALSE,
toc_depth = 3,
number_sections = FALSE,
math_method = "default",
preserve_yaml = FALSE,
fig_width = 7,
fig_height = 5,
dev = "png",
df_print = "default",
includes = NULL,
md_extensions = NULL,
hard_line_breaks = TRUE,
pandoc_args = NULL,
html_preview = TRUE,
keep_html = FALSE
)
toc |
|
toc_depth |
Depth of headers to include in table of contents |
number_sections |
|
math_method |
|
preserve_yaml |
Preserve YAML front matter in final document. |
fig_width |
Default width (in inches) for figures |
fig_height |
Default height (in inches) for figures |
dev |
Graphics device to use for figure output (defaults to png) |
df_print |
Method to be used for printing data frames. Valid values
include "default", "kable", "tibble", and "paged". The "default" method
uses a corresponding S3 method of |
includes |
Named list of additional content to include within the
document (typically created using the |
md_extensions |
Markdown extensions to be added or removed from the
default definition of R Markdown. See the |
hard_line_breaks |
|
pandoc_args |
Additional command line options to pass to pandoc |
html_preview |
|
keep_html |
|
See the online documentation for additional details on using the github_document()
format.
R Markdown output format to pass to render()
Default behavior is to keep any inline equation using $
and any block
equation using $$
in the resulting markdown as Github will process those
using Mathjax. This feature is only available with Pandoc 2.10.1 and above
When using "webtex"
, PNG images with a white background are used by default so
that it shows correctly on Github on both light and dark theme. You can
choose to only output SVG for better quality by changing the URL used:
output: github_document: math_method: engine: webtex url: https://latex.codecogs.com/svg.image?
Background or fonts color cannot be changed for now and your equation may not be visible on dark theme.
Using "webtex"
will be the default with Pandoc 2.0.4 until Pandoc 2.10. Before 2.0.4, Github document output does not support math.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.