Code Monkey home page Code Monkey logo

latexdevcontainer's Introduction

Latex Dev Container

Ultimate Latex development container for Visual Studio Code

Build status Docker Pulls Docker Stars Image size Image version

Join Slack channel GitHub last commit GitHub commit activity GitHub issues

Features

  • Fastest way to code LaTex and produce a pdf file when saving your .tex file
  • Uses texlive 2021
  • Based on Debian Buster Slim, using qmcgaw/basedevcontainer
  • Two Docker images:
    • qmcgaw/latexdevcontainer:latest (default) which uses the TexLive basic scheme and has an uncompressed image size of 467MB
    • 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.
  • Comes with tlmgr to install more LaTex packages as needed
  • Latex compilation to pdf with latexmk
  • Formatting on save using latexindent
  • Latex linting using chktex built from source
  • Using the LaTex-Workshop VScode extension
  • Compatible with amd64, ARM 64 bit, ARM 32 bit v6 and v7 (TeXLive not available on ARM, create an issue if you need it)
  • Cross platform
    • Easily bind mount your SSH keys to use with git
    • Manage your host Docker from within the dev container, more details at qmcgaw/basedevcontainer
  • Extensible with docker-compose.yml
  • Minimal uncompressed image size of 467MB

Demo

Requirements

Setup for a project

  1. Setup your configuration files
    • With style ๐Ÿ’ฏ

      docker run -it --rm -v "/yourrepopath:/repository" qmcgaw/devtainr:v0.4.0 -dev latex -path /repository -name projectname

      Or use the built binary

    • Or manually: download this repository and put the .devcontainer directory in your project.

  2. Open the command palette in Visual Studio Code (CTRL+SHIFT+P) and select Remote-Containers: Open Folder in Container... and choose your project directory

Install

Install LaTex packages

If you need for example the package lastpage, open the integrated terminal in VS Code, select zsh and enter:

tlmgr install lastpage
texhash

Install packages

Update the Latex Docker image

  1. Pull the docker image

    docker pull qmcgaw/latexdevcontainer
  2. 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.

More

devcontainer.json

  • You can change the "postCreateCommand" to be relevant to your situation. For example:

    "postCreateCommand": "tlmgr install acronym pgf && texhash",
  • You can change the extensions installed in the Docker image within the "extensions" array

  • Other Latex settings can be changed or added in the "settings" object.

Development image

  • You can build the development image yourself:

    docker build -t qmcgaw/latexdevcontainer -f Dockerfile https://github.com/qdm12/latexdevcontainer.git
  • You can extend the Docker image qmcgaw/latexdevcontainer with your own instructions.

    1. Create a file .devcontainer/Dockerfile with FROM qmcgaw/latexdevcontainer

    2. Append instructions to the Dockerfile created. For example:

      FROM qmcgaw/latexdevcontainer
      RUN tlmgr install lastpage
    3. Modify .devcontainer/docker-compose.yml and add build: . in the vscode service.

    4. Open the VS code command palette and choose Remote-Containers: Rebuild container

  • You can bind mount a shell script to /home/vscode/.welcome.sh to replace the current welcome script

TODOs

License

This repository is under an MIT license unless indicated otherwise.

latexdevcontainer's People

Contributors

qdm12 avatar skrallexxx avatar fortierq avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.