niccokunzmann / ci-latex

A docker container for Gitlab CI to build papers with Latex

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ci-latex

build-image

A docker container for Gitlab CI to build with Latex.

This container builds monthly. It uses the full, current texlive installation.

Dockerhub

You can find this container at niccokunzmann/ci-latex. You can pull it with

docker pull niccokunzmann/ci-latex

Local Build

You can build the container yourself using the docker command:

docker build -t niccokunzmann/ci-latex .

Local Latex

Suppose you are in the console in the folder where your paper.tex should be built, so ls shows paper.tex. Run this, to build the file.

 docker run -v "`pwd`:/thesis" --rm -it niccokunzmann/ci-latex  bash -c 'cd thesis; pdflatex paper.tex'

Gitlab

You can use the container in your runner like this:

image: niccokunzmann/ci-latex

Example .gitlab-ci.yml

If you paper is in the root folder of the repository and named paper.tex, your .gitlab-ci.yml can look like this:

image: niccokunzmann/ci-latex

stages:
  - deploy

expose:
  stage: deploy
  script:
  - pdflatex -interaction=nonstopmode -halt-on-error paper.tex
  artifacts:
    paths:
    - paper.pdf

See the documentation for how to change your .gitlab-ci.yml.

GitHub

Example .travis.yml derived from 12 characters translations. We assume that there is a file names paper.tex at the root of your repository.

language: ruby

services:
  - docker

before_install:
  - docker pull niccokunzmann/ci-latex

script:
  - docker run -v "`pwd`:/thesis" --rm -it niccokunzmann/ci-latex  bash -c 'cd thesis; pdflatex paper.tex'

deploy:
  provider: releases
  api_key:
    secure: "... secure api key https://stackoverflow.com/a/12778315 ..."
  file:
    - paper.pdf
  skip_cleanup: true
  on:
    branch: master

Failing build and update of this repository

If the repository build fails, this can be due to an outdated installation.profile. You can get the installation commands from the Dockerfile, create the texlive.profile and then copy it over the installation.profile.

Related Work

About

A docker container for Gitlab CI to build papers with Latex

License:MIT License


Languages

Language:Dockerfile 100.0%