From e141782b2bcb8d112a3a1e27ae7f61c74710ceaf Mon Sep 17 00:00:00 2001 From: Andreas Tsouchlos Date: Thu, 21 Dec 2023 02:16:25 +0100 Subject: [PATCH] Add dockerfiles and README.md --- .latexmkrc | 1 + README.md | 33 ++++++++++++++++++++++++++++++++ dockerfiles/Dockerfile.alpine | 5 +++++ dockerfiles/Dockerfile.archlinux | 9 +++++++++ dockerfiles/Dockerfile.ubuntu | 7 +++++++ 5 files changed, 55 insertions(+) create mode 100644 README.md create mode 100644 dockerfiles/Dockerfile.alpine create mode 100644 dockerfiles/Dockerfile.archlinux create mode 100644 dockerfiles/Dockerfile.ubuntu diff --git a/.latexmkrc b/.latexmkrc index fd022f6..e87380c 100644 --- a/.latexmkrc +++ b/.latexmkrc @@ -1,2 +1,3 @@ $pdflatex="pdflatex -shell-escape -interaction=nonstopmode -synctex=1 %O %S"; $out_dir = 'build'; +$pdf_mode = 1; diff --git a/README.md b/README.md new file mode 100644 index 0000000..04f11dc --- /dev/null +++ b/README.md @@ -0,0 +1,33 @@ +# latex-common + +Repository containing common latex code that can be shared across multiple projects. + +## Usage + +Put + +```latex +\input{common.tex} +``` + +in your preamble. See the `examples` folder for usage examples. + +## Build examples + +### Build manually + +```bash +$ latexmk example.tex +``` + +### Build using docker + +1. Build docker image + ```bash + $ docker build -f dockerfile/Dockerfile.alpine . -t latex-common + ``` +2. Build example + ```bash + $ docker run --rm -v $PWD:$PWD -w $PWD `id -u`:`id -g` latex-common latexmk example.tex + ``` + diff --git a/dockerfiles/Dockerfile.alpine b/dockerfiles/Dockerfile.alpine new file mode 100644 index 0000000..a0e99dc --- /dev/null +++ b/dockerfiles/Dockerfile.alpine @@ -0,0 +1,5 @@ +FROM alpine:3.19 + +RUN apk update && apk upgrade +RUN apk add texlive +RUN apk add texmf-dist-pictures diff --git a/dockerfiles/Dockerfile.archlinux b/dockerfiles/Dockerfile.archlinux new file mode 100644 index 0000000..4e7abd3 --- /dev/null +++ b/dockerfiles/Dockerfile.archlinux @@ -0,0 +1,9 @@ +FROM archlinux:latest + +RUN pacman-key --init +RUN pacman-key --populate archlinux +RUN pacman -Sy archlinux-keyring --noconfirm && pacman -Su --noconfirm +# RUN pacman-key --refresh-keys + +RUN pacman -Syu --noconfirm +RUN pacman -S perl texlive texlive-binextra texlive-pictures --noconfirm diff --git a/dockerfiles/Dockerfile.ubuntu b/dockerfiles/Dockerfile.ubuntu new file mode 100644 index 0000000..1307b99 --- /dev/null +++ b/dockerfiles/Dockerfile.ubuntu @@ -0,0 +1,7 @@ +FROM ubuntu:22.04 + +ARG DEBIAN_FRONTEND=noninteractive + +RUN apt update -y && apt upgrade -y +RUN apt install neovim git -y +RUN apt install texlive latexmk texlive-pictures -y