Skip to content

Modernize: TeX Live environment, calkit LaTeX package, and a table - #17

Merged
petebachant merged 17 commits into
mainfrom
modernize
Nov 19, 2026
Merged

petebachant merged 17 commits into
mainfrom
modernize

Conversation

@petebachant

@petebachant petebachant commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

From Claude: This brings the example up to date with how a typical Calkit project is set up now.

Changes

  • The tex environment is now kind: texlive with release: 2025 pinned, replacing the Docker image. docker is dropped from requirements. The lock is .calkit/env-locks/tex.json; the packages the paper needed (amsmath, booktabs, sectsty, siunitx, tools) were added to it on the first build, so packages stays empty in calkit.yaml.
  • The paper loads \usepackage{calkit} and reads its outputs by their path in the project: \ckvalue[.3f]{results/summary.json}{...} for the R² values, \ckfigure{figures/x-vs-y.png}, and \cktable{tables/fits.tex}.
  • The figs-to-paper (map-paths) and results-to-tex (json-to-latex) stages are gone, along with paper/results.tex. The build-paper stage declares no inputs: compiling the pipeline makes it depend on the results, figure, table, and bibliography the paper includes.
  • analyze also writes tables/fits.tex, a booktabs table of each fit's coefficients and R², which the paper includes as Table 1.
  • The py environment is now a uv project (kind: uv), made with calkit new uv-env: pyproject.toml with the same dependencies, locked by uv.lock, and Python pinned to 3.13 in .python-version. requirements.txt and its uv-venv locks are gone. uv.lock and .python-version are now inputs to the Python stages. The dependencies resolved to their latest versions, e.g., matplotlib 3.10.7 to 3.11.2, so the figure's PNG changed bytes but not content; the data and table are unchanged.
  • analyze writes the R² values to results/summary.json at full precision, and the paper rounds them with \ckvalue[.3f], so the PDF shows the same 0.985 and 0.919.
  • The figure's text is rendered with LaTeX: py has with: [tex], and a matplotlibrc in the project sets text.usetex: true and a serif font. Calkit added Matplotlib's usetex packages (cm-super, dvipng, geometry, type1cm, underscore) to tex's lock on the first run. matplotlibrc is an input to analyze, and the Python stages now depend on tex's lock.
  • .devcontainer and .vscode are updated with calkit update devcontainer and calkit update vscode-config.

I built it end to end with Calkit from calkit/calkit's main branch plus unreleased work: calkit run passes, the PDF shows the values, figure, and table, calkit check questions passes, and the pipeline is up to date.

Before merging

  • CI will fail until Calkit's next release. The workflow installs the latest calkit-python from PyPI, 0.52.0, which has TeX Live environments but not with (Compose a TeX Live environment into another with 'with', for Matplotlib's usetex and fonts calkit#2096, merged after it). I left the workflow as is: calkit update github-actions pins the action to the version of Calkit running it, which here was a dev build. It's worth rerunning that once the release is out.
  • New prose needs your review: the paragraph added to the README about the calkit package and TeX Live, and in the paper, the sentence pointing to Table 1 and the table's caption.
  • dvc.lock still has entries for stages no longer in the pipeline (plot-voltage, figs-to-paper, results-to-tex, and four _check_env stages), as main did, so calkit check stage-runs reports them. I didn't edit dvc.lock by hand; Ignore stages removed from the pipeline in 'calkit check stage-runs' calkit#2101 drops them on the next run.
  • The VS Code settings Calkit installs still point LaTeX Workshop at its Docker image, not the TeX Live environment.

Once this merges, calkit/calkit's examples/basic submodule can point at the merge commit.

🤖 Generated with Claude Code

Comment thread calkit.yaml Resolved
Comment thread calkit.yaml Resolved
@petebachant
petebachant merged commit 441e399 into main Nov 19, 2026
1 check passed
@petebachant
petebachant deleted the modernize branch November 19, 2026 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant