View source: R/article-tools.R
convert_to_markdown | R Documentation |
Uses pandoc along with several lua filters found at inst/extdata/filters in texor package
convert_to_markdown(
article_dir,
kable_tab = TRUE,
autonumber_eq = FALSE,
fig_in_r = TRUE
)
article_dir |
path to the directory which contains tex article |
kable_tab |
converts to kable table instead of markdown tables |
autonumber_eq |
whether to autonumber the equations, default is FALSE |
fig_in_r |
whether to include figures in R code chunks, default is TRUE |
convert latex(wrapper) file to markdown
creates a converted markdown file, as well as a pkg_meta.yaml file
pandoc (along with lua interpreter) is already installed with R-studio, hence if not using R-studio you will need to install pandoc. https://pandoc.org/installing.html
Use pandoc version greater than or equal to 3.1
Kable tables will work for simple static data, any math / code / image within any table will send the package into fallback mode (normal markdown tables) for the rest of tables in the article.
# Note This is a minimal example to execute this function
article_dir <- system.file("examples/article",
package = "texor")
dir.create(your_article_folder <- file.path(tempdir(), "tempdir"))
x <- file.copy(from = article_dir, to = your_article_folder,recursive = TRUE,)
your_article_path <- paste(your_article_folder,"article",sep="/")
rmarkdown::pandoc_version()
texor::include_style_file(your_article_path)
rebib::aggregate_bibliography(your_article_path)
texor::convert_to_markdown(your_article_path)
unlink(your_article_folder,recursive = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.