Sign inSign up

gabrielmn/tex-live-docker

By gabrielmn

•Updated about 2 years ago

TeX Live environments on Alpine Linux

Image
Languages & frameworks
0

291

gabrielmn/tex-live-docker repository overview

⁠TeX Live Docker

This repository provides a docker image of TeX Live environments on Alpine Linux, tailored for different use cases.

⁠Available Docker Images

This project builds six different Docker images using a single Dockerfile, each corresponding to a different TeX Live scheme. Additionally, it allows building any combination of installed packages, schemes, and collections as specified by the user (see TeX Live Docker repository⁠ for more information on how to build custom images):

  • minimal: Uses the scheme-minimal, which includes only the most basic components.
  • basic: Uses the scheme-basic, which includes basic plain and LaTeX formats.
  • small: Uses the scheme-small, which includes basic packages along with xetex and metapost.
  • medium: Uses the scheme-medium, which includes more packages and languages.
  • full: Uses the scheme-full, which includes all available packages.
  • cv: Custom image built specifically for curriculum vitae projects, based on the minimal scheme with additional packages.
    • latex-bin
    • ifthenx
    • geometry
    • graphics
    • pgf
    • fontawesome
    • sourcesanspro
    • latex
    • xcolor
    • lastpage
    • fancyhdr
    • hyperref
    • xkeyval
    • ly1
    • etoolbox
    • epstopdf-pkg

    Note: Due to the interaction between tikz (from the pgf package) and lastpage, the lastpage package may not function correctly on the first compilation. It may be unable to access the .aux file, necessitating a second compilation to resolve the issue and generate the final output properly.

⁠Usage

To utilize any of these images, execute them as you would with any standard Docker image. The /project volume is used to share your LaTeX project with the Docker container, and the compiled output will also be placed inside this volume.

For more complex build processes, where a simple pdflatex command or its variations might not be sufficient, consider creating a build.sh script to handle the build process. This script can include multiple LaTeX runs, bibliography generation, and other necessary steps.

Note: The examples provided use pdflatex for compiling documents. However, not all Docker images may include pdflatex. Depending on the TeX Live scheme or additional packages installed, you might need to use other LaTeX engines or adjust your commands accordingly.

⁠Example: Using Docker Images

To use an image, you can run a container using the following command:

docker run --rm -v $(pwd):/project your-docker-registry/texlive:<image_tag> pdflatex /project/main.tex

Replace <image_tag> with one of the following:

  • minimal
  • basic
  • small
  • medium
  • full
  • cv
⁠Example: Build Script

Note: Ensure you use a POSIX-compliant shell (like sh). Scripts written in bash or other shells may not work as expected.

Create a build.sh script in your project directory:

#!/bin/sh

# Run pdflatex multiple times if needed
pdflatex /project/main.tex
bibtex /project/main
pdflatex /project/main.tex
pdflatex /project/main.tex

Make sure to give execute permissions to your script:

chmod +x build.sh

Then, run the script inside the Docker container:

docker run --rm -v $(pwd):/project your-docker-registry/texlive:<image_tag> /project/build.sh

Replace <image_tag> with one of the following:

  • minimal
  • basic
  • small
  • medium
  • full
  • cv
⁠Example: Docker Compose

You can also use Docker Compose to manage your LaTeX projects.

Create a docker-compose.yml file:


services:
  latex:
    image: your-docker-registry/texlive:<image_tag>
    volumes:
      - .:/project
    command: /project/build.sh

Replace <image_tag> with one of the following:

  • minimal
  • basic
  • small
  • medium
  • full
  • cv

Run the Docker Compose setup:

docker-compose up

Tag summary

Content type

Image

Digest

sha256:2217dc27b…

Size

2 GB

Last updated

about 2 years ago

docker pull gabrielmn/tex-live-docker:full