8

I want to use travis-ci on my project on github, a MWE of which is available here.

I am using the following .travis.yml file, following the steps given in this Minimal CI LaTeX builder site.

before_install:
- sudo apt-get update -qq
- sudo apt-get install texlive-latex-base
script:
- mkdir build
- pdflatex -output-directory build Example.tex
deploy:
  provider: releases
  api_key:
    secure: <mykey>
  file: Example.pdf
  skip_cleanup: true
  on:
    repo: HughParsonage/travis-latex-ci

However, when I push a commit, I get the error scrreprt.cls not found.

I tried changing the installation to sudo apt-get install texlive-latex-extra, but I then get the error adjustbox.sty not found.

I understand these errors – the TeX Live distribution I requested travis use does not have the packages/class files I need, but not how to resolve them through a .travis.yml file. I understand I could put the respective .cls/.sty files in the same directory until I get no build errors. However, is there a way to get all these packages on the travis machine?

11
  • scrreport is most likely not included in tex-live-base. I would recommend to do a standard installation of TeX Live that contains everything. Sep 10, 2016 at 4:43
  • OK, I thought that sudo apt-get install texlive-latex-extra achieved that, but I still get additional packages. What should I put after sudo apt-get install?
    – Hugh
    Sep 10, 2016 at 4:51
  • Does a normal TeX file using the class get compiled? I never heard of adjustbox.sty. What I generally recommend is not tu use the distribution LaTeX but rather to get TeX Live from tug.org. Sep 10, 2016 at 5:04
  • 2
    After a long way of testing i found a easy way, using the R-template for travis. This comes with the regular Texlive-distribution and you can install Packets using tlmgr. Have a look at here: github.com/circuitikz/circuitikz/blob/master/.travis.yml
    – sistlind
    Sep 10, 2016 at 6:57
  • 2
    Well, you have to provide your own build script. The hint for this travis-file was just for the installation of packages. Have a look at the Makefile of the repository and the deploy.sh file, respectively. There you can find the build commands.
    – sistlind
    Sep 11, 2016 at 6:46

1 Answer 1

7
+200

On a local system it's possible to simply install 'all of TeX Live' and avoid these issues. With a remote test system, where you need to minimise installation size, that is more difficult. (Yes, Travis-CI will cache installed packages but asking for all of TeX Live is probably somewhat extreme.)

As discussed in How do I install an individual package on a Linux system?, it is possible to look up which Ubuntu package contains which .sty file (or similar) and thus to debug these issues. However, that is still probably somewhat error prone in running on a 'live' system. I'd therefore recommend setting up a virtual machine which matches the CI system you've chosen: for example, Travis-CI currently use Ubuntu 12.04 LTS. You can then test 'locally' (and with access to logs, etc.) exactly which packages do and do not need to be installed to make things work.

As noted in comments, for LaTeX3 development we have set up Travis-CI, but use a script which installs 'vanilla' TeX Live rather than using the Ubuntu packaged version. The considerations working this way are much the same: selection of TeX packages which are required with omission of others. There is no real difference in this sense between testing programming and testing documents: it is still a question of working out what is needed and installing it.

3
  • 1
    Do you have any advice how to drive the installation to test biber as well? I've tried sudo apt-get install texlive-bibtex-extra and sudo apt-get -y install biber.
    – Hugh
    Sep 18, 2016 at 10:35
  • @Hugh The Ubuntu version used by Travis-CI (TL'09) doesn't include Biber. You'll therefore have to go down the 'install vanilla TL' route to test anything that needs this.
    – Joseph Wright
    Sep 18, 2016 at 10:42
  • See github.com/latex3/latex3/blob/master/articles/tb114wright.ltx for the source of a TUGboat I've written on this
    – Joseph Wright
    Sep 18, 2016 at 11:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .