Throughout the book in a few places we need to make a code block that looks like it's running but actually it does nothing and some hidden code runs instead. There are a few examples of this in the reading chapter.
But in the PDF build, `python` and `text` blocks don't look like code /output (even though in the HTML build they do). The major issue is that the `.md` files get processed to `.ipynb` files, which distinguish between markdown and code cells -- the `python` and `text` blocks are processed as markdown, while `code-cell` blocks are processed as code.
The right strategy here is probably to somehow edit the pdf style of python/text blocks in myst/sphinx/jbook/???. But I really couldn't figure out how to do it (or even where to do it...).
The strategy I'm taking now in PR #341 is to actually use code blocks that run but discard their output, and fake the output as an actual code cell output using a print (eek....).
This looks the same in HTML but fixes the PDF render.
BUT it is really not great, because code that was previously in `python` tags that shouldn't run is actually running...so we need to handle the broken results of these now.
I'll leave this issue here just to say this is currently not fantastic and we should try to get back to the non-running `python`/`text` tag version of things at some point.
Throughout the book in a few places we need to make a code block that looks like it's running but actually it does nothing and some hidden code runs instead. There are a few examples of this in the reading chapter.
We used to use a pattern like: