docker #1
20
Dockerfile
20
Dockerfile
@ -1,11 +1,19 @@
|
|||||||
#FROM debian:buster
|
|
||||||
#RUN apt update && apt install -y nodejs npm
|
|
||||||
|
|
||||||
FROM alpine:3.9
|
FROM alpine:3.9
|
||||||
RUN apk add --update --no-cache npm
|
RUN apk add --update --no-cache npm texlive poppler cairo bash texmf-dist-full ghostscript
|
||||||
|
RUN apk add --update --no-cache --virtual .build-deps poppler-dev cairo-dev wget build-base pkgconf
|
||||||
|
|
||||||
ADD . /latex
|
ADD . /latex
|
||||||
WORKDIR /latex
|
WORKDIR /latex
|
||||||
RUN npm install
|
RUN npm install && \
|
||||||
|
cd /tmp && \
|
||||||
|
wget https://github.com/dawbarton/pdf2svg/archive/v0.2.3.tar.gz && \
|
||||||
|
tar -xzf v0.2.3.tar.gz && \
|
||||||
|
cd pdf2svg-0.2.3/ && \
|
||||||
|
./configure && make && make install && \
|
||||||
|
cd / && \
|
||||||
|
rm -rf /tmp/pdf2svg-0.2.3/ && \
|
||||||
|
echo "cd /latex" > /start.sh && \
|
||||||
|
echo "bash tex2svg.sh" > /start.sh && \
|
||||||
|
echo "npm start" >> /start.sh
|
||||||
|
|
||||||
CMD ["npm", "start"]
|
CMD ["bash", "/start.sh"]
|
||||||
@ -2,7 +2,9 @@ version: "3"
|
|||||||
services:
|
services:
|
||||||
latesch:
|
latesch:
|
||||||
build: .
|
build: .
|
||||||
image: docker.wiai.de/latex/build:0.1-alpine
|
image: docker.wiai.de/latex/build:0.4-alpine
|
||||||
|
# volumes:
|
||||||
|
# - ./:/latex
|
||||||
ports:
|
ports:
|
||||||
- "127.0.0.1:8000:8000"
|
- "127.0.0.1:8000:8000"
|
||||||
# networks:
|
# networks:
|
||||||
|
|||||||
11
tex2svg.sh
Executable file
11
tex2svg.sh
Executable file
@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
for file in sections/german/*/*.tex; do
|
||||||
|
pushd $(dirname $file)
|
||||||
|
base=$(basename ${file%.tex})
|
||||||
|
pdflatex $base
|
||||||
|
pdfcrop $base.pdf
|
||||||
|
pdf2svg $base.pdf $base-orig.svg
|
||||||
|
pdf2svg $base-crop.pdf $base-crop.svg
|
||||||
|
rm -f $base.aux $base.log $base.out $base.pdf $base-crop.pdf
|
||||||
|
popd
|
||||||
|
done;
|
||||||
Loading…
x
Reference in New Issue
Block a user