texlive[44496] Master: luamplib (6jun17)
commits+karl at tug.org
commits+karl at tug.org
Tue Jun 6 23:48:33 CEST 2017
Revision: 44496
http://tug.org/svn/texlive?view=revision&revision=44496
Author: karl
Date: 2017-06-06 23:48:32 +0200 (Tue, 06 Jun 2017)
Log Message:
-----------
luamplib (6jun17)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/luatex/luamplib/NEWS
trunk/Master/texmf-dist/doc/luatex/luamplib/luamplib.pdf
trunk/Master/texmf-dist/doc/luatex/luamplib/test-luamplib-latex.tex
trunk/Master/texmf-dist/doc/luatex/luamplib/test-luamplib-plain.tex
trunk/Master/texmf-dist/source/luatex/luamplib/luamplib.dtx
trunk/Master/texmf-dist/tex/luatex/luamplib/luamplib.lua
trunk/Master/texmf-dist/tex/luatex/luamplib/luamplib.sty
trunk/Master/tlpkg/libexec/ctan2tds
trunk/Master/tlpkg/tlpsrc/collection-langarabic.tlpsrc
Modified: trunk/Master/texmf-dist/doc/luatex/luamplib/NEWS
===================================================================
--- trunk/Master/texmf-dist/doc/luatex/luamplib/NEWS 2017-06-06 21:46:58 UTC (rev 44495)
+++ trunk/Master/texmf-dist/doc/luatex/luamplib/NEWS 2017-06-06 21:48:32 UTC (rev 44496)
@@ -1,5 +1,10 @@
History of the luamplib package
+2017/06/02 2.12.1
+ * when \mplibglobaltextext{enable} is declared, metapost variables
+ containing btex ... etex labels can be inherited across code chunks.
+ Of course, \mplibcodeinherit should also be switched on.
+
2016/03/31 2.11.3
* fix a bug regarding nested mplibcode environments (issue #63)
Modified: trunk/Master/texmf-dist/doc/luatex/luamplib/luamplib.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/luatex/luamplib/test-luamplib-latex.tex
===================================================================
--- trunk/Master/texmf-dist/doc/luatex/luamplib/test-luamplib-latex.tex 2017-06-06 21:46:58 UTC (rev 44495)
+++ trunk/Master/texmf-dist/doc/luatex/luamplib/test-luamplib-latex.tex 2017-06-06 21:48:32 UTC (rev 44496)
@@ -62,7 +62,21 @@
endfor;
endfig;
\end{mplibcode}%
-B\par
+B\par\leavevmode
+\mplibcodeinherit{enable}%
+\mplibglobaltextext{enable}%
+\everymplib{ beginfig(0);}\everyendmplib{ endfig;}%
+\begin{mplibcode}
+ label(btex $\sqrt{2}$ etex, origin);
+ draw fullcircle scaled 20;
+ picture pic; pic := currentpicture;
+\end{mplibcode}%
+\begin{mplibcode}
+ currentpicture := pic scaled 2;
+\end{mplibcode}%
+\everymplib{}\everyendmplib{}%
+\mplibcodeinherit{disable}%
+\mplibglobaltextext{disable}\par
\mplibsetformat{metafun}%
\begin{mplibcode}
verbatimtex \moveright 0.4\hsize etex
Modified: trunk/Master/texmf-dist/doc/luatex/luamplib/test-luamplib-plain.tex
===================================================================
--- trunk/Master/texmf-dist/doc/luatex/luamplib/test-luamplib-plain.tex 2017-06-06 21:46:58 UTC (rev 44495)
+++ trunk/Master/texmf-dist/doc/luatex/luamplib/test-luamplib-plain.tex 2017-06-06 21:48:32 UTC (rev 44496)
@@ -60,7 +60,21 @@
endfor;
endfig;
\endmplibcode
-B\par
+B\par\leavevmode
+\mplibcodeinherit{enable}%
+\mplibglobaltextext{enable}%
+\everymplib{ beginfig(0);}\everyendmplib{ endfig;}%
+\mplibcode
+ label(btex $\sqrt{2}$ etex, origin);
+ draw fullcircle scaled 20;
+ picture pic; pic := currentpicture;
+\endmplibcode
+\mplibcode
+ currentpicture := pic scaled 2;
+\endmplibcode
+\everymplib{}\everyendmplib{}%
+\mplibcodeinherit{disable}%
+\mplibglobaltextext{disable}\par
\mplibsetformat{metafun}%
\mplibcode
verbatimtex \moveright 0.4\hsize etex
Modified: trunk/Master/texmf-dist/source/luatex/luamplib/luamplib.dtx
===================================================================
--- trunk/Master/texmf-dist/source/luatex/luamplib/luamplib.dtx 2017-06-06 21:46:58 UTC (rev 44495)
+++ trunk/Master/texmf-dist/source/luatex/luamplib/luamplib.dtx 2017-06-06 21:48:32 UTC (rev 44496)
@@ -1,6 +1,6 @@
% \iffalse meta-comment -- by the way, this file contains UTF-8
%
-% Copyright (C) 2008-2016 by Hans Hagen, Taco Hoekwater, Elie Roux,
+% Copyright (C) 2008-2017 by Hans Hagen, Taco Hoekwater, Elie Roux,
% Manuel Pégourié-Gonnard, Philipp Gesang and Kim Dohyun.
% Currently maintained by the LuaLaTeX development team.
% Support: <lualatex-dev at tug.org>
@@ -85,7 +85,7 @@
%<*driver>
\NeedsTeXFormat{LaTeX2e}
\ProvidesFile{luamplib.drv}%
- [2016/03/31 v2.11.3 Interface for using the mplib library]%
+ [2017/06/02 v2.12.1 Interface for using the mplib library]%
\documentclass{ltxdoc}
\usepackage{metalogo,multicol,mdwlist,fancyvrb,xspace}
\usepackage[x11names]{xcolor}
@@ -153,7 +153,7 @@
% \author{Hans Hagen, Taco Hoekwater, Elie Roux, Philipp Gesang and Kim Dohyun\\
% Maintainer: LuaLaTeX Maintainers ---
% Support: \email{lualatex-dev at tug.org}}
-% \date{2016/03/31 v2.11.3}
+% \date{2017/06/02 v2.12.1}
%
% \maketitle
%
@@ -310,21 +310,25 @@
% each code chunks being treated as an independent instance, and never
% affected by previous code chunks.
%
-% \textsc{n.b.} It does not work to pass across code chunks those variables
-% containing |btex ... etex| pictures, as these are not METAPOST, but \TeX\
-% elements from the standpoint of \textsf{luamplib}. Likewise, |graph.mp|
-% does not work properly with the inheritance functionality.
+% \textsc{n.b.}
+% To inherit |btex ... etex| labels as well as metapost variables,
+% it is necessary to declare \cs{mplibglobaltextext\{enable\}} in advance.
+% On this case, be careful that normal \TeX\ boxes can conflict with
+% |btex ... etex| boxes, though this would occur very rarely.
+% Notwithstanding the danger, it is a `must' option to activate
+% \cs{mplibglobaltextext} if you want to use |graph.mp|
+% with \cs{mplibcodeinherit} functionality.
% \begin{verbatim}
% \mplibcodeinherit{enable}
+% \mplibglobaltextext{enable}
% \everymplib{ beginfig(0);} \everyendmplib{ endfig;}
-% A circle
% \mplibcode
-% u := 10;
-% draw fullcircle scaled u;
+% label(btex $\sqrt{2}$ etex, origin);
+% draw fullcircle scaled 20;
+% picture pic; pic := currentpicture;
% \endmplibcode
-% and twice the size
% \mplibcode
-% draw fullcircle scaled 2u;
+% currentpicture := pic scaled 2;
% \endmplibcode
% \end{verbatim}
% \item Starting with v2.11, users can issue |\mplibverbatim{enable}|, after which
@@ -369,8 +373,8 @@
luatexbase.provides_module {
name = "luamplib",
- version = "2.11.3",
- date = "2016/03/31",
+ version = "2.12.1",
+ date = "2017/06/02",
description = "Lua package to typeset Metapost with LuaTeX's MPLib.",
}
@@ -1069,9 +1073,12 @@
luamplib.textextlabelpreamble = textextlabelpreamble
local TeX_code_t = {}
+local texboxnum = { 2047 }
local function domakeTEXboxes (data)
- local num = 255 -- output box
+ local num = texboxnum[1]
+ texboxnum[2] = num
+ local global = luamplib.globaltextext and "\\global" or ""
if data and data.fig then
local figures = data.fig
for f=1, #figures do
@@ -1086,7 +1093,7 @@
local str = prescript and prescript.MPlibmkTEXbox
if str then
num = num + 1
- texsprint(format("\\setbox%i\\hbox{%s}",num,str))
+ texsprint(format("%s\\setbox%i\\hbox{%s}", global, num, str))
end
% \end{macrocode}
% |verbatimtex ... etex| before |beginfig()| is not ignored,
@@ -1100,6 +1107,9 @@
end
end
end
+ if luamplib.globaltextext then
+ texboxnum[1] = num
+ end
end
local function protect_tex_text_common (data)
@@ -1189,7 +1199,7 @@
local function processwithTEXboxes (data)
if not data then return end
- local num = 255 -- output box
+ local num = texboxnum[2]
local prepreamble = format("TEXBOX_:=%i;\n",num)
while true do
num = num + 1
@@ -1708,7 +1718,7 @@
\else
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{luamplib}
- [2016/03/31 v2.11.3 mplib package for LuaTeX]
+ [2017/06/02 v2.12.1 mplib package for LuaTeX]
\ifx\newluafunction\@undefined
\input ltluatex
\fi
@@ -1939,6 +1949,16 @@
\fi
\endgroup
}
+\def\mplibglobaltextext#1{%
+ \begingroup
+ \def\tempa{enable}\def\tempb{#1}%
+ \ifx\tempa\tempb
+ \directlua{luamplib.globaltextext = true}%
+ \else
+ \directlua{luamplib.globaltextext = false}%
+ \fi
+ \endgroup
+}
% \end{macrocode}
%
% We use a dedicated scratchbox.
Modified: trunk/Master/texmf-dist/tex/luatex/luamplib/luamplib.lua
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luamplib/luamplib.lua 2017-06-06 21:46:58 UTC (rev 44495)
+++ trunk/Master/texmf-dist/tex/luatex/luamplib/luamplib.lua 2017-06-06 21:48:32 UTC (rev 44496)
@@ -18,8 +18,8 @@
luatexbase.provides_module {
name = "luamplib",
- version = "2.11.3",
- date = "2016/03/31",
+ version = "2.12.1",
+ date = "2017/06/02",
description = "Lua package to typeset Metapost with LuaTeX's MPLib.",
}
@@ -641,9 +641,12 @@
luamplib.textextlabelpreamble = textextlabelpreamble
local TeX_code_t = {}
+local texboxnum = { 2047 }
local function domakeTEXboxes (data)
- local num = 255 -- output box
+ local num = texboxnum[1]
+ texboxnum[2] = num
+ local global = luamplib.globaltextext and "\\global" or ""
if data and data.fig then
local figures = data.fig
for f=1, #figures do
@@ -658,7 +661,7 @@
local str = prescript and prescript.MPlibmkTEXbox
if str then
num = num + 1
- texsprint(format("\\setbox%i\\hbox{%s}",num,str))
+ texsprint(format("%s\\setbox%i\\hbox{%s}", global, num, str))
end
local texcode = prescript and prescript.MPlibVerbTeX
if texcode and texcode ~= "" then
@@ -668,6 +671,9 @@
end
end
end
+ if luamplib.globaltextext then
+ texboxnum[1] = num
+ end
end
local function protect_tex_text_common (data)
@@ -754,7 +760,7 @@
local function processwithTEXboxes (data)
if not data then return end
- local num = 255 -- output box
+ local num = texboxnum[2]
local prepreamble = format("TEXBOX_:=%i;\n",num)
while true do
num = num + 1
Modified: trunk/Master/texmf-dist/tex/luatex/luamplib/luamplib.sty
===================================================================
--- trunk/Master/texmf-dist/tex/luatex/luamplib/luamplib.sty 2017-06-06 21:46:58 UTC (rev 44495)
+++ trunk/Master/texmf-dist/tex/luatex/luamplib/luamplib.sty 2017-06-06 21:48:32 UTC (rev 44496)
@@ -14,7 +14,7 @@
\else
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{luamplib}
- [2016/03/31 v2.11.3 mplib package for LuaTeX]
+ [2017/06/02 v2.12.1 mplib package for LuaTeX]
\ifx\newluafunction\@undefined
\input ltluatex
\fi
@@ -197,6 +197,16 @@
\fi
\endgroup
}
+\def\mplibglobaltextext#1{%
+ \begingroup
+ \def\tempa{enable}\def\tempb{#1}%
+ \ifx\tempa\tempb
+ \directlua{luamplib.globaltextext = true}%
+ \else
+ \directlua{luamplib.globaltextext = false}%
+ \fi
+ \endgroup
+}
\ifx\mplibscratchbox\undefined \newbox\mplibscratchbox \fi
\def\mplibstarttoPDF#1#2#3#4{%
\hbox\bgroup
Modified: trunk/Master/tlpkg/libexec/ctan2tds
===================================================================
--- trunk/Master/tlpkg/libexec/ctan2tds 2017-06-06 21:46:58 UTC (rev 44495)
+++ trunk/Master/tlpkg/libexec/ctan2tds 2017-06-06 21:48:32 UTC (rev 44496)
@@ -2970,6 +2970,7 @@
# that the files were removed. These are checked after runins.
%moreclean = (
'akktex' => 'still to do',
+ 'alkalami' => 'Alkalami-.*pdf', # InDesign source
'ametsoc' => '.*\.pdf', # no source
'ascii-font' => '.*\.pdf', # no source
'bbcard' => 'bbcard.tpm', # old TL infra
Modified: trunk/Master/tlpkg/tlpsrc/collection-langarabic.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/collection-langarabic.tlpsrc 2017-06-06 21:46:58 UTC (rev 44495)
+++ trunk/Master/tlpkg/tlpsrc/collection-langarabic.tlpsrc 2017-06-06 21:48:32 UTC (rev 44496)
@@ -4,6 +4,7 @@
#
depend collection-basic
#
+depend alkalami
depend amiri
depend arabi
depend arabi-add
More information about the tex-live-commits
mailing list