The wave-C2 migration (#375, publish-2026aug18) fixed the reason the downloadable five_preferences.ipynb could not run — the loadmat('dataBHS.mat') read against a file the site never served. A human Colab run on 2026-08-18 (the in-browser check requested on QuantEcon/data-lectures#84) confirms the notebook now gets past setup and into execution, and then surfaces a second, older blocker that is specific to Colab:
RuntimeError: Failed to process string with tex because latex could not be found
<Figure size 1600x700 with 2 Axes>
Cause. The notebook's rc-params cell sets plt.rc('text', usetex=True), which makes matplotlib shell out to a system latex binary for every rendered text string. Colab's runtime ships no LaTeX distribution, so the first figure that renders text — the entropy contour pair, figsize=(16, 7), matching the 1600x700 with 2 Axes in the traceback — raises, roughly 50 cells before the lecture's data read. Since Colab's "Run all" stops at the first error, a Colab reader never reaches the repointed read_csv cell at all.
Why only this lecture. five_preferences.md is the only lecture in this repo that sets usetex=True (checked 2026-08-18 across lectures/*.md). The published site is unaffected — CI installs texlive — and so is any local jupyter with a TeX distribution, which is why the notebook executes end-to-end outside Colab (verified with nbclient, 66 cells, 0 errors, on the QuantEcon/data-lectures#100 validation). The failure is exactly scoped to the "open in Colab" path.
Not a migration regression: the setting predates the wave-C2 work, and a Colab run would have failed at the same cell before it. The migration just removed the blocker that used to sit in front of this one.
Options, in the order I would consider them:
- Guard the setting so it degrades instead of raising:
plt.rc('text', usetex=bool(shutil.which('latex'))). The published site keeps its current typography (CI has texlive); Colab and other latex-less runtimes fall back to matplotlib's mathtext, which handles the lecture's $…$ labels with slightly different rendering but the same content.
- Drop
usetex=True for mathtext everywhere. Simplest, and consistent with the rest of the repo (no other lecture uses it), but the published figures' typography changes and would want a visual once-over.
- Have the notebook install texlive in Colab. Not recommended — several minutes of apt on every Colab session for typography.
The byte-identical five_preferences.md in lecture-tools-techniques carries the same setting twice, so its notebook has both this blocker and the original .mat one — noted on QuantEcon/lecture-tools-techniques#11 so the two get fixed together there.
The wave-C2 migration (#375, publish-2026aug18) fixed the reason the downloadable
five_preferences.ipynbcould not run — theloadmat('dataBHS.mat')read against a file the site never served. A human Colab run on 2026-08-18 (the in-browser check requested on QuantEcon/data-lectures#84) confirms the notebook now gets past setup and into execution, and then surfaces a second, older blocker that is specific to Colab:Cause. The notebook's rc-params cell sets
plt.rc('text', usetex=True), which makes matplotlib shell out to a systemlatexbinary for every rendered text string. Colab's runtime ships no LaTeX distribution, so the first figure that renders text — the entropy contour pair,figsize=(16, 7), matching the1600x700 with 2 Axesin the traceback — raises, roughly 50 cells before the lecture's data read. Since Colab's "Run all" stops at the first error, a Colab reader never reaches the repointedread_csvcell at all.Why only this lecture.
five_preferences.mdis the only lecture in this repo that setsusetex=True(checked 2026-08-18 acrosslectures/*.md). The published site is unaffected — CI installs texlive — and so is any local jupyter with a TeX distribution, which is why the notebook executes end-to-end outside Colab (verified with nbclient, 66 cells, 0 errors, on the QuantEcon/data-lectures#100 validation). The failure is exactly scoped to the "open in Colab" path.Not a migration regression: the setting predates the wave-C2 work, and a Colab run would have failed at the same cell before it. The migration just removed the blocker that used to sit in front of this one.
Options, in the order I would consider them:
plt.rc('text', usetex=bool(shutil.which('latex'))). The published site keeps its current typography (CI has texlive); Colab and other latex-less runtimes fall back to matplotlib's mathtext, which handles the lecture's$…$labels with slightly different rendering but the same content.usetex=Truefor mathtext everywhere. Simplest, and consistent with the rest of the repo (no other lecture uses it), but the published figures' typography changes and would want a visual once-over.The byte-identical
five_preferences.mdin lecture-tools-techniques carries the same setting twice, so its notebook has both this blocker and the original.matone — noted on QuantEcon/lecture-tools-techniques#11 so the two get fixed together there.