texor

Converting 'LaTeX' 'R Journal' Articles into 'RJ-web-articles'

https://github.com/abhi-1u/texor

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (18.9%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Converting 'LaTeX' 'R Journal' Articles into 'RJ-web-articles'

Basic Info
Statistics
  • Stars: 8
  • Watchers: 2
  • Forks: 4
  • Open Issues: 12
  • Releases: 13
Created about 4 years ago · Last pushed 10 months ago
Metadata Files
Readme Changelog License

readme.Rmd

---
output: github_document
editor_options:
  markdown:
    mode: gfm
---



```{r setup, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/",
  out.width = "100%"
)
```

# texor texor package hex sticker with icons showing transistion from PDF documents to web pages.


[![CRAN/METACRAN](https://img.shields.io/cran/v/texor?color=blue&style=for-the-badge)](https://cran.r-project.org/package=texor)
[![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/Abhi-1U/texor/pkg_down.yaml?branch=main&label=pkgdown&style=for-the-badge)](https://github.com/Abhi-1U/texor/actions/workflows/pkg_down.yaml)
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/Abhi-1U/texor/cmdcheck.yaml?branch=main&label=R-CMD-CHECK&style=for-the-badge)](https://github.com/Abhi-1U/texor/actions/workflows/cmdcheck.yaml)
[![GitHub R package version (subdirectory of monorepo)](https://img.shields.io/github/r-package/v/Abhi-1U/texor?filename=DESCRIPTION&label=texor&logo=github&color=navy&style=for-the-badge)](https://github.com/Abhi-1U/texor/blob/master/DESCRIPTION)
![Github Issues](https://img.shields.io/github/issues/Abhi-1U/texor?color=orange&logo=github&logoColor=&style=for-the-badge)
[![codecov](https://img.shields.io/codecov/c/gh/Abhi-1U/texor?style=for-the-badge&logo=codecov)](https://codecov.io/gh/Abhi-1U/texor)


The R package texor will ease your LaTeX R Journal / Sweave article migration to web format by providing tools and utilities.

## Installation

Install pandoc v3.1 or greater, ideally latest version. 
If you are using Rstudio, it should be pre-installed.


```r
# To check the version of pandoc
rmarkdown::pandoc_version()
# or to simply check if you are good to go in terms of pandoc
texor::pandoc_version_check()
# TRUE if pandoc is good to go, else FALSE
```

For included PDF conversions also install poppler-utils (used with pdftools package) 
Ideally install the latest version of poppler-utils.


Install the mainline version from CRAN with:
```r
install.packages('texor')
```

Install the development version from GitHub with:

``` r
# install.packages("remotes")
remotes::install_github("Abhi-1U/texor")
# install.packages("pak")
pak::pak("Abhi-1U/texor")
```

## General Usage

#### R Journal articles

 here is a quick example to use texor package with a sample RJournal article
(included with the package [inst/article](https://github.com/Abhi-1U/texor/tree/master/inst/examples/article))

``` r
# for a single LaTeX article 
texor::latex_to_web(article_dir)
```
```r
# A running example
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="/")
# view your original article at
your_article_path
texor::latex_to_web(your_article_path,..)
# view  your converted and original article at
paste0(your_article_path,"/web")
```

#### Sweave articles

Similar to the conversion of R journal articles, pass the file path(instead of the folder path) to the function.

```r 
texor::rnw_to_rmd(file_path,..) 
# Additionally you can set the options to modify the end result as per your needs.
```

## Using texor over multiple files
```
# for multiple articles in RJ folder structure
#base dir 
article_dir <- "C:/Users/abhis/path/to/base"
# list of journal number directories
journal_dirs <- list.dirs(article_dir,recursive = FALSE)
# list of individual slug directories
slug_dirs <- lapply(journal_dirs,function(journal_dir) {
    list.dirs(journal_dir,recursive = FALSE)
})
# creating a single list of all slug directories
slug_dirs <- unlist(slug_dirs)
# Calling 
for (dir in slug_dirs) {
    #print(dir)
    getwd()
    # below function will create a log file of success/error in current
    # working directory while running the texor::latex_to_web() function
    texor:::convert_to_html(dir)
}
```

Owner

  • Name: Abhishek Ulayil
  • Login: Abhi-1U
  • Kind: user

GitHub Events

Total
  • Create event: 2
  • Release event: 1
  • Issues event: 5
  • Watch event: 2
  • Issue comment event: 2
  • Push event: 33
  • Pull request event: 1
  • Gollum event: 1
  • Fork event: 1
Last Year
  • Create event: 2
  • Release event: 1
  • Issues event: 5
  • Watch event: 2
  • Issue comment event: 2
  • Push event: 33
  • Pull request event: 1
  • Gollum event: 1
  • Fork event: 1

Packages

  • Total packages: 1
  • Total downloads:
    • cran 507 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 7
  • Total maintainers: 1
cran.r-project.org: texor

Converting 'LaTeX' 'R Journal' Articles into 'RJ-web-articles'

  • Versions: 7
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 507 Last month
Rankings
Downloads: 19.4%
Forks count: 21.5%
Stargazers count: 26.0%
Average: 26.4%
Dependent packages count: 28.3%
Dependent repos count: 36.9%
Maintainers (1)
Last synced: 10 months ago

Dependencies

.github/workflows/cmdcheck.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pkg_down.yaml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
DESCRIPTION cran
  • logger * imports
  • pdftools * imports
  • rmarkdown * imports
  • stringr * imports
  • tinytex * imports
  • tools * imports
  • xfun * imports
  • yaml * imports
  • knitr * suggests
  • testthat >= 3.0.0 suggests