Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How production safe is knitting to PDF

I have a production linux server that knits daily an important markdown report from a database to PDF. The aesthetics of the PDF report have been tweaked to the finest detail and work now in a production environment as expected without issues.

I am wondering how production safe is this construction. When using the same rmarkdown document, is there any scenario (knitr package upgrades, pdflatex package upgrades, server packages upgrades, dependencies upgrades, tex upgrades) that would lead to different output results (mostly in terms of markdown/latex/pdf formatting)?

If there is a significant risk for changes in the output document due to updates or upgrades of packages, I am wondering if I should freeze and containerize this process.

like image 275
ECII Avatar asked Oct 19 '25 02:10

ECII


2 Answers

There is always a risk. Packages can (will) change and might have breaking effects on your report. I would advice to containerize your R version and packages used. You can use the package packrat or renv for this.

Next you need to have a test server or docker environment available to test any upgrades to any package or R version to see if anything breaks. If not, you could upgrade production environment.

like image 51
phiver Avatar answered Oct 20 '25 17:10

phiver


The latex kernel and many packages are actively developed. If you are using a standard documentclass without much customisation, chances are good that the latex team and package maintainer try to keep their changes backwards compatible, but the more customisation you have, the bigger the chances that things might alter your output.

An anecdote from a year or so ago: the latex team made some changes to the internal handling of margins. They adapted the default classes accordingly. However the tikz code for shadings relied on the old code and thus all shadings in tikz where shifted to the left. This lead to beamer bullet points to be placed outside the margins and thus no longer visible. Users had to wait for a new tikz update to fix this until they got their bullet points back. ...

In summary: things can easily break in locations the maintainers and/or you don't expect. If your document must look the same, freeze the latex version.

like image 34
samcarter_is_at_topanswers.xyz Avatar answered Oct 20 '25 16:10

samcarter_is_at_topanswers.xyz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!