summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/luatex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-08-08 21:07:36 +0000
committerKarl Berry <karl@freefriends.org>2021-08-08 21:07:36 +0000
commitab9273e9461abb560d344e43c377de25f4e2577b (patch)
treeaa356185a59627324aecdd1aa36e53d1466d7a0e /Master/texmf-dist/source/luatex
parenteec3a67f3a57872862cf4adee13eeddc981d5442 (diff)
luamplib (8aug21)
git-svn-id: svn://tug.org/texlive/trunk@60197 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/luatex')
-rw-r--r--Master/texmf-dist/source/luatex/luamplib/luamplib.dtx50
1 files changed, 28 insertions, 22 deletions
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