Initial version

This commit is contained in:
Knut Ahlers 2016-04-15 14:15:54 +02:00
commit 394ad5a57c
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E
3 changed files with 73 additions and 0 deletions

23
Dockerfile Normal file
View file

@ -0,0 +1,23 @@
FROM ubuntu
MAINTAINER Knut Ahlers <knut@ahlers.me>
ENV PACKAGES \
texlive-xetex \
texlive-latex-extra \
texlive-latex-recommended \
texlive-fonts-recommended \
texlive-lang-european \
texlive-lang-german
RUN apt-get update \
&& apt-get install -y $PACKAGES \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
ADD ./generate-pdf /usr/local/bin/generate-pdf
VOLUME ["/src"]
WORKDIR /src
ENTRYPOINT ["/usr/local/bin/generate-pdf"]

28
README.md Normal file
View file

@ -0,0 +1,28 @@
# Luzifer / xetexgen
This container is intended as a replacement for a local TeX installation. The purpose mainly is to have a working TeX environment on a Mac without having to deal with all the implications a local TeX installation brings on OSX.
## Usage
The container contains a simple script with basic commands to generate a PDF from your TeX file. So you can use this command if for example your TeX file is named `letter.tex`:
```bash
# docker run --rm -ti -v $(pwd):/src luzifer/xetexgen letter.tex
This is XeTeX, Version 3.1415926-2.5-0.9999.3 (TeX Live 2013/Debian)
restricted \write18 enabled.
entering extended mode
This is XeTeX, Version 3.1415926-2.5-0.9999.3 (TeX Live 2013/Debian)
restricted \write18 enabled.
entering extended mode
Rendering was successful. Cleaning up...
```
Alternatively you can change parameters by overwriting the `ENTRYPOINT`:
```bash
# docker run --rm -ti -v $(pwd):/src --entrypoint=xelatex luzifer/xetexgen --help
Usage: xetex [OPTION]... [TEXNAME[.tex]] [COMMANDS]
or: xetex [OPTION]... \FIRST-LINE
or: xetex [OPTION]... &FMT ARGS
[...]
```

22
generate-pdf Executable file
View file

@ -0,0 +1,22 @@
#!/bin/bash
TEXFILE=$1
if ! [ -f ${TEXFILE} ]; then
echo "You need to specify the file to render."
exit 1
fi
if ! ( xelatex -interaction=batchmode ${TEXFILE} ); then
echo "An error occurred while processing ${TEXFILE}. Please see the log."
exit 1
fi
# Do a second run in order to render page numbers etc
if ! ( xelatex -interaction=batchmode ${TEXFILE} ); then
echo "An error occurred while processing ${TEXFILE}. Please see the log."
exit 1
fi
echo "Rendering was successful. Cleaning up..."
rm -f ${TEXFILE/.tex/.log} ${TEXFILE/.tex/.aux}