Sign inSign up

alexanderlindner/latex

By alexanderlindner

•Updated about 5 years ago

Full latex environment for ci purpose

Image
0

393

alexanderlindner/latex repository overview

⁠Latex docker image

Docker Image Size (latest by date) Docker Pulls

This repo contains a basic dockerfile for a full latex environment, and some examples how to use it.

Features:

  • all dependencies
  • biber / biblatex
  • minted
  • pdflatex / xalatex
  • makeglossaries
  • svg support

⁠Installation

You need docker installed.

⁠Use it (automatic)

Install curl and execute:

bash <(curl -s https://raw.githubusercontent.com/alexander-lindner/latex/master/installer/installer.sh)

Using ./run.sh you will trigger the generation.

You will find the generated main.pdf in the out directory

⁠Use it (manual): docker

Assuming you've got the following structure:

. 
├── out
├── src
│    ├── main.tex
│    └── main.bib
├── run.sh
└── run_in_docker.sh (optional)

add the run.sh and make it executable:

#!/usr/bin/env bash

#run.sh 

docker run --rm -dti --volume $(pwd):/data --user $(id -u):$(id -g) -w="/data/src" alexanderlindner/latex:latest bash -c '/run_in_docker.sh'

Using ./run.sh you will trigger the generation.

You will find the generated main.pdf in the out directory

⁠Use it (manual): docker-compose

Assuming you've got the following structure:

. 
├── out
├── src
│    ├── main.tex
│    └── main.bib
├── docker-compose.yml
├── run.sh
└── run_in_docker.sh (optional)

You can use docker-compose for less configure work:

version: '3.3'
services:
  build:
    image: alexanderlindner/latex:latest
    volumes:
      - ./:/data
    working_dir: /data/src
    command: "bash -c '/run_in_docker.sh'"
    user: ${CURRENT_UID}

Place the run.sh next to the compose file:

#!/usr/bin/env sh

export CURRENT_UID=$(id -u):$(id -g)
docker-compose up build
docker-compose down

Using ./run.sh you will trigger the generation.

You will find the generated main.pdf in the out directory

⁠Use it (manual): additional stuff

If you want to use minted, add the following line to your main.tex:

\usepackage[outputdir=../out]{minted}

If you want to override the generation bash file (run_in_docker.sh), add this file to your root path:

#!/usr/bin/env bash


for OUTPUT in $(find . -type d)
do
  mkdir -p ../out/${OUTPUT}
done


pdflatex -output-directory=../out/ -shell-escape -interaction=nonstopmode main.tex
biber --output-directory=../out/ main
makeglossaries -d ../out/ main
pdflatex -output-directory=../out/ -shell-escape -interaction=nonstopmode main.tex
pdflatex -output-directory=../out/ -shell-escape -interaction=nonstopmode main.tex

and change the compose path from "bash -c '/run_in_docker.sh'" to "bash -c '../run_in_docker.sh'".

Tag summary

Content type

Image

Digest

Size

4.5 GB

Last updated

about 5 years ago

docker pull alexanderlindner/latex