A devcontainer to build a grad school math course workspace. Opioninated for Python and Latex.
I generally use this workspace in one of two ways.
- Local development on VS Code using either of my machines (Macbook or Linux box)
- Codespaces on Github (which allows me to work on any machine I can login to Github, including my iPad)
I assume that the course is structured in weekly modules and that course work involves some problem set from a textbook and some software assignment.
First, I create a directory called module-{x} where x is that week's module number.
Then, I create a text file like assignment-example.md. See the example assignment for more details.
The devcontainer includes a full LaTeX toolchain (TeX Live) plus ChkTeX for linting LaTeX source.
To lint a LaTeX file you can run:
chktex assignment-example.tex
For any part of the assignment that uses Python, I change directory to the module and then use I use uv which is already installed on the devcontainer to set up Python for each module.
cd module-exampleuv inituv add numpy matplotlibor whatever dependencies you need.uv run software_assignment.py- [Optional for linting]
uv add ruff - [Optional for linting]
uv run -m ruff format
I then copy the Python code into the assignment and link any images created from a library like matplotlib. See the example assignment for more details.