diff options
author | Norbert Preining <norbert@preining.info> | 2021-08-04 03:00:43 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2021-08-04 03:00:43 +0000 |
commit | da02fd6ad1c5fb45c5ec641bf236d8de4745709f (patch) | |
tree | 9dcca034494c127f45a96f07db11ee3287e27836 /macros/luatex/generic/luamplib/luamplib.dtx | |
parent | 363ea487975bcc527ccdb2c9b5dda1b27cf839b2 (diff) |
CTAN sync 202108040300
Diffstat (limited to 'macros/luatex/generic/luamplib/luamplib.dtx')
-rw-r--r-- | macros/luatex/generic/luamplib/luamplib.dtx | 50 |
1 files changed, 28 insertions, 22 deletions
diff --git a/macros/luatex/generic/luamplib/luamplib.dtx b/macros/luatex/generic/luamplib/luamplib.dtx index 88371fafd4..7257505dd5 100644 --- a/macros/luatex/generic/luamplib/luamplib.dtx +++ b/macros/luatex/generic/luamplib/luamplib.dtx @@ -85,7 +85,7 @@ See source file '\inFileName' for licencing and contact information. %<*driver> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{luamplib.drv}% - [2021/08/02 v2.20.8 Interface for using the mplib library]% + [2021/08/03 v2.20.9 Interface for using the mplib library]% \documentclass{ltxdoc} \usepackage{metalogo,multicol,mdwlist,fancyvrb,xspace} \usepackage[x11names]{xcolor} @@ -153,7 +153,7 @@ See source file '\inFileName' for licencing and contact information. % \author{Hans Hagen, Taco Hoekwater, Elie Roux, Philipp Gesang and Kim Dohyun\\ % Maintainer: LuaLaTeX Maintainers --- % Support: \email{lualatex-dev@tug.org}} -% \date{2021/08/02 v2.20.8} +% \date{2021/08/03 v2.20.9} % % \maketitle % @@ -413,16 +413,22 @@ See source file '\inFileName' for licencing and contact information. luatexbase.provides_module { name = "luamplib", - version = "2.20.8", - date = "2021/08/02", + version = "2.20.9", + date = "2021/08/03", description = "Lua package to typeset Metapost with LuaTeX's MPLib.", } local format, abs = string.format, math.abs -local err = function(...) return luatexbase.module_error ("luamplib", format(...)) end -local warn = function(...) return luatexbase.module_warning("luamplib", format(...)) end -local info = function(...) return luatexbase.module_info ("luamplib", format(...)) end +local err = function(...) + return luatexbase.module_error ("luamplib", select("#",...) > 1 and format(...) or ...) +end +local warn = function(...) + return luatexbase.module_warning("luamplib", select("#",...) > 1 and format(...) or ...) +end +local info = function(...) + return luatexbase.module_info ("luamplib", select("#",...) > 1 and format(...) or ...) +end % \end{macrocode} % @@ -548,10 +554,10 @@ function luamplib.getcachedir(dir) if is_writable(dir) then luamplib.cachedir = dir else - warn("Directory '"..dir.."' is not writable!") + warn("Directory '%s' is not writable!", dir) end else - warn("Directory '"..dir.."' does not exist!") + warn("Directory '%s' does not exist!", dir) end end end @@ -766,6 +772,7 @@ local function luamplibload (name) make_text = luamplib.maketext, run_script = luamplib.runscript, math_mode = luamplib.numbersystem, + random_seed = math.random(4095), extensions = 1, } % \end{macrocode} @@ -1019,13 +1026,13 @@ mp.mf_finish_saving_data = mp.mf_finish_saving_data or function() end catcodes = catcodes or {} local catcodes = catcodes catcodes.numbers = catcodes.numbers or {} -catcodes.numbers.ctxcatcodes = catcodes.numbers.ctxcatcodes or "0" -catcodes.numbers.texcatcodes = catcodes.numbers.texcatcodes or "0" -catcodes.numbers.luacatcodes = catcodes.numbers.luacatcodes or "0" -catcodes.numbers.notcatcodes = catcodes.numbers.notcatcodes or "0" -catcodes.numbers.vrbcatcodes = catcodes.numbers.vrbcatcodes or "0" -catcodes.numbers.prtcatcodes = catcodes.numbers.prtcatcodes or "0" -catcodes.numbers.txtcatcodes = catcodes.numbers.txtcatcodes or "0" +catcodes.numbers.ctxcatcodes = catcodes.numbers.ctxcatcodes or catlatex +catcodes.numbers.texcatcodes = catcodes.numbers.texcatcodes or catlatex +catcodes.numbers.luacatcodes = catcodes.numbers.luacatcodes or catlatex +catcodes.numbers.notcatcodes = catcodes.numbers.notcatcodes or catlatex +catcodes.numbers.vrbcatcodes = catcodes.numbers.vrbcatcodes or catlatex +catcodes.numbers.prtcatcodes = catcodes.numbers.prtcatcodes or catlatex +catcodes.numbers.txtcatcodes = catcodes.numbers.txtcatcodes or catlatex % \end{macrocode} % @@ -1064,15 +1071,14 @@ function luamplib.runscript (code) function mp.print(...) mpprint(buffer,...) end - local result = f() - buffer = tableconcat(buffer,"") + f() + buffer = tableconcat(buffer) if buffer and buffer ~= "" then return buffer end buffer = {} - mpprint(buffer, result) - buffer = tableconcat(buffer) - return buffer + mpprint(buffer, f()) + return tableconcat(buffer) end return "" end @@ -1996,7 +2002,7 @@ luamplib.colorconverter = colorconverter \else \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{luamplib} - [2021/08/02 v2.20.8 mplib package for LuaTeX] + [2021/08/03 v2.20.9 mplib package for LuaTeX] \ifx\newluafunction\@undefined \input ltluatex \fi |