summaryrefslogtreecommitdiff
path: root/doc/context
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2021-08-22 12:15:53 +0200
committerContext Git Mirror Bot <phg@phi-gamma.net>2021-08-22 12:15:53 +0200
commit4d2f305f0f00e1d6d6c03443596a830bfb9da69c (patch)
treeaa049c7577e473819cf14b8950304fd4079eee1a /doc/context
parentaf60125ab3fa9e482720f0f46c2143fa08512113 (diff)
downloadcontext-4d2f305f0f00e1d6d6c03443596a830bfb9da69c.tar.gz
2021-08-22 11:53:00
Diffstat (limited to 'doc/context')
-rw-r--r--doc/context/documents/general/manuals/luametafun.pdfbin3738617 -> 3803772 bytes
-rw-r--r--doc/context/documents/general/manuals/luametatex.pdfbin1223393 -> 1221479 bytes
-rw-r--r--doc/context/sources/general/manuals/luametafun/luametafun-mesh-examples.tex163
-rw-r--r--doc/context/sources/general/manuals/luametafun/luametafun-mesh.tex6
-rw-r--r--doc/context/sources/general/manuals/luametatex/luametatex-lua.tex24
5 files changed, 180 insertions, 13 deletions
diff --git a/doc/context/documents/general/manuals/luametafun.pdf b/doc/context/documents/general/manuals/luametafun.pdf
index caa40e26d..79456a46d 100644
--- a/doc/context/documents/general/manuals/luametafun.pdf
+++ b/doc/context/documents/general/manuals/luametafun.pdf
Binary files differ
diff --git a/doc/context/documents/general/manuals/luametatex.pdf b/doc/context/documents/general/manuals/luametatex.pdf
index 5843ef324..129da6905 100644
--- a/doc/context/documents/general/manuals/luametatex.pdf
+++ b/doc/context/documents/general/manuals/luametatex.pdf
Binary files differ
diff --git a/doc/context/sources/general/manuals/luametafun/luametafun-mesh-examples.tex b/doc/context/sources/general/manuals/luametafun/luametafun-mesh-examples.tex
new file mode 100644
index 000000000..cf91cff2f
--- /dev/null
+++ b/doc/context/sources/general/manuals/luametafun/luametafun-mesh-examples.tex
@@ -0,0 +1,163 @@
+% language=us runpath=texruns:manuals/luametafun
+
+\startbuffer[1]
+\startuseMPgraphic{MyPath1}
+ fill OverlayBox withcolor "darkyellow" ;
+ save p ; path p[] ;
+ p1 := unitsquare xysized( OverlayWidth/4, OverlayHeight/4) ;
+ p2 := unitsquare xysized(2OverlayWidth/4,3OverlayHeight/5) shifted ( OverlayWidth/4,0) ;
+ p3 := unitsquare xysized( OverlayWidth/4, OverlayHeight ) shifted (3OverlayWidth/4,0) ;
+ fill p1 withcolor "darkred" ;
+ fill p2 withcolor "darkblue" ;
+ fill p3 withcolor "darkgreen" ;
+ draw lmt_mesh [ paths = { p1, p2, p3 } ] ;
+ setbounds currentpicture to OverlayBox ;
+\stopuseMPgraphic
+\stopbuffer
+
+\startbuffer[2]
+\startuseMPgraphic{MyPath2}
+ save q ; path q ; q := unitcircle xysized(OverlayWidth,OverlayHeight) ;
+ save p ; path p ; p := for i=1 upto length(q) :
+ (center q) -- (point (i-1) of q) -- (point i of q) -- (center q) --
+ endfor cycle ;
+ fill q withcolor "darkgray" ;
+ draw lmt_mesh [
+ trace = true,
+ paths = { p }
+ ] withcolor "darkred" ;
+
+ setbounds currentpicture to OverlayBox ;
+\stopuseMPgraphic
+\stopbuffer
+
+\startbuffer[3]
+\startuseMPgraphic{MyPath3}
+ save q ; path q ; q := unitcircle xysized(OverlayWidth,OverlayHeight) randomized 3mm ;
+ fill q withcolor "darkgray" ;
+ draw lmt_mesh [
+ trace = true,
+ paths = { meshed(q,OverlayBox,.05) }
+ ] withcolor "darkgreen" ;
+ % draw OverlayMesh(q,.025) withcolor "darkgreen" ;
+ setbounds currentpicture to OverlayBox ;
+\stopuseMPgraphic
+\stopbuffer
+
+\startbuffer[4]
+\startuseMPgraphic{MyPath4}
+ save q ; path q ; q := unitcircle xysized(OverlayWidth,OverlayHeight) randomized 3mm ;
+ fill q withcolor "darkgray" ;
+ draw lmt_mesh [
+ trace = true,
+ auto = true,
+ step = 0.0125,
+ paths = { q }
+ ] withcolor "darkyellow" ;
+ setbounds currentpicture to OverlayBox ;
+\stopuseMPgraphic
+\stopbuffer
+
+\startbuffer[5]
+\startuseMPgraphic{MyPath5}
+ save q ; path q ; q := unitdiamond xysized(OverlayWidth,OverlayHeight) randomized 2mm ;
+ q := q shifted - center q shifted center OverlayBox ;
+ fill q withcolor "darkgray" ;
+ draw lmt_mesh [
+ trace = true,
+ auto = true,
+ step = 0.0125,
+ paths = { q }
+ ] withcolor "darkmagenta" ;
+ setbounds currentpicture to OverlayBox ;
+\stopuseMPgraphic
+\stopbuffer
+
+\startbuffer[6]
+\startuseMPgraphic{MyPath6}
+ save p ; path p[] ;
+ p1 := p2 := fullcircle xysized(2OverlayWidth/5,2OverlayHeight/3) ;
+ p1 := p1 shifted - center p1 shifted center OverlayBox shifted (-1OverlayWidth/4,0) ;
+ p2 := p2 shifted - center p2 shifted center OverlayBox shifted ( 1OverlayWidth/4,0) ;
+ fill p1 withcolor "middlegray" ;
+ fill p2 withcolor "middlegray" ;
+ draw lmt_mesh [
+ trace = true,
+ auto = true,
+ step = 0.02,
+ paths = { p1, p2 }
+ ] withcolor "darkcyan" ;
+ setbounds currentpicture to OverlayBox ;
+\stopuseMPgraphic
+\stopbuffer
+
+\startbuffer[7]
+\startuseMPgraphic{MyPath7}
+ save p ; path p[] ;
+ p1 := p2 := fullcircle xysized(2OverlayWidth/5,2OverlayHeight/3) rotated 45 ;
+ p1 := p1 shifted - center p1 shifted center OverlayBox shifted (-1OverlayWidth/4,0) ;
+ p2 := p2 shifted - center p2 shifted center OverlayBox shifted ( 1OverlayWidth/4,0) ;
+ fill p1 withcolor "middlegray" ;
+ fill p2 withcolor "middlegray" ;
+ draw lmt_mesh [
+ trace = true,
+ auto = true,
+ step = 0.01,
+ box = OverlayBox enlarged -5mm,
+ paths = { p1, p2 }
+ ] withcolor "darkcyan" ;
+ draw OverlayBox enlarged -5mm withcolor "darkgray" ;
+ setbounds currentpicture to OverlayBox ;
+\stopuseMPgraphic
+\stopbuffer
+
+\continueifinputfile {luametafun-mesh-examples.tex}
+
+\setupbodyfont[dejavu]
+
+\setupinteraction
+ [state=start,
+ color=white,
+ contrastcolor=white]
+
+\starttext
+
+ \getbuffer[1,2,3,4,5,6,7]
+
+ \defineoverlay[MyPath1][\useMPgraphic{MyPath1}]
+ \defineoverlay[MyPath2][\useMPgraphic{MyPath2}]
+ \defineoverlay[MyPath3][\useMPgraphic{MyPath3}]
+ \defineoverlay[MyPath4][\useMPgraphic{MyPath4}]
+ \defineoverlay[MyPath5][\useMPgraphic{MyPath5}]
+ \defineoverlay[MyPath6][\useMPgraphic{MyPath6}]
+ \defineoverlay[MyPath7][\useMPgraphic{MyPath7}]
+
+ \startTEXpage
+ \button[height=3cm,width=4cm,background=MyPath1,frame=off]{Example 1}[realpage(2)]
+ \stopTEXpage
+
+ \startTEXpage
+ \button[height=3cm,width=4cm,background=MyPath2,frame=off]{Example 2}[realpage(3)]
+ \stopTEXpage
+
+ \startTEXpage
+ \button[height=3cm,width=4cm,background=MyPath3,frame=off]{Example 3}[realpage(4)]
+ \stopTEXpage
+
+ \startTEXpage
+ \button[height=3cm,width=4cm,background=MyPath4,frame=off]{Example 4}[realpage(5)]
+ \stopTEXpage
+
+ \startTEXpage
+ \button[height=3cm,width=4cm,background=MyPath5,frame=off]{Example 5}[realpage(6)]
+ \stopTEXpage
+
+ \startTEXpage
+ \button[height=3cm,width=4cm,background=MyPath6,frame=off]{Example 6}[realpage(7)]
+ \stopTEXpage
+
+ \startTEXpage
+ \button[height=3cm,width=4cm,background=MyPath7,frame=off]{Example 7}[realpage(1)]
+ \stopTEXpage
+
+\stoptext
diff --git a/doc/context/sources/general/manuals/luametafun/luametafun-mesh.tex b/doc/context/sources/general/manuals/luametafun/luametafun-mesh.tex
index 88acff077..98b9a86b7 100644
--- a/doc/context/sources/general/manuals/luametafun/luametafun-mesh.tex
+++ b/doc/context/sources/general/manuals/luametafun/luametafun-mesh.tex
@@ -3,6 +3,12 @@
\environment luametafun-style
\environment luametafun-mesh-examples
+\doiffileelse{luatex-mesh-examples.pdf} {
+ % okay
+} {
+ \ctxlua{os.execute("context luatex-mesh-examples.tex")}
+}
+
\startcomponent luametafun-mesh
\startchapter[title={Mesh}]
diff --git a/doc/context/sources/general/manuals/luametatex/luametatex-lua.tex b/doc/context/sources/general/manuals/luametatex/luametatex-lua.tex
index c48ad822f..81bcf40a3 100644
--- a/doc/context/sources/general/manuals/luametatex/luametatex-lua.tex
+++ b/doc/context/sources/general/manuals/luametatex/luametatex-lua.tex
@@ -15,17 +15,13 @@
Although \LUAMETATEX\ is primarily meant as a \TEX\ engine, it can also serve as
a stand alone \LUA\ interpreter. There are two ways to make \LUAMETATEX\ behave
-like a standalone \LUA\ interpreter:
-
-\startitemize[packed]
-\startitem
- if a \type {--luaonly} option is given on the commandline, or
-\stopitem
-\startitem
- if the only non|-|option argument (file) on the commandline has the extension
- \type {lua} or \type {luc}.
-\stopitem
-\stopitemize
+like a standalone \LUA\ interpreter. The first method uses the command line
+option \type {--luaonly} followed by a filename. The second is more automatic: if
+the only non|-|option argument (file) on the commandline has the extension \type
+{lmt} or \type {lua}. The \type {luc} extension has been dropped because bytecode
+compiled files are not portable and one can always load indirect. The \type {lmt}
+suffix is more \CONTEXT\ specific and makes it possible to have files for
+\LUATEX\ and \LUAMETATEX\ alongside.
In this mode, it will set \LUA's \type {arg[0]} to the found script name, pushing
preceding options in negative values and the rest of the command line in the
@@ -39,8 +35,10 @@ possible below the 3MB which is okay for a script engine.
When no argument is given, \LUAMETATEX\ will look for a \LUA\ file with the same
name as the binary and run that one when present. This makes it possible to use
the engine as a stub. For instance, in \CONTEXT\ a symlink from \type {mtxrun} to
-type {luametatex} will run the \type {mtxrun.lua} script when present in the same
-path as the binary itself
+type {luametatex} will run the \type {mtxrun.lmt} or \type {mtxrun.lua} script
+when present in the same path as the binary itself. As mentioned before first
+checking for (\CONTEXT) \type {lmt} files permits different files for different
+engines in the same path.
\stopsubsection