From 5967c77e1f535b1ec73002331c156e82993b297a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Vlas=C3=A1k?= Date: Thu, 2 Nov 2023 18:12:56 +0100 Subject: [PATCH] minim.opm: Patch `\newcatcodetable` before loading minim-alloc In the latest release minim actually uses `\newcatcodetable` in minim-alloc.tex. This means that it still uses the standard OpTeX definition (which doesn't initialize the catcode table), but it expects the initialization. We solve this by doing the patch to `\newcatcodetable` _before_ loading minim-alloc.tex. It should have probably been done this way right from the beginning, it just didn't manifest. --- optex/pkg/minim.opm | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/optex/pkg/minim.opm b/optex/pkg/minim.opm index 79298552..5bf4c0fe 100644 --- a/optex/pkg/minim.opm +++ b/optex/pkg/minim.opm @@ -92,6 +92,18 @@ tex.setcount("global", "e@alloc@luafunction@count", \csstring\#function_table) } + \_doc + Both \LaTeX/ and the minim inspired catcode table allocators initialize the + catcode tables with `\initcatcodetable` (i.e. ini\TeX/ catcodes). \OpTeX/ + merely allocates the registers. \LuaTeX/ doesn't allow to activate + unitialized catcode table, therefore activation with either + `\initcatcodetable` or `\savecatcodetable` is necessary before use. To + ensure compatibility with foreign macros, we also issue `\initcatcodetable` + on allocation in the public version of `\newcatcodetable`. + \_cod + +\_def\newcatcodetable#1{\_newcatcodetable#1\_initcatcodetable#1} + \_doc We also get PDF resources out of the way now. Minim is ready to use \OpTeX's PDF resource management, but also has compatibility layer for PGF, which is @@ -106,18 +118,6 @@ \input minim-alloc - \_doc - Both \LaTeX/ and the minim inspired catcode table allocators initialize the - catcode tables with `\initcatcodetable` (i.e. ini\TeX/ catcodes). \OpTeX/ - merely allocates the registers. \LuaTeX/ doesn't allow to activate - unitialized catcode table, therefore activation with either - `\initcatcodetable` or `\savecatcodetable` is necessary before use. To - ensure compatibility with foreign macros, we also issue `\initcatcodetable` - on allocation in the public version of `\newcatcodetable`. - \_cod - -\_def\newcatcodetable#1{\_newcatcodetable#1\_initcatcodetable#1} - \_doc By now, the Knuthian allocators are dealt with. \eTeX/ global and local allocators are undefined, but the global ones are expected in minim's Lua