Uses pandoc along with several lua filters found at inst/extdata/filters in texor package
Note
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
Examples
# 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()
#> [1] ‘3.1.11’
texor::include_style_file(your_article_path)
#> [1] TRUE
rebib::aggregate_bibliography(your_article_path)
#> No Bib files found !
#> Cannot aggregate bibliography as there is no BibTeX bibliography
#> No Bib files found !
#> BibTeX file does not exist
#> will parse for bibliography
#> bibtex file created
texor::convert_to_native(your_article_path)
#> /usr/local/bin/pandoc +RTS -K512m -RTS /private/var/folders/t_/mmhnh941511_hp2lwh383bp00000gn/T/RtmpQhQvJb/tempdir/article/RJwrapper.tex --to native --from latex --output /private/var/folders/t_/mmhnh941511_hp2lwh383bp00000gn/T/RtmpQhQvJb/tempdir/article/RJwrapper.txt -s --resource-path /private/var/folders/t_/mmhnh941511_hp2lwh383bp00000gn/T/RtmpQhQvJb/tempdir/article/RJwrapper.tex --lua-filter /Users/runner/work/_temp/Library/texor/abs_filter.lua --lua-filter /Users/runner/work/_temp/Library/texor/bib_filter.lua --lua-filter /Users/runner/work/_temp/Library/texor/image_filter.lua --lua-filter /Users/runner/work/_temp/Library/texor/R_code.lua --lua-filter /Users/runner/work/_temp/Library/texor/image_caption.lua --lua-filter /Users/runner/work/_temp/Library/texor/widetable_patcher.lua --lua-filter /Users/runner/work/_temp/Library/texor/table_caption.lua --lua-filter /Users/runner/work/_temp/Library/texor/conversion_compat_check.lua --lua-filter /Users/runner/work/_temp/Library/texor/equation_filter.lua --lua-filter /Users/runner/work/_temp/Library/texor/bookdown_ref.lua --lua-filter /Users/runner/work/_temp/Library/texor/sec_depth.lua --citeproc
#> Detected the following packages from article:
#> CRAN:
#> Bioconductor:
unlink(your_article_folder,recursive = TRUE)