GitHub Actions TeX

I am just getting started with GitHub Actions. I used usethis::use_github_actions() and the resulting workflow seems substantially more complex than Travis. I assumed that would generate reasonable settings.

Unfortunately, I am getting some vignette building errors. I think it's all due to TeX, since it says "You don't have a working TeX binary (tex) installed anywhere in your PATH".

Is there a way to install TeX? Is there a reason why this isn't included in the default config?

Hi Igor,

why don't you try installing tinytex? https://yihui.org/tinytex/ According to your description I believe this should solve your problem.

These three lines should do it:

install.packages("tinytex")
library(tinytex)
install_tinytex()

Noelia

The solution is to add:
- uses: r-lib/actions/setup-tinytex@master
You can see an example in the pkgdown workflow. It's not included by default because it's not required by Rmd documents.
There are a number of actions available at r-lib/actions.

Thanks a lot for this useful advice.
I was able to manage now the package installation using github action.
The vignettes of my package require additional tex style sheets. Which in rstudio I do add by using:

> tinytex::parse_install( text = "! LaTeX Error: File `ctable.sty' not found.")
tlmgr search --file --global "/ctable.sty"
tlmgr install ctable

I have tried to find other projects that also have vignettes and github actions but I was unable to find these.

Any idea on how to add these style sheets in Github actions?

Add this to R-CMD-check.yaml

'- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
tinytex::parse_install( text = "! LaTeX Error: File ae.sty' not found.") tinytex::parse_install( text = "! LaTeX Error: File footmisc.sty' not found.")
tinytex::parse_install( text = "! LaTeX Error: File ctable.sty' not found.") tinytex::parse_install( text = "! LaTeX Error: File grfext.sty' not found.")
shell: Rscript {0}

1 Like

That would be R code, not YAML for GitHub Actions.