Add latex/tinytex dependencies to GitHub Actions

Finally making the conversion from Travis-CI to GitHub Actions, but am running into errors with tinytex. In particular, my PDF vignette requires certain latex packages which are not part of base tinytex. Is there a way to include these in my R-CMD-check.yaml? For example, I need pdfpages.sty and my the relevant portion (I think) of my R-CMD-check.yaml is listed below:

    steps:
      - uses: actions/checkout@v2
      - uses: r-lib/actions/setup-tinytex@master
      - uses: r-lib/actions/setup-r@v1
        with:
          r-version: ${{ matrix.config.r }}

Have you tried running it as-is? I believe tinytex is supposed to handle installing missing dependencies on its own.

If it doesn't, you can probably just add another step after setting up tinytex to manually install packages, such as:

steps:
  - uses: actions/checkout@v2
  - uses: r-lib/actions/setup-tinytex@master
  - uses: r-lib/actions/setup-r@v1
  - name: add TeX deps
    run: |
      tinytex::tlmgr_install(pkgs = "name")
    shell: Rscript {0}
1 Like

Hi @mattwarkentin, thanks for your swift reply. I had just figured it out, but it looks like it's equivalent to your solution?! I just needed to add some additional lines to install the necessary dependencies:

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

This topic was automatically closed after 45 days. 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.