Show2.lua: a small library for showing LaTeXed LaTeX codeIn 2022 I made two videos - here: Pict2e-lua and Eev-TikZ - about how I was using Lua and eepitch to create LaTeX diagrams incrementally using REPLs. Here are two screenshots: They both use this 3-window setting,
in which at the left half there's the Lua program that I am editing, at the upper right there's a target buffer running a Lua REPL, and at the lower right there's a buffer viewing the resulting PDF. These are some commands with very short names that I use very often,
so it was natural to define a function called (etv) that would create that 3-window setting. I used it like this:
Here the "a \\cdot b" is a very small chunk of LaTeX code. The line with the "show" does the first part of showing it as a PDF, and the (etv) does the rest: the :show() produces a PDF, and the (etv) creates a 3-window setting and displays the current version of the PDF in its lower left part. In short, what happens is this:
We can expand it into the diagram below. Running ("a \\cdot b"):show() creates an object of the class Show, so let's start with
to store that object into a variable s. We have:
(TODO: explain the rest; explain globals; explain code-etv2) |