Skip to content

avcuenes/latex-env

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LaTeX Authoring Environment

This repository defines a ready-to-use LaTeX toolchain that runs inside a VS Code dev container. It bundles the standard LaTeX packages (via TeX Live), latexmk, biber, and a curated set of VS Code extensions so you can focus on writing while the container keeps your host system clean.

What's inside?

  • Dockerfile based on debian:stable-slim with latexmk, texlive-* collections, biber, make, and friends.
  • .devcontainer/devcontainer.json that builds the image, mounts the workspace at /workspace, runs latexmk -v after creation, and installs editor extensions: LaTeX Workshop, LaTeX formatter, spell checker, etc.
  • A convenience Makefile for running latexmk commands from your host or inside the container.

Prerequisites

  1. Docker running on your machine.
  2. VS Code with the Dev Containers extension (optional but recommended).

Getting started (VS Code)

  1. Open the repository folder in VS Code.
  2. When prompted, choose Reopen in Container (or run the Dev Containers: Reopen in Container command).
  3. The dev container image is built from the provided Dockerfile. After the container starts, latexmk -v runs automatically as a sanity check, and the configured extensions/settings load.
  4. Create or open a .tex file and hit save—LaTeX Workshop is configured to call latexmk on save, and the PDF preview opens in a tab.

Building outside VS Code

If you prefer the terminal, build the image and run commands directly:

docker build -t latex-env .
docker run --rm -v "$(pwd)":/workspace -w /workspace latex-env -pdf main.tex

Replace main.tex with your entry document. The LATEXMKOPTS environment variable (defined in the dev container) defaults to -pdf -interaction=nonstopmode -file-line-error -synctex=1—pass additional flags after the filename if needed.

Using the Makefile

The included Makefile wraps common workflows. Variables:

  • MAIN (default: main.tex) – entry document.
  • LATEXMKFLAGS (default mirrors LATEXMKOPTS).
  • IMAGE (default: latex-env) – Docker tag when using containerized builds.

Targets:

make build          # latexmk one-shot build -> PDF
make watch          # latexmk -pvc for continuous builds
make clean          # remove latexmk aux artifacts
make docker-build   # docker build -t $(IMAGE) .
make docker-run     # run latexmk inside the built container

When latexmk is available on your host, these targets call it directly. Otherwise make falls back to running the prebuilt Docker image (building it first if missing), so make build just works as long as Docker is running.

Override variables inline, e.g. make MAIN=thesis.tex watch.

Customization tips

  • Add or remove TeX Live collections in Dockerfile to fit your document needs.
  • Tweak LATEXMKOPTS/LATEXMKFLAGS for different engines (XeLaTeX, LuaLaTeX, etc.).
  • Extend the devcontainer.json with additional VS Code extensions or postCreateCommand steps (running tests, fetching templates, etc.).

Happy typesetting!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published