From: Robert D. <rob...@gm...> - 2023-07-28 05:53:44
|
There's been some interest lately in generating TeX output that differs from the default. I'll propose at this point that we implement a system which allows users to switch between TeX flavors (plain TeX, LaTeX, amsTeX, other user-defined stuff). The user interface would be a global variable tex_flavor which names the prevailing flavor. Then the existing tex function would modify the output accordingly. There are probably various ways to implement this, but a major desideratum is that only the stuff that's different from the base flavor needs to be defined. If something is not defined for a flavor, it defaults to the base flavor. This can probably be arranged by establishing a tree of flavors (maybe very simple, if there are only a few flavors) in which a flavor points to its base flavor, and the base flavor doesn't point to any other. If there are just plain TeX, LaTeX, and amsTeX, the tree is just: LaTeX --> TeX <-- amsTeX At present TeX output is defined by symbol properties TEX, TEXWORD, and TEXSYM. I'm inclined to just make additional properties for other flavors -- it's unlikely there are going to be more than a few. The texput function, which assigns new TeX properties, can be modified to observe the prevailing tex_flavor and assign the corresponding properties. There are various details which could be worked out, but anyway I'll let that be enough for now. What does anyone think about that? best Robert PS. I might have written about this stuff before. If so, I don't remember the details; I don't think it matters too much. |