summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2023-08-07 19:47:57 +0000
committerKarl Berry <karl@freefriends.org>2023-08-07 19:47:57 +0000
commit255381979a56f1f9095e3cb72cca4f16fdc49a6d (patch)
tree73f5c937f9f028772075a65375127ea4092ef520 /Master
parent57dfa5f3c5caadee1c2ec570f8316911123fa977 (diff)
luamplib (7aug23)
git-svn-id: svn://tug.org/texlive/trunk@67836 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/doc/luatex/luamplib/NEWS6
-rw-r--r--Master/texmf-dist/doc/luatex/luamplib/luamplib.pdfbin153447 -> 153613 bytes
-rw-r--r--Master/texmf-dist/source/luatex/luamplib/luamplib.dtx24
-rw-r--r--Master/texmf-dist/tex/luatex/luamplib/luamplib.lua18
-rw-r--r--Master/texmf-dist/tex/luatex/luamplib/luamplib.sty2
5 files changed, 29 insertions, 21 deletions
diff --git a/Master/texmf-dist/doc/luatex/luamplib/NEWS b/Master/texmf-dist/doc/luatex/luamplib/NEWS
index b76bd8b562a..f66689f163f 100644
--- a/Master/texmf-dist/doc/luatex/luamplib/NEWS
+++ b/Master/texmf-dist/doc/luatex/luamplib/NEWS
@@ -1,6 +1,10 @@
History of the luamplib package
-2024/04/04 2.24.0
+2023/08/07 2.25.0
+ * propagate tex's jobname varible into mplib process as well.
+ * protect "..." if and only if textextlabel is enabled.
+
+2023/04/04 2.24.0
respect '-recorder' command-line option
2022/01/12 2.23.0
diff --git a/Master/texmf-dist/doc/luatex/luamplib/luamplib.pdf b/Master/texmf-dist/doc/luatex/luamplib/luamplib.pdf
index b9aadd7e0c0..45be990ec5b 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 35615062d22..61e3878a17f 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}%
- [2023/04/04 v2.24.0 Interface for using the mplib library]%
+ [2023/08/07 v2.25.0 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{2023/04/04 v2.24.0}
+% \date{2023/08/07 v2.25.0}
%
% \maketitle
%
@@ -446,8 +446,8 @@ See source file '\inFileName' for licencing and contact information.
luatexbase.provides_module {
name = "luamplib",
- version = "2.24.0",
- date = "2023/04/04",
+ version = "2.25.0",
+ date = "2023/08/07",
description = "Lua package to typeset Metapost with LuaTeX's MPLib.",
}
@@ -517,9 +517,6 @@ local file = file or { }
local replacesuffix = file.replacesuffix or function(filename, suffix)
return (filename:gsub("%.[%a%d]+$","")) .. "." .. suffix
end
-local stripsuffix = file.stripsuffix or function(filename)
- return (filename:gsub("%.[%a%d]+$",""))
-end
local is_writable = file.is_writable or function(name)
if lfsisdir(name) then
@@ -820,6 +817,7 @@ local function luamplibload (name)
make_text = luamplib.maketext,
run_script = luamplib.runscript,
math_mode = luamplib.numbersystem,
+ job_name = tex.jobname,
random_seed = math.random(4095),
extensions = 1,
}
@@ -1313,7 +1311,9 @@ local function process_mplibcode (data, instancename)
% It has turned out that no comment sign is allowed.
% \begin{macrocode}
if not luamplib.verbatiminput then
- data = data:gsub("\".-\"", protect_expansion)
+ if luamplib.textextlabel then
+ data = data:gsub("\".-\"", protect_expansion)
+ end
data = data:gsub("\\%%", "\0PerCent\0")
data = data:gsub("%%.-\n","")
@@ -1326,7 +1326,9 @@ local function process_mplibcode (data, instancename)
% Next line to address issue \#55
% \begin{macrocode}
data = data:gsub("##", "#")
- data = data:gsub("\".-\"", unprotect_expansion)
+ if luamplib.textextlabel then
+ data = data:gsub("\".-\"", unprotect_expansion)
+ end
data = data:gsub(btex_etex, function(str)
return format("btex %s etex", unprotect_expansion(str))
end)
@@ -1546,7 +1548,7 @@ local pdf_objs = {}
local token, getpageres, setpageres = newtoken or token
local pgf = { bye = "pgfutil@everybye", extgs = "pgf@sys@addpdfresource@extgs@plain" }
-if pdfmode then -- repect luaotfload-colors
+if pdfmode then -- respect luaotfload-colors
getpageres = pdf.getpageresources or function() return pdf.pageresources end
setpageres = pdf.setpageresources or function(s) pdf.pageresources = s end
else
@@ -2063,7 +2065,7 @@ luamplib.colorconverter = colorconverter
\else
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{luamplib}
- [2023/04/04 v2.24.0 mplib package for LuaTeX]
+ [2023/08/07 v2.25.0 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 4ce639cbcca..af7666ecc96 100644
--- a/Master/texmf-dist/tex/luatex/luamplib/luamplib.lua
+++ b/Master/texmf-dist/tex/luatex/luamplib/luamplib.lua
@@ -11,8 +11,8 @@
luatexbase.provides_module {
name = "luamplib",
- version = "2.24.0",
- date = "2023/04/04",
+ version = "2.25.0",
+ date = "2023/08/07",
description = "Lua package to typeset Metapost with LuaTeX's MPLib.",
}
@@ -60,9 +60,6 @@ local file = file or { }
local replacesuffix = file.replacesuffix or function(filename, suffix)
return (filename:gsub("%.[%a%d]+$","")) .. "." .. suffix
end
-local stripsuffix = file.stripsuffix or function(filename)
- return (filename:gsub("%.[%a%d]+$",""))
-end
local is_writable = file.is_writable or function(name)
if lfsisdir(name) then
@@ -305,6 +302,7 @@ local function luamplibload (name)
make_text = luamplib.maketext,
run_script = luamplib.runscript,
math_mode = luamplib.numbersystem,
+ job_name = tex.jobname,
random_seed = math.random(4095),
extensions = 1,
}
@@ -676,7 +674,9 @@ local function process_mplibcode (data, instancename)
end)
if not luamplib.verbatiminput then
- data = data:gsub("\".-\"", protect_expansion)
+ if luamplib.textextlabel then
+ data = data:gsub("\".-\"", protect_expansion)
+ end
data = data:gsub("\\%%", "\0PerCent\0")
data = data:gsub("%%.-\n","")
@@ -685,7 +685,9 @@ local function process_mplibcode (data, instancename)
run_tex_code(format("\\mplibtmptoks\\expanded{{%s}}",data))
data = texgettoks"mplibtmptoks"
data = data:gsub("##", "#")
- data = data:gsub("\".-\"", unprotect_expansion)
+ if luamplib.textextlabel then
+ data = data:gsub("\".-\"", unprotect_expansion)
+ end
data = data:gsub(btex_etex, function(str)
return format("btex %s etex", unprotect_expansion(str))
end)
@@ -878,7 +880,7 @@ local pdf_objs = {}
local token, getpageres, setpageres = newtoken or token
local pgf = { bye = "pgfutil@everybye", extgs = "pgf@sys@addpdfresource@extgs@plain" }
-if pdfmode then -- repect luaotfload-colors
+if pdfmode then -- respect luaotfload-colors
getpageres = pdf.getpageresources or function() return pdf.pageresources end
setpageres = pdf.setpageresources or function(s) pdf.pageresources = s end
else
diff --git a/Master/texmf-dist/tex/luatex/luamplib/luamplib.sty b/Master/texmf-dist/tex/luatex/luamplib/luamplib.sty
index 457fa45f173..9d274bd4530 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}
- [2023/04/04 v2.24.0 mplib package for LuaTeX]
+ [2023/08/07 v2.25.0 mplib package for LuaTeX]
\ifx\newluafunction\@undefined
\input ltluatex
\fi