Abhi-1U / texor

Converting 'LaTeX' 'R Journal' Articles into 'RJ-web-articles'
https://abhi-1u.github.io/texor/
Other
7 stars 2 forks source link

rnw_to_rmd: converting vignettes using jss.cls #77

Closed hturner closed 3 months ago

hturner commented 4 months ago

Currently when converting vignettes using the jss document class, via

\documentclass[nojss]{jss}

commands defined in jss.cls are not respected. I tried copying this file into the same directory as the .Rnw file, via

jss_cls <- file.path(Sys.getenv("R_HOME"), "share/texmf/tex/latex/jss.cls")
file.copy(jss_cls, article_dir)

but this still didn't work, perhaps because it is a document class rather than a LaTeX package.

Can rnw_to_rmd() be adapted to use commands from the document class? If not, we might ship a simple jss.sty with the texor package that could be used when converting JSS vignettes, or add the main commands to the Metafix.sty.

There are only a few main commands: \proglang, \pkg and \code. rnw_to_rmd() converts \pkg{packagename} to *packagename* rather than **packagename** and \code{expression} is correctly converted to `expression`, but \proglang{R} is just dropped so this is particularly problematic.