diff options
author | Karl Berry <karl@freefriends.org> | 2022-01-09 21:20:32 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2022-01-09 21:20:32 +0000 |
commit | e2eade5f75ce75881f3148efa4b24392428f4832 (patch) | |
tree | 003129dbf2fd737f25d5d0e0f931ba196e66407a /Master/texmf-dist/doc | |
parent | 26ab7cdf587597f705bc839bb829b07d1969f125 (diff) |
luamplib (9jan22)
git-svn-id: svn://tug.org/texlive/trunk@61554 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc')
-rw-r--r-- | Master/texmf-dist/doc/luatex/luamplib/NEWS | 8 | ||||
-rw-r--r-- | Master/texmf-dist/doc/luatex/luamplib/luamplib.pdf | bin | 151338 -> 153133 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/luatex/luamplib/test-luamplib-latex.tex | 56 |
3 files changed, 63 insertions, 1 deletions
diff --git a/Master/texmf-dist/doc/luatex/luamplib/NEWS b/Master/texmf-dist/doc/luatex/luamplib/NEWS index 1fd97ca4f23..8f258c41f6b 100644 --- a/Master/texmf-dist/doc/luatex/luamplib/NEWS +++ b/Master/texmf-dist/doc/luatex/luamplib/NEWS @@ -1,5 +1,13 @@ History of the luamplib package +2022/01/09 2.22.0 + * Sergey Slyusarev (@jemmybutton) has suggested and contributed + a new feature for LaTeX mplibcode environment, which now supports + separately named MetaPost instances. Using this feature, + all the variables and functions are shared only among + all the environments belonging to the same instance. + (#99 and #100) + 2021/11/23 2.21.1 * address #97 (typesetting fails with "--lua" option) diff --git a/Master/texmf-dist/doc/luatex/luamplib/luamplib.pdf b/Master/texmf-dist/doc/luatex/luamplib/luamplib.pdf Binary files differindex a2685b2b09e..aeefe5ca287 100644 --- a/Master/texmf-dist/doc/luatex/luamplib/luamplib.pdf +++ b/Master/texmf-dist/doc/luatex/luamplib/luamplib.pdf 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 dc06a9bd8fb..632dae44e67 100644 --- a/Master/texmf-dist/doc/luatex/luamplib/test-luamplib-latex.tex +++ b/Master/texmf-dist/doc/luatex/luamplib/test-luamplib-latex.tex @@ -164,6 +164,60 @@ diameter:\Dia bp.% rotatedlabel.top(textext("Rotated!"), origin, 45); endfig; \end{mplibcode}% - \tracingcommands0 + +\vskip 2\baselineskip +\mplibcodeinherit{disable}% + +\begin{mplibcode}[instanceOne] +beginfig(1); +a := 1cm; +draw fullcircle scaled a; +draw btex a circle with $d=a$ etex shifted (a,0); +endfig; +\end{mplibcode}% +Current instance name is: \currentmpinstancename \vskip 2\baselineskip + +\begin{mplibcode}[instanceTwo] +beginfig(1); +if not known a: + draw btex code is not inherited from an instance with a different name etex; +else: + errmessage("Variable was inherited from a different instance"); +fi; +endfig; +\end{mplibcode}% +Current instance name is: \currentmpinstancename \vskip 2\baselineskip + +\begin{mplibcode} +beginfig(1); +if not known a: + draw btex code is not inherited if instance name is not listed etex; +else: + errmessage("Variable was inherited from a different instance"); +fi; +a := 1cm; +endfig; +\end{mplibcode}% +Current instance name is: \currentmpinstancename (should be empty) \vskip 2\baselineskip + +\begin{mplibcode} +beginfig(1); +if not known a: + draw btex code is not inherited if mplibcodeinherit is disabled and instance name is not explicitly set etex; +else: + errmessage("Variable was inherited when code inheritance is turned off and instance name is not set"); +fi; +endfig; +\end{mplibcode}% +Current instance name is: \currentmpinstancename (should be empty) \vskip 2\baselineskip + +\begin{mplibcode}[instanceOne] +beginfig(1); +draw unitsquare scaled a; +draw btex a square with side $=a$, inherited from the same instance etex shifted (3/2a, 1/2a); +endfig; +\end{mplibcode}% +Current instance name is: \currentmpinstancename \vskip 2\baselineskip + \end{document} |