Skip to content

Commit

Permalink
Merge pull request #2 from jemand771/dev
Browse files Browse the repository at this point in the history
minted fix + minor improvements
  • Loading branch information
jemand771 authored May 10, 2021
2 parents bcb74b8 + 5086b93 commit 57370c1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
16 changes: 12 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM ubuntu:20.04

# debian packages: tzdata, texlive, python, inkscape
# python packages: Pygments
RUN apt-get update &&\
DEBIAN_FRONTEND=noninteractive \
DEBCONF_NONINTERACTIVE_SEEN=true \
Expand All @@ -16,20 +17,27 @@ RUN apt-get update &&\
texlive-latex-base \
texlive-latex-extra \
tzdata \
&& rm -rf /var/lib/apt/lists/*
# pygments for syntax highlighting via minted
RUN pip3 install Pygments
&& \
pip3 install \
Pygments \
&& \
apt-get purge -y --auto-remove \
python3-pip \
&& \
rm -rf /var/lib/apt/lists/*

ADD https://raw.githubusercontent.com/aclements/latexrun/master/latexrun /latexrun.py
# allow non-root container run
RUN chmod 644 /latexrun.py
WORKDIR /latex

# settings (used in compile.sh)
ENV WARNINGS -Wall
ENV DELETE_TEMP=
ENV CLEAN_BUILD=
ENV TARGET main
ENV BUILD_DIRECTORY .build
ENV BIND_PATH /latex
WORKDIR /$BIND_PATH

COPY compile.sh /

Expand Down
14 changes: 10 additions & 4 deletions compile.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
if [ ! "$CLEAN_BUILD" == "" ]; then
rm -r /latex/latex.out
# ln -s /latex/_minted-main /latex/latex.out/_minted-main
BUILDDIR_FULL=$BIND_PATH/$BUILD_DIRECTORY
if [ ! "$CLEAN_BUILD" == "" ] && [ -d "$BUILDDIR_FULL" ]; then
rm -r "$BUILDDIR_FULL"
fi
python3 /latexrun.py --latex-args=--shell-escape --bibtex-cmd biber $WARNINGS $TARGET
mkdir -p "$BUILDDIR_FULL"
cp -r "$BIND_PATH"/* "$BUILDDIR_FULL/"
cd "$BUILDDIR_FULL"
python3 /latexrun.py --latex-args=--shell-escape --bibtex-cmd biber -O . $WARNINGS $TARGET && \
cp "$BUILDDIR_FULL/main.pdf" "$BIND_PATH/main.pdf" && \
if [ ! "$DELETE_TEMP" == "" ]; then
rm -r /latex/latex.out
rm -r "$BUILDDIR_FULL"
fi

#pdflatex --shell-escape "$TARGET"
Expand Down

0 comments on commit 57370c1

Please sign in to comment.