A complete development container for Latex for use with VSCode/GitHub Codespaces
texlive
install (images for minimal, basic, and small)- Compile to PDF with
latexmk
- Format with
latexindent
- Lint with
chktex
- Spelling and grammar checking with
ltex-ls
- Include SVG graphics with
inskscape
- All the features provided via
LaTeX-Workshop
- Install more packages with
tlmgr
- Use on
amd64
andarm64
- Docker installed and running
- VS code installed
- VS code remote containers extension installed
- In the root of your project, create a directory named
.devcontainer
- Copy the
devcontainer.json
file from this repository to the newly created directory - optional: Change to image being used for the devcontainer by updating the
image
field in the JSON file. For example, use the basic texlive install scheme:ghcr.io/willfantom/devcontainer-latex:latest-basic
- optional: Add other packages to be installed by
tlmgr
when the container starts to thepostCreateCommand
field in the JSON file - Open the project in the devcontainer via the devcontainer CLI, the commands in VSCode, or in a GitHub Codespace
-
Need specifc packages for your project? Add the appropriate
tlmgr
command to thepostCreateCommand
in yourdevcontainer.json
. An example of this has been shown in this repo. -
You can use this image along with Devcontainer features. For example my dotfiles can be included by adding the following snippet in the
devcontainer.json
files:... "features": { ... "ghcr.io/willfantom/features/dotfiles:1": {} }, ...
In most cases, I suggest starting with the latest-small
tag and adding the
packages you need as described here. That said, if you really
want a full image, you can easily build this yourself...
For this, you will have to build the container with the build arg TEX_SCHEME
set to full
. This may end up being around 6GB once built... Make sure to set the image
field in the devcontainer JSON file to the tag of your full scheme image.
This has been extended from qdm12/latexdevcontainer with the following core changes:
- Inclusion of
ltex-ls
to use with the LanguageTool and LTeX extensions to provide grammar and spell checking in tex documents. - Inclusion of
inskscape
to allow the inclusion of SVG graphics in tex documents. - Dark mode PDF preview mode.
- No explicit reference to the texlive version in the Dockerfile.
- No use of
docker-compose
to simplify the devcontainer setup process. - Vanilla debian used as the base rather than a specific set of dotfiles (since dotfiles can be added via devcontainer features...).