Reproducible Science with LATEX
Volume 19, Issue 1 (2021), pp. 111–125
Pub. online: 28 January 2021
Type: Computing In Data Science
Received
1 August 2020
1 August 2020
Accepted
1 November 2020
1 November 2020
Published
28 January 2021
28 January 2021
Abstract
This paper proposes a procedure to execute external source codes from a LATEX document and include the calculation outputs in the resulting Portable Document Format (pdf) file automatically. It integrates programming tools into the LATEX writing tool to facilitate the production of reproducible research. In our proposed approach to a LATEX-based scientific notebook the user can easily invoke any programming language or a command-line program when compiling the LATEX document, while using their favorite LATEX editor in the writing process. The required LATEX setup, a new Python package, and the defined preamble are discussed in detail, and working examples using R, Julia, and MatLab to reproduce existing research are provided to illustrate the proposed procedure. We also demonstrate how to include system setting information in a paper by invoking shell scripts when compiling the document.
Supplementary material
Supplementary MaterialDetailed examples and documentation are available in a GitHub repository at https://github.com/Ossifragus/runcode. The runcode LATEX package is available via CTAN, and the talk2stat Python package for the server-mode is available at https://pypi.org/project/talk2stat/.