Ready-to-use LaTeX environment for VSCode Dev Containers
4.2K

Ready-to-use LaTeX environment for Visual Studio Code Dev Containers.
A complete LaTeX environment with zero configuration. No installation, no subscription, no limitations.
Ready-to-use images available on Docker Hub.
gzurowski/latex-devcontainer:basic for a basic setup.gzurowski/latex-devcontainer:medium with more packages.gzurowski/latex-devcontainer:full with everything.You must have Docker and Visual Studio Code with the Dev Containers extension installed. See the Visual Studio Code's Dev Containers documentation for setup details.
You can simply create a new LaTeX project repository with this template:
Or, you can manually add the following .devcontainer/devcontainer.json file to your project:
{
"name": "LaTeX",
"image": "gzurowski/latex-devcontainer:full",
"customizations": {
"vscode": {
"extensions": ["James-Yu.latex-workshop"],
"settings": {
"editor.formatOnSave": true,
"latex-workshop.formatting.latex": "latexindent",
"latex-workshop.latex.autoBuild.run": "onSave",
"latex-workshop.linting.chktex.enabled": true
}
}
}
}
Target the desired scheme using the image tag (basic, medium or full).
Open the folder in VSCode and select Dev Containers: Reopen in Container.
Click the button below to launch a fully configured LaTeX environment in your browser:
You can also use the container directly (without Visual Studio Code) to build your LaTeX projects:
docker run --rm -v $(pwd):/workspace -w /workspace gzurowski/latex-devcontainer:full latexmk -pdf document.tex
This mounts your current directory into the container, builds the document, and writes the output PDF back to the host.
Use the TeX Live package manager to install packages not included in your chosen scheme:
tlmgr install <PACKAGE_NAME>
For a persistent installation, extend the Dockerfile or add to postCreateCommand in your devcontainer.json file:
{
"postCreateCommand": "tlmgr install <PACKAGE_NAME>"
}
The following container images are available:
| Tag | Description | Size (compressed) |
|---|---|---|
basic | Basic scheme is a minimal LaTeX installation. | ~350 MB |
medium | Medium scheme with more packages and languages | ~700 MB |
full | Full scheme with everything | ~2.4 GB |
If you install a scheme smaller than full, you can still add any missing packages later with tlmgr.
The following tools are included with every image:
| Tool | Description |
|---|---|
biber | Bibliography processing for BibLaTex. |
chktex | Code linter. |
latexindent | Code formatter. |
latexmk | Build tool. |
tlmgr | Package manager |
Clone the repository and build with Docking using the following commands.
Basic scheme (default):
docker build -t latex-devcontainer .
Full scheme:
docker build --build-arg TEXLIVE_SCHEME=scheme-full -t latex-devcontainer:full .
If you encounter any problems or have suggestions, please open an issue.
This project is licensed under the MIT License.
Content type
Image
Digest
sha256:4d93c8cf6…
Size
2.3 GB
Last updated
4 months ago
docker pull gzurowski/latex-devcontainer:full