├── .devcontainer ├── .dockerignore ├── Dockerfile ├── README.md ├── devcontainer.json └── docker-compose.yml ├── .dockerignore ├── .github ├── CODEOWNERS ├── CONTRIBUTING.md ├── FUNDING.yml ├── dependabot.yml ├── labels.yml └── workflows │ ├── build.yml │ └── dockerhub-description.yml ├── Dockerfile ├── LICENSE ├── README.md ├── shell ├── .welcome.sh └── .zshrc-specific └── title.svg /.devcontainer/.dockerignore: -------------------------------------------------------------------------------- 1 | .dockerignore 2 | devcontainer.json 3 | docker-compose.yml 4 | Dockerfile 5 | README.md 6 | -------------------------------------------------------------------------------- /.devcontainer/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM qmcgaw/latexdevcontainer 2 | -------------------------------------------------------------------------------- /.devcontainer/README.md: -------------------------------------------------------------------------------- 1 | # Development container 2 | 3 | Development container that can be used with VSCode. 4 | 5 | It works on Linux, Windows and OSX. 6 | 7 | ## Requirements 8 | 9 | - [VS code](https://code.visualstudio.com/download) installed 10 | - [VS code remote containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) installed 11 | - [Docker](https://www.docker.com/products/docker-desktop) installed and running 12 | - [Docker Compose](https://docs.docker.com/compose/install/) installed 13 | 14 | ## Setup 15 | 16 | 1. Create the following files on your host if you don't have them: 17 | 18 | ```sh 19 | touch ~/.gitconfig ~/.zsh_history 20 | ``` 21 | 22 | Note that the development container will create the empty directories `~/.docker` and `~/.ssh` if you don't have them. 23 | 24 | 1. **For Docker on OSX or Windows without WSL**: ensure your home directory `~` is accessible by Docker. 25 | 1. **For Docker on Windows without WSL:** if you want to use SSH keys, bind mount your host `~/.ssh` to `/tmp/.ssh` instead of `~/.ssh` by changing the `volumes` section in the [docker-compose.yml](docker-compose.yml). 26 | 1. Open the command palette in Visual Studio Code (CTRL+SHIFT+P). 27 | 1. Select `Remote-Containers: Open Folder in Container...` and choose the project directory. 28 | 29 | ## Customization 30 | 31 | ### Customize the image 32 | 33 | You can make changes to the [Dockerfile](Dockerfile) and then rebuild the image. For example, your Dockerfile could be: 34 | 35 | ```Dockerfile 36 | FROM qmcgaw/latexdevcontainer 37 | RUN apk add curl 38 | ``` 39 | 40 | To rebuild the image, either: 41 | 42 | - With VSCode through the command palette, select `Remote-Containers: Rebuild and reopen in container` 43 | - With a terminal, go to this directory and `docker-compose build` 44 | 45 | ### Customize VS code settings 46 | 47 | You can customize **settings** and **extensions** in the [devcontainer.json](devcontainer.json) definition file. 48 | 49 | ### Entrypoint script 50 | 51 | You can bind mount a shell script to `/home/vscode/.welcome.sh` to replace the [current welcome script](shell/.welcome.sh). 52 | 53 | ### Publish a port 54 | 55 | To access a port from your host to your development container, publish a port in [docker-compose.yml](docker-compose.yml). You can also now do it directly with VSCode without restarting the container. 56 | 57 | ### Run other services 58 | 59 | 1. Modify [docker-compose.yml](docker-compose.yml) to launch other services at the same time as this development container, such as a test database: 60 | 61 | ```yml 62 | database: 63 | image: postgres 64 | restart: always 65 | environment: 66 | POSTGRES_PASSWORD: password 67 | ``` 68 | 69 | 1. In [devcontainer.json](devcontainer.json), change the line `"runServices": ["vscode"],` to `"runServices": ["vscode", "database"],`. 70 | 1. In the VS code command palette, rebuild the container. 71 | -------------------------------------------------------------------------------- /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "project-dev", 3 | "dockerComposeFile": ["docker-compose.yml"], 4 | "service": "vscode", 5 | "runServices": ["vscode"], 6 | "shutdownAction": "stopCompose", 7 | "workspaceFolder": "/workspace", 8 | "postCreateCommand": "", 9 | "customizations": { 10 | "vscode": { 11 | "extensions": [ 12 | "james-yu.latex-workshop", 13 | // Git 14 | "eamodio.gitlens", 15 | // Other helpers 16 | "shardulm94.trailing-spaces", 17 | "stkb.rewrap", // rewrap comments after n characters on one line 18 | // Other 19 | "vscode-icons-team.vscode-icons" 20 | ], 21 | "settings": { 22 | // General settings 23 | "files.eol": "\n", 24 | // Latex settings 25 | "latex-workshop.linting.chktex.enabled": true, 26 | "latex-workshop.linting.chktex.exec.path": "chktex", 27 | "latex-workshop.latex.clean.subfolder.enabled": true, 28 | "latex-workshop.latex.autoClean.run": "onBuilt", 29 | "editor.formatOnSave": true, 30 | "files.associations": { 31 | "*.tex": "latex" 32 | }, 33 | "latex-workshop.latexindent.path": "latexindent", 34 | "latex-workshop.latexindent.args": [ 35 | "-c", 36 | "%DIR%/", 37 | "%TMPFILE%", 38 | "-y=defaultIndent: '%INDENT%'" 39 | ] 40 | } 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /.devcontainer/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.2" 2 | 3 | services: 4 | vscode: 5 | build: . 6 | image: latexdevcontainer 7 | volumes: 8 | - ../:/workspace 9 | # Docker socket to access Docker server 10 | - /var/run/docker.sock:/var/run/docker.sock 11 | # SSH directory 12 | - ~/.ssh:/root/.ssh 13 | # For Windows without WSL, a copy will be made 14 | # from /tmp/.ssh to ~/.ssh to fix permissions 15 | # - ~/.ssh:/tmp/.ssh:ro 16 | # Shell history persistence 17 | - ~/.zsh_history:/root/.zsh_history:z 18 | # Git config 19 | - ~/.gitconfig:/root/.gitconfig 20 | environment: 21 | - TZ= 22 | entrypoint: ["zsh", "-c", "while sleep 1000; do :; done"] 23 | 24 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | .devcontainer 2 | .git 3 | .github 4 | .vscode 5 | .dockerignore 6 | LICENSE 7 | README.md 8 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | @qdm12 -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Contributions are [released](https://help.github.com/articles/github-terms-of-service/#6-contributions-under-repository-license) to the public under the [open source license of this project](../LICENSE). 4 | 5 | ## Submitting a pull request 6 | 7 | 1. [Fork](https://github.com/qdm12/latexdevcontainer/fork) and clone the repository 8 | 1. Create a new branch `git checkout -b my-branch-name` 9 | 1. Modify the code 10 | 1. Ensure the docker build succeeds `docker build .` 11 | 1. Commit your modifications 12 | 1. Push to your fork and [submit a pull request](https://github.com/qdm12/latexdevcontainer/compare) 13 | 14 | ## Resources 15 | 16 | - [Using Pull Requests](https://help.github.com/articles/about-pull-requests/) 17 | - [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/) 18 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: [qdm12] 2 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "github-actions" 4 | directory: "/" 5 | schedule: 6 | interval: "daily" 7 | 8 | - package-ecosystem: "docker" 9 | directory: "/" 10 | schedule: 11 | interval: "daily" 12 | -------------------------------------------------------------------------------- /.github/labels.yml: -------------------------------------------------------------------------------- 1 | - name: ":robot: bot" 2 | color: "69cde9" 3 | description: "" 4 | - name: ":bug: bug" 5 | color: "b60205" 6 | description: "" 7 | - name: ":game_die: dependencies" 8 | color: "0366d6" 9 | description: "" 10 | - name: ":memo: documentation" 11 | color: "c5def5" 12 | description: "" 13 | - name: ":busts_in_silhouette: duplicate" 14 | color: "cccccc" 15 | description: "" 16 | - name: ":sparkles: enhancement" 17 | color: "0054ca" 18 | description: "" 19 | - name: ":bulb: feature request" 20 | color: "0e8a16" 21 | description: "" 22 | - name: ":mega: feedback" 23 | color: "03a9f4" 24 | description: "" 25 | - name: ":rocket: future maybe" 26 | color: "fef2c0" 27 | description: "" 28 | - name: ":hatching_chick: good first issue" 29 | color: "7057ff" 30 | description: "" 31 | - name: ":pray: help wanted" 32 | color: "4caf50" 33 | description: "" 34 | - name: ":hand: hold" 35 | color: "24292f" 36 | description: "" 37 | - name: ":no_entry_sign: invalid" 38 | color: "e6e6e6" 39 | description: "" 40 | - name: ":interrobang: maybe bug" 41 | color: "ff5722" 42 | description: "" 43 | - name: ":thinking: needs more info" 44 | color: "795548" 45 | description: "" 46 | - name: ":question: question" 47 | color: "3f51b5" 48 | description: "" 49 | - name: ":coffin: wontfix" 50 | color: "ffffff" 51 | description: "" 52 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | on: 3 | push: 4 | paths: 5 | - .github/workflows/build.yml 6 | - shell/** 7 | - .dockerignore 8 | - Dockerfile 9 | pull_request: 10 | paths: 11 | - .github/workflows/build.yml 12 | - shell/** 13 | - .dockerignore 14 | - Dockerfile 15 | 16 | jobs: 17 | verify: 18 | if: github.event_name == 'pull_request' 19 | runs-on: ubuntu-latest 20 | env: 21 | DOCKER_BUILDKIT: "1" 22 | steps: 23 | - uses: actions/checkout@v4 24 | 25 | - name: Build final image 26 | run: docker build . 27 | 28 | publish: 29 | # needs: [verify] 30 | if: github.event_name == 'push' 31 | runs-on: ubuntu-latest 32 | steps: 33 | - uses: actions/checkout@v4 34 | 35 | - uses: docker/setup-qemu-action@v2 36 | - uses: docker/setup-buildx-action@v2 37 | 38 | - uses: docker/login-action@v2 39 | with: 40 | username: qmcgaw 41 | password: ${{ secrets.DOCKERHUB_PASSWORD }} 42 | 43 | - name: Set variables 44 | id: vars 45 | run: | 46 | BRANCH=${GITHUB_REF#refs/heads/} 47 | TAG=${GITHUB_REF#refs/tags/} 48 | echo ::set-output name=commit::$(git rev-parse --short HEAD) 49 | echo ::set-output name=build_date::$(date -u +%Y-%m-%dT%H:%M:%SZ) 50 | if [ "$TAG" != "$GITHUB_REF" ]; then 51 | echo ::set-output name=version::$TAG 52 | echo ::set-output name=platforms::linux/amd64,linux/arm64 53 | elif [ "$BRANCH" = "master" ]; then 54 | echo ::set-output name=version::latest 55 | echo ::set-output name=platforms::linux/amd64,linux/arm64 56 | else 57 | echo ::set-output name=version::$BRANCH 58 | echo ::set-output name=platforms::linux/amd64,linux/arm64 59 | fi 60 | 61 | - name: Build and push scheme-basic image 62 | uses: docker/build-push-action@v4 63 | with: 64 | platforms: ${{ steps.vars.outputs.platforms }} 65 | build-args: | 66 | BUILD_DATE=${{ steps.vars.outputs.build_date }} 67 | COMMIT=${{ steps.vars.outputs.commit }} 68 | VERSION=${{ steps.vars.outputs.version }} 69 | SCHEME=scheme-basic 70 | tags: qmcgaw/latexdevcontainer:${{ steps.vars.outputs.version }} 71 | push: true 72 | 73 | - name: Build and push scheme-full image 74 | uses: docker/build-push-action@v4 75 | with: 76 | platforms: ${{ steps.vars.outputs.platforms }} 77 | build-args: | 78 | BUILD_DATE=${{ steps.vars.outputs.build_date }} 79 | COMMIT=${{ steps.vars.outputs.commit }} 80 | VERSION=${{ steps.vars.outputs.version }} 81 | SCHEME=scheme-full 82 | tags: qmcgaw/latexdevcontainer:${{ steps.vars.outputs.version }}-full 83 | push: true 84 | -------------------------------------------------------------------------------- /.github/workflows/dockerhub-description.yml: -------------------------------------------------------------------------------- 1 | name: Docker Hub description 2 | on: 3 | push: 4 | branches: [master] 5 | paths: 6 | - README.md 7 | - .github/workflows/dockerhub-description.yml 8 | jobs: 9 | dockerHubDescription: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Checkout 13 | uses: actions/checkout@v4 14 | - name: Docker Hub Description 15 | uses: peter-evans/dockerhub-description@v3.4.2 16 | env: 17 | DOCKERHUB_USERNAME: qmcgaw 18 | DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} 19 | DOCKERHUB_REPOSITORY: qmcgaw/latexdevcontainer 20 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | ARG DEBIAN_VERSION=bullseye-slim 2 | ARG BASEDEV_VERSION=v0.25.0 3 | 4 | FROM debian:${DEBIAN_VERSION} AS chktex 5 | ARG CHKTEX_VERSION=1.7.6 6 | WORKDIR /tmp/workdir 7 | RUN apt-get update -y && \ 8 | apt-get install -y --no-install-recommends g++ make wget 9 | RUN wget -qO- http://download.savannah.gnu.org/releases/chktex/chktex-${CHKTEX_VERSION}.tar.gz | \ 10 | tar -xz --strip-components=1 11 | RUN ./configure && \ 12 | make && \ 13 | mv chktex /tmp && \ 14 | rm -r * 15 | 16 | FROM qmcgaw/basedevcontainer:${BASEDEV_VERSION}-debian 17 | ARG BUILD_DATE 18 | ARG COMMIT 19 | ARG VERSION=local 20 | LABEL \ 21 | org.opencontainers.image.authors="quentin.mcgaw@gmail.com" \ 22 | org.opencontainers.image.created=$BUILD_DATE \ 23 | org.opencontainers.image.version=$VERSION \ 24 | org.opencontainers.image.revision=$COMMIT \ 25 | org.opencontainers.image.url="https://github.com/qdm12/latexdevcontainer" \ 26 | org.opencontainers.image.documentation="https://github.com/qdm12/latexdevcontainer" \ 27 | org.opencontainers.image.source="https://github.com/qdm12/latexdevcontainer" \ 28 | org.opencontainers.image.title="Latex Dev container Alpine" \ 29 | org.opencontainers.image.description="Latex development container for Visual Studio Code Remote Containers development" 30 | WORKDIR /tmp/texlive 31 | ARG SCHEME=scheme-basic 32 | ARG DOCFILES=0 33 | ARG SRCFILES=0 34 | ARG TEXLIVE_VERSION=2024 35 | ARG TEXLIVE_MIRROR=http://ctan.math.utah.edu/ctan/tex-archive/systems/texlive/tlnet 36 | RUN apt-get update -y && \ 37 | apt-get install -y --no-install-recommends wget gnupg cpanminus && \ 38 | wget -qO- ${TEXLIVE_MIRROR}/install-tl-unx.tar.gz | \ 39 | tar -xz --strip-components=1 && \ 40 | export TEXLIVE_INSTALL_NO_CONTEXT_CACHE=1 && \ 41 | export TEXLIVE_INSTALL_NO_WELCOME=1 && \ 42 | printf "selected_scheme ${SCHEME}\ninstopt_letter 0\ntlpdbopt_autobackup 0\ntlpdbopt_desktop_integration 0\ntlpdbopt_file_assocs 0\ntlpdbopt_install_docfiles ${DOCFILES}\ntlpdbopt_install_srcfiles ${SRCFILES}" > profile.txt && \ 43 | perl install-tl -profile profile.txt --location ${TEXLIVE_MIRROR} && \ 44 | # Cleanup 45 | cd && \ 46 | apt-get clean autoclean && \ 47 | apt-get autoremove -y && \ 48 | rm -rf /var/lib/{apt,dpkg,cache,log}/ /tmp/texlive /usr/local/texlive/${TEXLIVE_VERSION}/*.log 49 | ENV PATH ${PATH}:\ 50 | /usr/local/texlive/${TEXLIVE_VERSION}/bin/x86_64-linux:\ 51 | /usr/local/texlive/${TEXLIVE_VERSION}/bin/aarch64-linux 52 | WORKDIR /workspace 53 | # Latexindent dependencies 54 | RUN apt-get update -y && \ 55 | apt-get install -y --no-install-recommends cpanminus make gcc libc6-dev && \ 56 | cpanm -n -q Log::Log4perl && \ 57 | cpanm -n -q XString && \ 58 | cpanm -n -q Log::Dispatch::File && \ 59 | cpanm -n -q YAML::Tiny && \ 60 | cpanm -n -q File::HomeDir && \ 61 | cpanm -n -q Unicode::GCString && \ 62 | apt-get remove -y cpanminus make gcc libc6-dev && \ 63 | apt-get clean autoclean && \ 64 | apt-get autoremove -y && \ 65 | rm -rf /var/lib/{apt,dpkg,cache,log}/ 66 | RUN tlmgr install latexindent latexmk && \ 67 | texhash && \ 68 | rm /usr/local/texlive/${TEXLIVE_VERSION}/texmf-var/web2c/*.log && \ 69 | rm /usr/local/texlive/${TEXLIVE_VERSION}/tlpkg/texlive.tlpdb.main.* 70 | COPY --from=chktex /tmp/chktex /usr/local/bin/chktex 71 | COPY shell/.zshrc-specific shell/.welcome.sh /root/ 72 | # Verify binaries work and have the right permissions 73 | RUN tlmgr version && \ 74 | latexmk -version && \ 75 | texhash --version && \ 76 | chktex --version 77 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Quentin McGaw 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Latex Dev Container 2 | 3 | **Ultimate Latex development container for Visual Studio Code** 4 | 5 | 6 | 7 | [![Build status](https://github.com/qdm12/latexdevcontainer/workflows/CI/badge.svg)](https://github.com/qdm12/latexdevcontainer/actions?query=workflow%3ACI) 8 | [![Docker Pulls](https://img.shields.io/docker/pulls/qmcgaw/latexdevcontainer.svg)](https://hub.docker.com/r/qmcgaw/latexdevcontainer) 9 | [![Docker Stars](https://img.shields.io/docker/stars/qmcgaw/latexdevcontainer.svg)](https://hub.docker.com/r/qmcgaw/latexdevcontainer) 10 | 11 | [![Join Slack channel](https://img.shields.io/badge/slack-@qdm12-yellow.svg?logo=slack)](https://join.slack.com/t/qdm12/shared_invite/enQtOTE0NjcxNTM1ODc5LTYyZmVlOTM3MGI4ZWU0YmJkMjUxNmQ4ODQ2OTAwYzMxMTlhY2Q1MWQyOWUyNjc2ODliNjFjMDUxNWNmNzk5MDk) 12 | [![GitHub last commit](https://img.shields.io/github/last-commit/qdm12/latexdevcontainer.svg)](https://github.com/qdm12/latexdevcontainer/issues) 13 | [![GitHub commit activity](https://img.shields.io/github/commit-activity/y/qdm12/latexdevcontainer.svg)](https://github.com/qdm12/latexdevcontainer/issues) 14 | [![GitHub issues](https://img.shields.io/github/issues/qdm12/latexdevcontainer.svg)](https://github.com/qdm12/latexdevcontainer/issues) 15 | 16 | ## Features 17 | 18 | - Fastest way to code LaTex and produce a pdf file when saving your .tex file 19 | - Uses [texlive 2023](https://www.tug.org/texlive/acquire-netinstall.html) 20 | - Based on Debian Bullseye Slim, using [qmcgaw/basedevcontainer](https://github.com/qdm12/basedevcontainer) 21 | - Compatible with `amd64` and `aarch64` 22 | - **Two Docker images**: 23 | - `qmcgaw/latexdevcontainer:latest` (default) which uses the TexLive basic scheme and has an uncompressed image size of 467MB 24 | - `qmcgaw/latexdevcontainer:latest-full` which uses the TexLive full scheme and has an uncompressed image size of 4.2GB - most packages you would need are already installed. 25 | - Comes with `tlmgr` to install more LaTex packages as needed 26 | - Latex compilation to pdf with [latexmk](https://mg.readthedocs.io/latexmk.html) 27 | - Formatting on save using [latexindent](https://github.com/cmhughes/latexindent.pl) 28 | - Latex linting using [chktex](https://www.nongnu.org/chktex) built from source 29 | - Using the [LaTex-Workshop VScode extension](https://github.com/James-Yu/LaTeX-Workshop) 30 | - Compatible with amd64, ~ARM 64 bit, ARM 32 bit v6 and v7~ (TeXLive not available on ARM, create an issue if you need it) 31 | - Cross platform 32 | - Easily bind mount your SSH keys to use with **git** 33 | - Manage your host Docker from within the dev container, more details at [qmcgaw/basedevcontainer](https://github.com/qdm12/basedevcontainer#features) 34 | - Extensible with docker-compose.yml 35 | - Minimal uncompressed image size of 467MB 36 | 37 | [![Demo](https://i.imgur.com/4jFRIql.gif)](https://github.com/qdm12/latexdevcontainer) 38 | 39 | ## Requirements 40 | 41 | - [Docker](https://www.docker.com/products/docker-desktop) installed and running 42 | - If you don't use Linux, share the directories `~/.ssh` and the directory of your project with Docker Desktop 43 | - [Docker Compose](https://docs.docker.com/compose/install/) installed 44 | - [VS code](https://code.visualstudio.com/download) installed 45 | - [VS code remote containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) installed 46 | 47 | ## Setup for a project 48 | 49 | 1. Setup your configuration files 50 | - With style 💯 51 | 52 | ```sh 53 | docker run -it --rm -v "/yourrepopath:/repository" qmcgaw/devtainr:v0.4.0 -dev latex -path /repository -name projectname 54 | ``` 55 | 56 | Or use the [built binary](https://github.com/qdm12/devtainr#binary) 57 | - Or manually: download this repository and put the [.devcontainer](.devcontainer) directory in your project. 58 | 1. Open the command palette in Visual Studio Code (CTRL+SHIFT+P) and select `Remote-Containers: Open Folder in Container...` and choose your project directory 59 | 60 | [![Install](https://i.imgur.com/1NJHIbH.gif)](https://github.com/qdm12/latexdevcontainer#setup-for-a-project) 61 | 62 | ## Install LaTex packages 63 | 64 | If you need for example the package `lastpage`, open the integrated terminal in VS Code, select `zsh` and enter: 65 | 66 | ```sh 67 | tlmgr install lastpage 68 | texhash 69 | ``` 70 | 71 | [![Install packages](https://i.imgur.com/mBM2NYB.gif)](https://github.com/qdm12/latexdevcontainer#install-latex-packages) 72 | 73 | ## Update the Latex Docker image 74 | 75 | 1. Pull the docker image 76 | 77 | ```sh 78 | docker pull qmcgaw/latexdevcontainer 79 | ``` 80 | 81 | 1. Open the command palette in Visual Studio Code (CTRL+SHIFT+P) and select `Remote-Containers: Rebuild and Reopen in Container...`. ⚠️ this will erase your container shell history and custom latex packages you added on top of the base image. 82 | 83 | ## More 84 | 85 | ### devcontainer.json 86 | 87 | - You can change the `"postCreateCommand"` to be relevant to your situation. For example: 88 | 89 | ```json 90 | "postCreateCommand": "tlmgr install acronym pgf && texhash", 91 | ``` 92 | 93 | - You can change the extensions installed in the Docker image within the `"customizations/vscode/extensions"` array 94 | - Other Latex settings can be changed or added in the `"customizations/vscode/settings"` object. 95 | 96 | ### Development image 97 | 98 | - You can build the development image yourself: 99 | 100 | ```sh 101 | docker build -t qmcgaw/latexdevcontainer -f Dockerfile https://github.com/qdm12/latexdevcontainer.git 102 | ``` 103 | 104 | - You can extend the Docker image `qmcgaw/latexdevcontainer` with your own instructions. 105 | 106 | 1. Create a file `.devcontainer/Dockerfile` with `FROM qmcgaw/latexdevcontainer` 107 | 1. Append instructions to the Dockerfile created. For example: 108 | 109 | ```Dockerfile 110 | FROM qmcgaw/latexdevcontainer 111 | RUN tlmgr install lastpage 112 | ``` 113 | 114 | 1. Modify `.devcontainer/docker-compose.yml` and add `build: .` in the vscode service. 115 | 1. Open the VS code command palette and choose `Remote-Containers: Rebuild container` 116 | 117 | - You can bind mount a shell script to `/home/vscode/.welcome.sh` to replace the [current welcome script](shell/.welcome.sh) 118 | 119 | ## TODOs 120 | 121 | - [qmcgaw/basedevcontainer](https://github.com/qdm12/basedevcontainer) todos 122 | 123 | ## License 124 | 125 | This repository is under an [MIT license](https://github.com/qdm12/latexdevcontainer/master/LICENSE) unless indicated otherwise. 126 | -------------------------------------------------------------------------------- /shell/.welcome.sh: -------------------------------------------------------------------------------- 1 | echo "TexLive release $(tlmgr version | tail -n 1 | cut -f5- -d' ')" 2 | echo "tlmgr version $(tlmgr version | head -n 1 | cut -f3- -d' ')" 3 | echo "latexindent version $(latexindent --version)" 4 | echo "latexmk version $(latexmk -version | tail -n 1 | cut -f8 -d' ')" 5 | echo "Useful commands available:" 6 | echo " * Update LaTex packages: tlmgr update --all" 7 | echo " * Install a LaTex package:" 8 | echo " tlmgr install packagename" 9 | echo " texhash" 10 | echo " * Install an OS package: sudo apt-get install -y packagename" 11 | -------------------------------------------------------------------------------- /shell/.zshrc-specific: -------------------------------------------------------------------------------- 1 | plugins=(vscode git colorize docker docker-compose) -------------------------------------------------------------------------------- /title.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | --------------------------------------------------------------------------------