summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2024-03-10 20:06:38 +0000
committerKarl Berry <karl@freefriends.org>2024-03-10 20:06:38 +0000
commit8b66b772aca609441d3e36b9778990439ff00963 (patch)
tree490d5062899203b6ac6d952f2f1017b101fd8372
parenta4ff95712ef6580119da985921a0db1a7615d548 (diff)
luamplib (10mar24)
git-svn-id: svn://tug.org/texlive/trunk@70558 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/luatex/luamplib/NEWS6
-rw-r--r--Master/texmf-dist/doc/luatex/luamplib/luamplib.pdfbin156684 -> 157116 bytes
-rw-r--r--Master/texmf-dist/doc/luatex/luamplib/test-luamplib-latex.tex2
-rw-r--r--Master/texmf-dist/source/luatex/luamplib/luamplib.dtx43
-rw-r--r--Master/texmf-dist/tex/luatex/luamplib/luamplib.lua33
-rw-r--r--Master/texmf-dist/tex/luatex/luamplib/luamplib.sty2
6 files changed, 55 insertions, 31 deletions
diff --git a/Master/texmf-dist/doc/luatex/luamplib/NEWS b/Master/texmf-dist/doc/luatex/luamplib/NEWS
index 9b4f8a665d1..5b7e20f5050 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/03/09 2.26.3
+2024/03/10 2.26.4
+ * not just color names but also color expressions of l3color module
+ are now supported even if xcolor package is loaded
+
+2024/03/07 2.26.3
* color expressions of l3color are supported as well.
But they are regarded as xcolor's expressions if xcolor package is loaded.
* support pdfmanagement's opacity and shading management.
diff --git a/Master/texmf-dist/doc/luatex/luamplib/luamplib.pdf b/Master/texmf-dist/doc/luatex/luamplib/luamplib.pdf
index 206c24eb082..1aefabf1edb 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/doc/luatex/luamplib/test-luamplib-latex.tex b/Master/texmf-dist/doc/luatex/luamplib/test-luamplib-latex.tex
index 400cadcb3f7..246a5bda297 100644
--- a/Master/texmf-dist/doc/luatex/luamplib/test-luamplib-latex.tex
+++ b/Master/texmf-dist/doc/luatex/luamplib/test-luamplib-latex.tex
@@ -1,4 +1,4 @@
-\DocumentMetadata{ }
+\DocumentMetadata{ uncompress }
\documentclass{article}
\usepackage{luamplib}
\usepackage{xcolor}
diff --git a/Master/texmf-dist/source/luatex/luamplib/luamplib.dtx b/Master/texmf-dist/source/luatex/luamplib/luamplib.dtx
index 353e20e2306..8c4b4ff9ac3 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}%
- [2024/03/07 v2.26.3 Interface for using the mplib library]%
+ [2024/03/10 v2.26.4 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{2024/03/07 v2.26.3}
+% \date{2024/03/10 v2.26.4}
%
% \maketitle
%
@@ -306,9 +306,7 @@ See source file '\inFileName' for licencing and contact information.
% as well.
%
% From v2.26.1, \textsf{l3color} is also supported by the command
-% \cs{mpcolor\{color expression\}}.
-% But color expressions (|red!50|) are regarded as \textsf{xcolor}'s
-% expressions if \textsf{xcolor} package is loaded.
+% \cs{mpcolor\{color expression\}}, including spot colors.
%
% \paragraph{\cs{mplibnumbersystem}}
% Users can choose |numbersystem| option since v2.4.
@@ -457,8 +455,8 @@ See source file '\inFileName' for licencing and contact information.
luatexbase.provides_module {
name = "luamplib",
- version = "2.26.3",
- date = "2024/03/07",
+ version = "2.26.4",
+ date = "2024/03/10",
description = "Lua package to typeset Metapost with LuaTeX's MPLib.",
}
@@ -509,6 +507,8 @@ if not texruntoks then
err("Your LuaTeX version is too old. Please upgrade it to the latest")
end
+local is_defined = token.is_defined
+
local mplib = require ('mplib')
local kpse = require ('kpse')
local lfs = require ('lfs')
@@ -1005,7 +1005,7 @@ local mplibcolorfmt = {
[[\color%s}\endgroup]],
}
-local colfmt = token.is_defined'color_select:n' and "l3color" or "xcolor"
+local colfmt = is_defined'color_select:n' and "l3color" or "xcolor"
if colfmt == "l3color" then
run_tex_code{
"\\newcatcodetable\\luamplibcctabexplat",
@@ -1022,15 +1022,24 @@ local ccexplat = luatexbase.registernumber"luamplibcctabexplat"
local function process_color (str)
if str then
- if colfmt == "l3color" and token.is_defined"ver@xcolor.sty" then
- colfmt = "l3xcolor"
- end
- local myfmt = mplibcolorfmt[colfmt]
if not str:find("%b{}") then
str = format("{%s}",str)
end
- if str:find("%b[]") then
- myfmt = mplibcolorfmt.xcolor
+ local myfmt = mplibcolorfmt[colfmt]
+ if colfmt == "l3color" and (is_defined"ver@xcolor.sty" or is_defined"ver@color.sty") then
+ if str:find("%b[]") then
+ myfmt = mplibcolorfmt.xcolor
+ else
+ for _,v in ipairs(str:match"{(.+)}":explode"!") do
+ if not v:find("^%s*%d+%s*$") then
+ local pp = token.get_macro(format("l__color_named_%s_prop",v))
+ if not pp or pp == "" then
+ myfmt = mplibcolorfmt.xcolor
+ break
+ end
+ end
+ end
+ end
end
run_tex_code(myfmt:format(str,str,str), ccexplat or catat11)
local t = texgettoks"mplibtmptoks"
@@ -1590,7 +1599,7 @@ end
%
% Colors and Transparency
% \begin{macrocode}
-local pdfmanagement = token.is_defined'pdfmanagement_add:nnn'
+local pdfmanagement = is_defined'pdfmanagement_add:nnn'
local pdf_objs = {}
local getpageres, setpageres
@@ -1656,7 +1665,7 @@ end
local function tr_pdf_pageresources(mode,opaq)
if not pgf.loaded and pgf.bye then
- pgf.loaded = token.is_defined(pgf.bye)
+ pgf.loaded = is_defined(pgf.bye)
pgf.bye = pgf.loaded and pgf.bye
end
local res, on_on, off_on = "", nil, nil
@@ -2142,7 +2151,7 @@ luamplib.colorconverter = colorconverter
\else
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{luamplib}
- [2024/03/07 v2.26.3 mplib package for LuaTeX]
+ [2024/03/10 v2.26.4 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 c4a846f6d9f..06286a01214 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.26.3",
- date = "2024/03/07",
+ version = "2.26.4",
+ date = "2024/03/10",
description = "Lua package to typeset Metapost with LuaTeX's MPLib.",
}
@@ -46,6 +46,8 @@ if not texruntoks then
err("Your LuaTeX version is too old. Please upgrade it to the latest")
end
+local is_defined = token.is_defined
+
local mplib = require ('mplib')
local kpse = require ('kpse')
local lfs = require ('lfs')
@@ -413,7 +415,7 @@ local mplibcolorfmt = {
[[\color%s}\endgroup]],
}
-local colfmt = token.is_defined'color_select:n' and "l3color" or "xcolor"
+local colfmt = is_defined'color_select:n' and "l3color" or "xcolor"
if colfmt == "l3color" then
run_tex_code{
"\\newcatcodetable\\luamplibcctabexplat",
@@ -430,15 +432,24 @@ local ccexplat = luatexbase.registernumber"luamplibcctabexplat"
local function process_color (str)
if str then
- if colfmt == "l3color" and token.is_defined"ver@xcolor.sty" then
- colfmt = "l3xcolor"
- end
- local myfmt = mplibcolorfmt[colfmt]
if not str:find("%b{}") then
str = format("{%s}",str)
end
- if str:find("%b[]") then
- myfmt = mplibcolorfmt.xcolor
+ local myfmt = mplibcolorfmt[colfmt]
+ if colfmt == "l3color" and (is_defined"ver@xcolor.sty" or is_defined"ver@color.sty") then
+ if str:find("%b[]") then
+ myfmt = mplibcolorfmt.xcolor
+ else
+ for _,v in ipairs(str:match"{(.+)}":explode"!") do
+ if not v:find("^%s*%d+%s*$") then
+ local pp = token.get_macro(format("l__color_named_%s_prop",v))
+ if not pp or pp == "" then
+ myfmt = mplibcolorfmt.xcolor
+ break
+ end
+ end
+ end
+ end
end
run_tex_code(myfmt:format(str,str,str), ccexplat or catat11)
local t = texgettoks"mplibtmptoks"
@@ -905,7 +916,7 @@ local function put_tex_boxes (object,prescript)
end
end
-local pdfmanagement = token.is_defined'pdfmanagement_add:nnn'
+local pdfmanagement = is_defined'pdfmanagement_add:nnn'
local pdf_objs = {}
local getpageres, setpageres
@@ -971,7 +982,7 @@ end
local function tr_pdf_pageresources(mode,opaq)
if not pgf.loaded and pgf.bye then
- pgf.loaded = token.is_defined(pgf.bye)
+ pgf.loaded = is_defined(pgf.bye)
pgf.bye = pgf.loaded and pgf.bye
end
local res, on_on, off_on = "", nil, nil
diff --git a/Master/texmf-dist/tex/luatex/luamplib/luamplib.sty b/Master/texmf-dist/tex/luatex/luamplib/luamplib.sty
index 1b3e98d5573..4f53ce04170 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}
- [2024/03/07 v2.26.3 mplib package for LuaTeX]
+ [2024/03/10 v2.26.4 mplib package for LuaTeX]
\ifx\newluafunction\@undefined
\input ltluatex
\fi