• Stars
    star
    583
  • Rank 76,663 (Top 2 %)
  • Language Makefile
  • License
    MIT License
  • Created almost 10 years ago
  • Updated almost 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Docker-based latex compilation

Latex docker container Docker hub

This container helps compiling latex sources without the need to install all latex packages on your system.

Why should I use this container?

  • Easy setup, compile immediately after image download
  • Preserves UID and GID of local user
  • Use container like local command: latexdockercmd.sh pdflatex main.tex
  • Multiple distributions like ubuntu's texlive-full to cover all needs

Versions

All versions are based on Ubuntu: (See all tags)

If you need...

  • ...the most-stuff-works-out-of-the-box package, try blang/latex:ubuntu.
  • ...the most recent version of everything, try blang/latex:ctanfull.
  • ...a stable base for your custom texlive build, try blang/latex:ctanbasic.

For stability, choose a more specific version tag (See all tags)

Quick Setup

Compile latex sources using docker:

# Change to your project
cd my_latex_project

# Download the command wrapper and make it executable
wget https://raw.githubusercontent.com/blang/latex-docker/master/latexdockercmd.sh
chmod +x latexdockercmd.sh

# Optional: Change the version (see above, default blang/latex:ubuntu)
edit ./latexdockercmd.sh

# Compile using pdflatex (docker will pull the image automatically)
./latexdockercmd.sh pdflatex main.tex

# Or use latexmk (best option)
./latexdockercmd.sh latexmk -cd -f -interaction=batchmode -pdf main.tex
# Cleanup: ./dockercmd.sh latexmk -c or -C

# Or make multiple passes (does not start container twice)
../latexdockercmd.sh /bin/sh -c "pdflatex main.tex && pdflatex main.tex"

Requirements

First, add your local user to docker group (should already be the case):

sudo usermod -aG docker YOURUSERNAME

The latexdockercmd.sh will use your current user and group id to compile.

Daemon setup

If you're working on source in latex, you might want to compile it multiple times and don't want to start a container each time.

cd my_latex_source

# Start a daemon container on this path, it accepts commands from latexdockerdaemoncmd.sh
latexdockerdaemon.sh

# Execute the command in the daemon container, only the daemon container is running
latexdockerdaemoncmd.sh pdflatex main.tex

# Stop the daemon
docker stop latex_daemon

Customize

If software is missing, extend this base image with your own software:

Create a Dockerfile or download Dockerfile.blueprint for examples:

FROM blang/latex:ubuntu

# Minted + Pygments
RUN tlmgr install minted

Build your custom image:

docker build -t mycustomlateximg .

Edit latexdockercmd.sh to use your image mycustomlateximg.

Latex Make

Clean build using latexmk:

mkdir compile
latexmk -cd -f -jobname=output -outdir=./compile -auxdir=./compile -interaction=batchmode -pdf ./main.tex

Use latexmkrc in your project root:

# Example: Make glossaries
add_cus_dep( 'glo', 'gls', 0, 'makeglo2gls' );
sub makeglo2gls {
    system("makeindex -s \"$_[0].ist\" -t \"$_[0].glg\" -o \"$_[0].gls\" \"$_[0].glo\"" );
}

CTAN Packages

A list of available ctan packages can be found here: http://mirror.ctan.org/systems/texlive/tlnet/archive

Install texlive packages:

RUN tlmgr install minted

Contribution

If the image is missing a package only specific for you, please don't open an issue or pull request but build your own image as described above. If a critical package is missing or you have a recipe for missing packages in a common scenario, please create an issue / PR on Dockerfile.blueprint.

License

See LICENSE file.

More Repositories

1

semver

Semantic Versioning (semver) library written in golang
Go
1,007
star
2

vfs

Virtual filesystem library written in golang
Go
465
star
3

mpv

mpv remote control library written in golang
Go
37
star
4

golang-alpine-docker

Build golang binaries for alpine linux
Makefile
36
star
5

thymer

Console Pomodoro Timer written in golang
Go
18
star
6

expenv

Expands environment variables in config files
Go
13
star
7

ghkeys

Utility to get github user keys
Go
12
star
8

gluster-server

GlusterFS server docker container
12
star
9

methodr

HTTP Method based Router written in golang
Go
9
star
10

expenv.sh

Expands files with environment variables (shell script)
Shell
5
star
11

speedtest

Simple TCP Speedtest written in golang
Go
4
star
12

e12bot

Go
3
star
13

whoshome

Who's home tracks presence
Go
2
star
14

photowall

Photowall written in golang
JavaScript
2
star
15

studip

StudIP API library written in golang (adjusted for University Passau)
Go
2
star
16

imgserv

Simple image upload and serving
Go
2
star
17

btrfs-initrd

Initrd creation to support boot from btrfs subvolume
Shell
1
star
18

hornet-webfrontend

JavaScript
1
star
19

rfm69-gateway

Go
1
star
20

CppTutorialUniPassau

Cpp Tutorial Sources
C++
1
star
21

sexec

Simple command execution for golang
Go
1
star
22

stinger

Go
1
star
23

receptor

Go
1
star
24

wasp

File repository written in golang
Go
1
star
25

hornet

Go
1
star
26

gosqm

SQM Format Toolchain written in golang
Go
1
star
27

transmerge

Merges 2 yaml translation files
Ruby
1
star
28

quiddle.js

Simple embeddable HTML, CSS, JS Playground
JavaScript
1
star
29

mcu-tempmonitor

NodeMCU Temperature sensor with golang backend and http frontend
Lua
1
star
30

crane

WIP! Docker Repository
Go
1
star
31

k8split

Go
1
star
32

late

Free templating utility
Go
1
star