diff options
author | Karl Berry <karl@freefriends.org> | 2021-08-02 20:24:16 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-08-02 20:24:16 +0000 |
commit | 017667d735e59dbfa17601f50ff1c7cd9d10cf41 (patch) | |
tree | fcc7dd82ec2353f661d84c0ec792101093e14ab3 /Master/texmf-dist/tex/luatex | |
parent | 69b231694e0fdba26f2987ff182f2a957b722ff2 (diff) |
luamplib (2aug21)
git-svn-id: svn://tug.org/texlive/trunk@60147 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex')
-rw-r--r-- | Master/texmf-dist/tex/luatex/luamplib/luamplib.lua | 20 | ||||
-rw-r--r-- | Master/texmf-dist/tex/luatex/luamplib/luamplib.sty | 13 |
2 files changed, 24 insertions, 9 deletions
diff --git a/Master/texmf-dist/tex/luatex/luamplib/luamplib.lua b/Master/texmf-dist/tex/luatex/luamplib/luamplib.lua index 74dbf45d062..0ea75e7b61f 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.20.7", - date = "2021/03/11", + version = "2.20.8", + date = "2021/08/02", description = "Lua package to typeset Metapost with LuaTeX's MPLib.", } @@ -246,28 +246,33 @@ local preamble = [[ input %s ; ]] +local logatload local function reporterror (result, indeed) if not result then err("no result object returned") else local t, e, l = result.term, result.error, result.log - local log = t or l or "no-term" + local log = l or t or "no-term" log = log:gsub("%(Please type a command or say `end'%)",""):gsub("\n+","\n") if result.status > 0 then warn(log) if result.status > 1 then err(e or "see above messages") end - else + elseif indeed then + local log = logatload..log if log:find"\n>>" then warn(log) elseif log:find"%g" then if luamplib.showlog then info(log) - elseif indeed and not result.fig then + elseif not result.fig then info(log) end end + logatload = "" + else + logatload = log end return log end @@ -488,7 +493,10 @@ function luamplib.runscript (code) if buffer and buffer ~= "" then return buffer end - return result or "" + buffer = {} + mpprint(buffer, result) + buffer = tableconcat(buffer) + return 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 8540ce79c90..e37fc3da406 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/03/11 v2.20.7 mplib package for LuaTeX] + [2021/08/02 v2.20.8 mplib package for LuaTeX] \ifx\newluafunction\@undefined \input ltluatex \fi @@ -49,8 +49,7 @@ \catcode`\&=12 \catcode`\$=12 \catcode`\%=12 \catcode`\^^M=12 } \def\mplibputtextbox#1{\vbox to 0pt{\vss\hbox to 0pt{\raise\dp#1\copy#1\hss}}} -\bgroup\expandafter\expandafter\expandafter\egroup -\expandafter\ifx\csname selectfont\endcsname\relax +\unless\ifcsname ver@luamplib.sty\endcsname \def\mplibcode{% \begingroup \begingroup @@ -85,6 +84,14 @@ \fi } \fi +\def\mplibshowlog#1{\directlua{ + local s = string.lower("#1") + if s == "enable" or s == "true" or s == "yes" then + luamplib.showlog = true + else + luamplib.showlog = false + end +}} \def\mpliblegacybehavior#1{\directlua{ local s = string.lower("#1") if s == "enable" or s == "true" or s == "yes" then |