summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Master/texmf-dist/doc/luatex/luamplib/NEWS3
-rw-r--r--Master/texmf-dist/doc/luatex/luamplib/luamplib.pdfbin151067 -> 151131 bytes
-rw-r--r--Master/texmf-dist/source/luatex/luamplib/luamplib.dtx50
-rw-r--r--Master/texmf-dist/tex/luatex/luamplib/luamplib.lua44
-rw-r--r--Master/texmf-dist/tex/luatex/luamplib/luamplib.sty2
5 files changed, 57 insertions, 42 deletions
diff --git a/Master/texmf-dist/doc/luatex/luamplib/NEWS b/Master/texmf-dist/doc/luatex/luamplib/NEWS
index 76cf284ab9d..293da0dc6b9 100644
--- a/Master/texmf-dist/doc/luatex/luamplib/NEWS
+++ b/Master/texmf-dist/doc/luatex/luamplib/NEWS
@@ -1,5 +1,8 @@
History of the luamplib package
+2021/08/03 2.20.9
+ * initialize every mplib instance with random integer seed values
+
2021/08/02 2.20.8
* when \mplibshowlog{enable} is declared, log (not term) messages
returned by mplib instance will be printed into the .log file.
diff --git a/Master/texmf-dist/doc/luatex/luamplib/luamplib.pdf b/Master/texmf-dist/doc/luatex/luamplib/luamplib.pdf
index 3a0f3c8b650..9230176d042 100644
--- a/Master/texmf-dist/doc/luatex/luamplib/luamplib.pdf
+++ b/Master/texmf-dist/doc/luatex/luamplib/luamplib.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/luatex/luamplib/luamplib.dtx b/Master/texmf-dist/source/luatex/luamplib/luamplib.dtx
index 88371fafd49..7257505dd5d 100644
--- a/Master/texmf-dist/source/luatex/luamplib/luamplib.dtx
+++ b/Master/texmf-dist/source/luatex/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
diff --git a/Master/texmf-dist/tex/luatex/luamplib/luamplib.lua b/Master/texmf-dist/tex/luatex/luamplib/luamplib.lua
index 0ea75e7b61f..a204896d530 100644
--- a/Master/texmf-dist/tex/luatex/luamplib/luamplib.lua
+++ b/Master/texmf-dist/tex/luatex/luamplib/luamplib.lua
@@ -11,16 +11,22 @@
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
luamplib = luamplib or { }
local luamplib = luamplib
@@ -118,10 +124,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
@@ -285,6 +291,7 @@ local function luamplibload (name)
make_text = luamplib.maketext,
run_script = luamplib.runscript,
math_mode = luamplib.numbersystem,
+ random_seed = math.random(4095),
extensions = 1,
}
local preamble = preamble .. luamplib.mplibcodepreamble
@@ -447,13 +454,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
local function mpprint(buffer,...)
for i=1,select("#",...) do
@@ -488,15 +495,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
diff --git a/Master/texmf-dist/tex/luatex/luamplib/luamplib.sty b/Master/texmf-dist/tex/luatex/luamplib/luamplib.sty
index e37fc3da406..bc285803488 100644
--- a/Master/texmf-dist/tex/luatex/luamplib/luamplib.sty
+++ b/Master/texmf-dist/tex/luatex/luamplib/luamplib.sty
@@ -14,7 +14,7 @@
\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