Issue Executing `rmarkdown::render()` Repeatedly

I have recently installed TinyTex on my RStudio Server Open platform. While users are able to successfully knit their .Rmd files using the RStudio UI, we are running into issues using rmarkdown::render() under specific circumstances.

The environment is:

  • R version 4.1.2
  • RStudio 2021.09.2+382 "Ghost Orchid" Release (fc9e217980ee9320126e33cdf334d4f4e105dc4f, 2022-01-04) for CentOS 8
  • Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0
  • TeX 3.141592653 (TeX Live 2022)
  • kpathsea version 6.3.4
  • rmarkdown 2.11
  • knitr 1.37
  • tinytex 0.36

From a fresh R session, rmarkdown::render() works perfectly fine when rendering an .Rmd file into a .pdf file:


rmarkdown::render("~/My_Project/my_report.Rmd")

However, when attempting to render the exact same file in the same session as before - without the environment explicitly changing - I receive the following error.


! Undefined control sequence.
<argument> >{\raggedright \arraybackslash 
                                          }p{.5in}|>{\raggedright \arrayback...
l.78 ...edright\arraybackslash}p{1in}|l|r|l|l|l|l}

What is causing this issue? It seems the process is running into issues when the .tex file is generated, as I see the following issues when trying to compile the .tex file into .pdf on repeated attempts:

Restarting the R session and deleting the files results in a successful rmarkdown::render(). I am also executing in a home directory, so I have full read/write permissions.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.