summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/luatex/luamplib/test-luamplib-latex.tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-01-09 21:20:32 +0000
committerKarl Berry <karl@freefriends.org>2022-01-09 21:20:32 +0000
commite2eade5f75ce75881f3148efa4b24392428f4832 (patch)
tree003129dbf2fd737f25d5d0e0f931ba196e66407a /Master/texmf-dist/doc/luatex/luamplib/test-luamplib-latex.tex
parent26ab7cdf587597f705bc839bb829b07d1969f125 (diff)
luamplib (9jan22)
git-svn-id: svn://tug.org/texlive/trunk@61554 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/luatex/luamplib/test-luamplib-latex.tex')
-rw-r--r--Master/texmf-dist/doc/luatex/luamplib/test-luamplib-latex.tex56
1 files changed, 55 insertions, 1 deletions
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}