diff options
Diffstat (limited to 'macros/luatex/generic/minim')
-rw-r--r-- | macros/luatex/generic/minim/README | 8 | ||||
-rw-r--r-- | macros/luatex/generic/minim/minim-alloc.doc | 2 | ||||
-rw-r--r-- | macros/luatex/generic/minim/minim-alloc.lua | 18 | ||||
-rw-r--r-- | macros/luatex/generic/minim/minim-alloc.tex | 15 | ||||
-rw-r--r-- | macros/luatex/generic/minim/minim-callbacks.lua | 5 | ||||
-rw-r--r-- | macros/luatex/generic/minim/minim-doc.sty | 3 | ||||
-rw-r--r-- | macros/luatex/generic/minim/minim-pdfresources.lua | 2 | ||||
-rw-r--r-- | macros/luatex/generic/minim/minim.doc | 4 | ||||
-rw-r--r-- | macros/luatex/generic/minim/minim.pdf | bin | 317085 -> 321641 bytes |
9 files changed, 42 insertions, 15 deletions
diff --git a/macros/luatex/generic/minim/README b/macros/luatex/generic/minim/README index 31c34b28bf..2114fa4fb4 100644 --- a/macros/luatex/generic/minim/README +++ b/macros/luatex/generic/minim/README @@ -1,4 +1,4 @@ -Version: 2022/1.1 +Version: 2023/1.2 SUMMARY @@ -31,6 +31,12 @@ the packages mentioned above. HISTORY +2023/1.2 (3/3/2023) + + * Added \Ucharcat, as in XeTeX. + * Gave sensible definitions to unicode space characters. + * Updated the manual to reflect the latest versions of the other minims. + 2022/1.1 (3/3/2022) Major changes: diff --git a/macros/luatex/generic/minim/minim-alloc.doc b/macros/luatex/generic/minim/minim-alloc.doc index edf268c81d..4aec2d39fc 100644 --- a/macros/luatex/generic/minim/minim-alloc.doc +++ b/macros/luatex/generic/minim/minim-alloc.doc @@ -233,7 +233,7 @@ in into an eternal loop, however. On the tex side, ⟦*\voidbox⟧, ⟦*\ignore⟧, ⟦*\spacechar⟧, ⟦*\unbrace⟧, ⟦*\firstoftwo⟧ and ⟦*\secondoftwo⟧ should be self-explanatory and -uncontroversial additions. For looking ahead, you can use +uncontroversial additions. ⟦*\Ucharcat⟧ works as in xetex. For looking ahead, you can use ⟦*\nextif \token {executed if present} {executed if not}⟧ or its siblings ⟦*\nextifx⟧ and ⟦*\nextifcat⟧. For defining macros with optional arguments, ⟦*\withoptions[default]{code}⟧ diff --git a/macros/luatex/generic/minim/minim-alloc.lua b/macros/luatex/generic/minim/minim-alloc.lua index 8f6a69ed0d..3775aafa43 100644 --- a/macros/luatex/generic/minim/minim-alloc.lua +++ b/macros/luatex/generic/minim/minim-alloc.lua @@ -50,8 +50,8 @@ local function pdf_hex_string(text) insert_formatted(str, '%04x', i) else i = i - 0x10000 - m = math.floor(i/0x400) + 0xd800 - n = ( i % 0x400 ) + 0xdc00 + local m = math.floor(i/0x400) + 0xd800 + local n = ( i % 0x400 ) + 0xdc00 insert_formatted(str, '%04x%04x', m, n) end end @@ -177,7 +177,7 @@ end function M.table_to_text (tbl) local r = { } for i,t in pairs(tbl) do - local l = '' + local l if type(i) == 'string' then l = string.format('[%q] = ', i) else @@ -282,7 +282,7 @@ M.luadef('minim:currentfile', function() end) -- make pdf_string() available as \pdfstring{...} -M.luadef('pdfstring', function() M.pdf_string(token.scan_string()) end) +M.luadef('pdfstring', function() tex.sprint(M.pdf_string(token.scan_string())) end) -- uselanguage hook callback cb.new_callback('uselanguage', 'simple') @@ -291,6 +291,12 @@ M.luadef('minim:uselanguagecallback', function() cb.call_callback('uselanguage', langname) end) +-- copy of \Ucharcat from xetex +M.luadef('Ucharcat', function() + local chr, cat = token.scan_int(), token.scan_int() + token.put_next(token.new(chr, cat)) +end) + --1 dumping information to the format file -- reserve a bytecode register @@ -302,7 +308,7 @@ token.set_macro('minim:restoremodules', '\\luabytecodecall'..saved_tables_byteco local function dump_saved_tables() M.msg('pre_dump: save modules and tables to format file') -- save modules - for i,name in ipairs (modules) do + for _, name in ipairs (modules) do if not modules[name] then M.msg('saving module '..name) -- reserve (if necessary) a bytecode register @@ -313,7 +319,7 @@ local function dump_saved_tables() end -- save tables (and restore modules) local saved_tables = [[ - + -- include all saved tables in this bytecode register local t = ]]..M.table_to_text(tables)..[[ diff --git a/macros/luatex/generic/minim/minim-alloc.tex b/macros/luatex/generic/minim/minim-alloc.tex index 8752c2e336..4110301413 100644 --- a/macros/luatex/generic/minim/minim-alloc.tex +++ b/macros/luatex/generic/minim/minim-alloc.tex @@ -10,6 +10,21 @@ \suppressoutererror = 1 \frenchspacing +% unicode space characters +\def\hairspace{\kern .1em } +\def\threeperemspace{\kern .33333em } +\def\fourperemspace {\kern .25em } +\catcode"00A0 = \active \letcharcode"00A0 = ~ % no-break +\catcode"2002 = \active \letcharcode"2002 = \enskip +\catcode"2003 = \active \letcharcode"2003 = \quad +\catcode"2004 = \active \letcharcode"2004 = \threeperemspace +\catcode"2005 = \active \letcharcode"2005 = \fourperemspace +\catcode"2006 = \active \letcharcode"2006 = \thinspace % six-per-em +\catcode"2008 = \active \letcharcode"2008 = \thinspace % punctuation +\catcode"2009 = \active \letcharcode"2009 = \thinspace % thin +\catcode"200A = \active \letcharcode"200A = \hairspace % hair +\catcode"202F = \active \letcharcode"202F = \thinspace % narrow no-break + % 1 programming macros \newbox\voidbox \setbox0=\box\voidbox diff --git a/macros/luatex/generic/minim/minim-callbacks.lua b/macros/luatex/generic/minim/minim-callbacks.lua index af3db59e24..b0ecc1a711 100644 --- a/macros/luatex/generic/minim/minim-callbacks.lua +++ b/macros/luatex/generic/minim/minim-callbacks.lua @@ -217,7 +217,7 @@ end -- TODO: preserve return values local primitively_registered = { } function M.primitiveregister(cb, f) - local rv = false + local rv, _ if f == nil then f = primitively_registered[cb] if f == nil then @@ -307,7 +307,6 @@ for n,f in pairs(primitively_registered) do do_log('restore callback: %s', n) M.primitiveregister (n,f) end -saved = nil -- @@ -317,7 +316,7 @@ callback.list = M.list callback.register = M.primitiveregister log = do_log -local function alog(msg, ...) +alog = function(msg, ...) texio.write('log', string.format(msg, ...)) end diff --git a/macros/luatex/generic/minim/minim-doc.sty b/macros/luatex/generic/minim/minim-doc.sty index 93e770153b..5da6494c5e 100644 --- a/macros/luatex/generic/minim/minim-doc.sty +++ b/macros/luatex/generic/minim/minim-doc.sty @@ -178,6 +178,7 @@ endfig;} \autotagformulas +\def\mailname{minim} \def\maketitle{% \setembeddedfilesmoddate {\getmetadata date} \begingroup @@ -189,7 +190,7 @@ endfig;} \qquad##\quad&##\hfil\cr author&\getmetadata author\cr contact&{\def\tmp{@}\def\TMP{.}% - minim\tmp elrenkema\TMP nl}\cr} + \mailname\tmp elrenkema\TMP nl}\cr} \smallskip} % 1 Chapters and full manuals diff --git a/macros/luatex/generic/minim/minim-pdfresources.lua b/macros/luatex/generic/minim/minim-pdfresources.lua index bc09aeaf40..e6a06e783e 100644 --- a/macros/luatex/generic/minim/minim-pdfresources.lua +++ b/macros/luatex/generic/minim/minim-pdfresources.lua @@ -73,7 +73,7 @@ if not M.self_destruct then pdf.add_page_resource = M.add_global_resource end --- for nonglobal resources, every use must be markes with a late_lua node. from +-- for nonglobal resources, every use must be marked with a late_lua node. from -- those, the M.use_resouce() function will be called automatically. -- local page_resources = init_resources() -- name ↦ '/Key <value>' diff --git a/macros/luatex/generic/minim/minim.doc b/macros/luatex/generic/minim/minim.doc index a0ad8f2d4a..7061917398 100644 --- a/macros/luatex/generic/minim/minim.doc +++ b/macros/luatex/generic/minim/minim.doc @@ -4,8 +4,8 @@ \startmetadata author {Esger Renkema} title {minim} - date {2022-03-03} - version {2022/1.1} + date {2023-03-03} + version {2023/1.2} keywords {LuaTeX; Plain TeX; MetaPost; PDF/A; Tagged PDF; accessibility; a11y; Unicode mathematics; XMP; metadata; hypertext; bookmarks} stopmetadata diff --git a/macros/luatex/generic/minim/minim.pdf b/macros/luatex/generic/minim/minim.pdf Binary files differindex 1596eb65d4..3685ecf7fd 100644 --- a/macros/luatex/generic/minim/minim.pdf +++ b/macros/luatex/generic/minim/minim.pdf |