Skip to content

Converting past R Journal articles to HTML

Abhishek Ulayil edited this page Apr 16, 2022 · 9 revisions

Background

The R Journal is the open access, refereed journal of the R project for statistical computing. Since it began in 2009, articles have been created in PDF, using LaTeX to convert marked up plain text to the final version with the formatted text, tables, figures, etc. Over the past year, the R Journal has been developing a new website, with the option to publish articles in HTML format (https://journal.r-project.org/dev/). This means that authors can include interactive graphics and animations in their articles. The HTML format is also easier to browse online and more accessible for users of assistive tools and technologies such as screen readers. However, most published articles are only available as PDF. This project will work on converting published articles to HTML.

Related work

The rjtools package, developed by the R Journal team, provides an R markdown template that allows articles to be created in both PDF and HTML. This a big step forward, but it only provides a solution for new submissions, where the authors have chosen to use the R markdown template. This project will focus on creating an HTML version, based on the LaTeX source files and metadata.

Details of your coding project

The contributor will code functions to convert .tex files to .HTML files in the R Journal style. This is expected to involve conversion to markdown via Pandoc in the first instance, then custom functions to convert the markdown to R markdown using the rjtools template. These functions will be added to the rjtools package, or a separate package, with appropriate documentation and tests. The contributor will also work on converting articles and addressing issues that come up in particular cases.

Expected impact

This project will play a significant role in helping the R Journal prepare its development website for production. Since this development website is already public, there will be an immediate impact for any articles that are converted under this project.

Mentors

Contributors, please contact mentors below after completing at least one of the tests below.

  • EVALUATING MENTOR: Heather Turner [email protected] is a past editor of the R Journal, who contributed to its infrastructure during her time on the editorial board. She is author of several CRAN packages, notably the statistical modelling packages gnm, BradleyTerry2 and PlackettLuce. She was a GSoC co-mentor in 2021.
  • CO-MENTOR: Di Cook [email protected] is currently executive editor, and past editor-in-chief, of the R Journal. She has made the style changes to deliver the journal articles in both html and pdf, and is keen to see the archives converted to html also. She is an author of numerous R packages, and has been a GSoC co-mentor on more than 10 successful projects.

Tests

Contributors, please do one or more of the following tests before contacting the mentors above.

  • Easy: Follow the instructions on the R Journal development website to create a short example article with the new R markdown template, that produces both HTML and PDF versions. You should replace the existing example content with new content, for example a brief demonstration of an R package you're familiar with, updating all headings, references, etc. You should update the YAML metadata as well, but do not need to use real people or affiliations.
  • Medium: Write an R function, or set of R functions to do the following:
    1. Convert RJwrapper.tex to markdown using rmarkdown::pandoc_convert().
    2. Programmatically edit the .md file to add a YAML header, with the following fields
      • title: specified via an argument to your function
      • bibliography: specified via an argument to your function
      • output: set to rjtools::rjournal_web_article
    3. Save the updated file as an .Rmd file in a new outputs directory.
    4. Copy files required for rendering the new .Rmd (any images and .bib files) to the new outputs directory.
    5. Compile the updated .Rmd file to produce an HTML output. Show how to use your R code to create an HTML article in the R Journal style from the LaTeX source files of one of the example articles. Include the output in your solutions repository.
  • Hard: Put your R function or functions in a package, with sufficient documentation to pass R CMD check --as-cran. Write a vignette based on the R Journal LaTeX template files to show how to convert from the LaTeX sources to an HTML article using your functions.

Solutions of tests

Contributors, please post a link to your test results here.