diff options
Diffstat (limited to 'doc/context/sources/general/leaflets')
4 files changed, 765 insertions, 0 deletions
diff --git a/doc/context/sources/general/leaflets/leaflet-common.tex b/doc/context/sources/general/leaflets/leaflet-common.tex new file mode 100644 index 000000000..52cc31797 --- /dev/null +++ b/doc/context/sources/general/leaflets/leaflet-common.tex @@ -0,0 +1,80 @@ +\startenvironment leaflet-common + +%D Please don't abuse this style for your own purpose as the look and feel +%D is reserved for our own purpose. Be creative instead. + +\usemodule + [abbreviations-logos] + +\setupbodyfont + [plex,12pt] + +\setuplayout + [page] + +\setupalign + [verytolerant,stretch] + +\startluacode + function document.graphic() + local min, max, random, round = math.min, math.max, math.random, math.round + + local width = 210 + local height = 297 + local r, g, b = 3, 3, 3 + + local bitmap = graphics.bitmaps.new(width,height,"rgb",1) + local data = bitmap.data + + local graphic = tonumber(documentdata.variable("graphic")) + + if graphic == 1 then + r, g, b = 4, 3, 2 + elseif graphic == 2 then + r, g, b = 2, 3, 4 + end + + for i=1,height do + local d = data[i] + for j=1,width do + local c = random(128,255) + -- d[j] = { 0, 0, c } + d[j] = { c//r, c//g, c//b } + end + end + + graphics.bitmaps.tocontext(bitmap,"210bp","297bp") + end +\stopluacode + +\definelayer + [page] + [width=\paperwidth, + height=\paperheight] + +\setupcolors + [textcolor=white] + +\setupbackgrounds + [page] + [background=page] + +\setupmakeup + [page] + [style=\bf, + top=, + bottom=] + +\startsetups document:start + + \setlayerframed + [page] + [offset=overlay] + {\scale + [width=\textwidth, + height=\textheight] + {\ctxlua{document.graphic()}}} + +\stopsetups + +\stopenvironment diff --git a/doc/context/sources/general/leaflets/leaflet-context.tex b/doc/context/sources/general/leaflets/leaflet-context.tex new file mode 100644 index 000000000..7bab43b12 --- /dev/null +++ b/doc/context/sources/general/leaflets/leaflet-context.tex @@ -0,0 +1,129 @@ +\environment leaflet-common + +\startdocument[graphic=1] + +\startbuffer[1] + There are several ways to deploy \CONTEXT. Most common is to let it render a + document, in which case you install it on a system and use an editor to input + your document and from a console or by clicking some key trigger a run. The + input can be structured using \TEX\ macros but it can also be \XML, or some + other format that gets converted to \CONTEXT\ commands before processing. +\stopbuffer + +\startbuffer[2] + Instead you can also use \CONTEXT\ as a more hidden application, for instance + in a web service or rendering component in a larger application. In that case + the end user is not really aware that \TEX\ is being used. +\stopbuffer + +\startbuffer[3] + No matter how you use \CONTEXT, you need to install it first. You can for + instance use \TEX live or another distribution to pick up \CONTEXT, but you + can also install it using the archive (snapshot), in which case you also need + to pick up the engine (for instance \LUATEX) and a basic set of fonts. In + order to make installation easy we provide a so called standalone + distribution that has all you need. +\stopbuffer + +\startbuffer[4] + + The standalone \CONTEXT\ distribution has the following characteristics: + + \startitemize + \startitem + The installation is self contained. Apart from resources like fonts, + the \TEX\ macros, \LUA\ code and \METAPOST\ helpers are provided in + one package. + \stopitem + \startitem + There is only one binary involved: \LUAMETATEX. The source code of + this program is integral part of the \CONTEXT\ distribution (per end + 2019). A user should be able to compile the program if needed. There + is no dependency on additional libraries other than those that make + up the operating system. + \stopitem + \startitem + The core system is able to typeset documents in an efficient way. The + memory footprint is decent and performance acceptable, also on on low + power devices and virtual machines. We try not to provide bloatware. + \stopitem + \startitem + The official user interface is stable and the implementation of core + components will not change fundamentally. When something can be + improved it will be. One can use a snapshot for long term stability. + \stopitem + \startitem + Support is provided by means of a mailing list, a wiki, + documentation, meetings, etc. If needed you can consult (or hire) + support. There are enough experienced users out there to get you + going. + \stopitem + \stopitemize +\stopbuffer + +\startbuffer[5] + The first version of \CONTEXT, now tagged \MKII, has been around since 1995 + and (still) runs on top of \PDFTEX. The development of its successor \MKIV\ + started in 2005 as part of the \LUATEX\ development and still carries on. The + most recent incarnation is \LMTX, which is \MKIV\ but tuned for \LUAMETATEX, + the lean and mean successor of \LUATEX. +\stopbuffer + +% we could use a collector + +\startpagemakeup + \offinterlineskip + \vskip24pt + \hbox to \hsize \bgroup + \hss + \startframed[align=normal,width=.7\textwidth,frame=off] + \getbuffer[1] + \stopframed + \hskip1cm + \egroup + \vfill + \hbox to \hsize \bgroup + \hskip1cm + \startframed[align=normal,width=.7\textwidth,frame=off] + \getbuffer[2] + \stopframed + \egroup + \vfill + \hbox to \hsize \bgroup + \hss + \startframed[align=normal,width=.7\textwidth,frame=off] + \getbuffer[3] + \stopframed + \hskip1cm + \egroup + \vfill + \hbox to \hsize \bgroup + \hss + \setupitemize[after=] + \startframed[align=normal,width=\dimexpr\textwidth-2cm\relax,frame=off] + \getbuffer[4] + \stopframed + \hskip1cm + \egroup + \vfill + \hbox to \hsize \bgroup + \hss + \startframed[align=normal,width=.7\textwidth,frame=off] + \getbuffer[5] + \stopframed + \hskip1cm + \egroup + \vfill + \vfill + \vfill + \hbox to \hsize \bgroup + \hskip1cm + \startframed[align=normal,width=.7\textwidth,frame=off] + \bfd \CONTEXT\ \LMTX \enspace \emdash \enspace factsheet + \stopframed + \hss + \egroup + \vskip12pt +\stoppagemakeup + +\stopdocument diff --git a/doc/context/sources/general/leaflets/leaflet-luametatex.tex b/doc/context/sources/general/leaflets/leaflet-luametatex.tex new file mode 100644 index 000000000..6532a8f9f --- /dev/null +++ b/doc/context/sources/general/leaflets/leaflet-luametatex.tex @@ -0,0 +1,106 @@ +\environment leaflet-common + +\startdocument[graphic=2] + +\startbuffer[1] + The \LUAMETATEX\ engine is a follow up on \LUATEX. It integrates the \TEX\ + text rendering engine, the \METAPOST\ graphic engine and the \LUA\ script + interpreter. The development is part of the \CONTEXT\ macro package + development. This macro package tightly integrates the three subsystems. The + \LUAMETATEX\ code is part of the \CONTEXT\ distribution. +\stopbuffer + +\startbuffer[2] + The \LUAMETATEX\ engine is lean and mean. There is for instance no backend + code present. In \CONTEXT\ this is handled in \LUA. Graphic inclusion is also + delegated to \LUA. The \TEX\ frontend is a slightly extended version of the + \LUATEX\ one. System depedencies are minimized. Where possible we stay close + to the original \TEX\ concept because that is a well documented reference. + The binary can also be used as stand alone \LUA\ engine. +\stopbuffer + +\startbuffer[3] + The \METAPOST\ library also has access to \LUA, which means that the language + can be enhanced and functionality added on demand. There are several graphic + libraries provided in \CONTEXT. This graphical language is efficient in + runtime and graphical output. In combination with \LUA\ we have a high + performance graphical subsystem that can handle a huge amount of data. + Additional text (like labels) is typeset at high quality. +\stopbuffer + +\startbuffer[4] + The \LUA\ code that comes with \CONTEXT\ contains a lot of helper code which + means that one can set up selfcontained workflows without many extra + dependencies. Documents can be encoded in \TEX, \LUA, \XML\ or whatever + suits. There is support for databases too. +\stopbuffer + +\startbuffer[5] + The \CONTEXT\ code base evolved over time. The basic functionality is quite stable. + The move from \MKII\ to \MKIV\ to \LMTX\ has been gradual. The efficiency in terms + of code and performance has been improved stepwise. Development continues and beta + releases occur on a regular basis. The \CONTEXT\ user community is quite willing + to experiment with betas that can be installed alongside stable snapshots. + + \blank + + The installation is relatively small (fonts make up much of it) and updating is + easy. We operate in the \TEX\ Directory Structure, which is a proven concept. +\stopbuffer + +\startpagemakeup + \offinterlineskip + \vskip24pt + \hbox to \hsize \bgroup + \hss + \startframed[align=normal,width=.7\textwidth,frame=off] + \getbuffer[1] + \stopframed + \hskip1cm + \egroup + \vfill + \hbox to \hsize \bgroup + \hskip1cm + \startframed[align=normal,width=.7\textwidth,frame=off] + \getbuffer[2] + \stopframed + \egroup + \vfill + \hbox to \hsize \bgroup + \hss + \startframed[align=normal,width=.7\textwidth,frame=off] + \getbuffer[3] + \stopframed + \hskip1cm + \egroup + \vfill + \hbox to \hsize \bgroup + \hss + \setupitemize[after=] + \startframed[align=normal,width=\dimexpr\textwidth-2cm\relax,frame=off] + \getbuffer[4] + \stopframed + \hskip1cm + \egroup + \vfill + \hbox to \hsize \bgroup + \hss + \startframed[align=normal,width=.7\textwidth,frame=off] + \getbuffer[5] + \stopframed + \hskip1cm + \egroup + \vfill + \vfill + \vfill + \hbox to \hsize \bgroup + \hskip1cm + \startframed[align=normal,width=.7\textwidth,frame=off] + \bfd \LUAMETATEX \enspace \emdash \enspace factsheet + \stopframed + \hss + \egroup + \vskip12pt +\stoppagemakeup + +\stopdocument diff --git a/doc/context/sources/general/leaflets/leaflet-mixing.tex b/doc/context/sources/general/leaflets/leaflet-mixing.tex new file mode 100644 index 000000000..9f14525b3 --- /dev/null +++ b/doc/context/sources/general/leaflets/leaflet-mixing.tex @@ -0,0 +1,450 @@ +%D Please don't abuse this style for your own purpose as the look and feel +%D is reserved for our own purpose. Be creative instead. + +\setupbodyfont + [plex,7pt] + +\setuppapersize + [A3,landscape] + +\setuplayout + [width=middle, + height=middle, + header=0pt, + footer=0pt, + backspace=5mm, + topspace=5mm] + +\definelayer + [page] + [width=\textwidth, + height=\textheight] + +\setupbackgrounds + [page] + [background=color, + backgroundcolor=middlegray] + +\setuptyping + [before=,after=] + +\usemodule + [abbreviations-logos] + +\startbuffer[style] + \setupbodyfont + [plex] + \setuplayout + [width=middle, + height=middle, + margin=1cm] + \setupcolors + [textcolor=white] + \usemodule + [abbreviations-logos] + \setupwhitespace + [big] + \setuphead + [chapter] + [style=\bfc] +\stopbuffer + +\startbuffer[intro] + + \starttitle[title={Using \CONTEXT}] + + The \CONTEXT\ macro package is more than just a \TEX\ processor, + various input is possible, some we show here. An example of a + method not shown here is fetching data from a database. The + various input methods can be combined, so depending on what you + need you can mix \TEX\ (for typesetting text), \METAPOST\ (for + producing graphics) or \LUA\ (as language for manipulating + data. + + All these methods are quite efficient and always have access to + the full power of the typesetting engine. + + When you use \CONTEXT\ with \LUAMETATEX, you get a reasonable + small self contained component that can be used in workflows + that need quality rendering. The ecosystem is rather future + proof too. + + The \CONTEXT\ macro package has been around for decades and + evolved from \MKII, to \MKIV\ and now \LMTX. The development + team has always been involved in the development of engines + like \PDFTEX, \LUATEX\ and \LUAMETATEX. There is an active + mailing list and there are \CONTEXT\ meetings. + + \stoptitle + +\stopbuffer + +\startbuffer[tex] +\starttext + + \starttitle[title={Some \TEX}] + + Just an example. + + \starttabulate[|c|c|] + \NC first 1 \NC last 1 \NC \NR + \NC first 2 \NC last 2 \NC \NR + \stoptabulate + + \stoptitle + +\stoptext +\stopbuffer + +\startbuffer[xml] +\startbuffer[demo] +<?xml version="1.0"?> +<document> + <title>Some XML</title> + <p>Just an example.</p> + <table> + <r> <c>first 1</c> <c>last 1</c> </r> + <r> <c>first 2</c> <c>last 2</c> </r> + </table> +</document> +\stopbuffer + +\startxmlsetups xml:basics + \xmlsetsetup{#1}{title|p|table}{xml:*} +\stopxmlsetups +\startxmlsetups xml:title + \title{\xmltext{#1}{.}} +\stopxmlsetups +\startxmlsetups xml:p + \xmlflush{#1}\par +\stopxmlsetups +\startxmlsetups xml:table + \starttabulate[|c|c|] + \xmlfilter{#1}{/r/command(xml:r)} + \stoptabulate +\stopxmlsetups +\startxmlsetups xml:r + \NC \xmlfilter{#1}{/c/command(xml:c)} \NR +\stopxmlsetups +\startxmlsetups xml:c + \xmlflush{#1} \NC +\stopxmlsetups + +\xmlregistersetup{xml:basics} + +\starttext + \xmlprocessbuffer{demo}{demo}{} +\stoptext +\stopbuffer + +\startbuffer[lua] +\startluacode + local tmp = { + { a = "first 1", b = "last 1" }, + { b = "last 2", a = "first 2" }, + } + + -- local tmp = table.load("somefile.lua") + + context.starttext() + + context.starttitle { title = "Some Lua" } + + context("Just an example.") context.par() + + context.starttabulate { "|c|c|" } + for i=1,#tmp do + local t = tmp[i] + context.NC() + context(t.a) context.NC() + context(t.b) context.NC() + context.NR() + end + context.stoptabulate() + + context.stoptitle() + + context.stoptext() +\stopluacode +\stopbuffer + +\startbuffer[mp] +\startMPpage + draw textext("\bf Some \MetaPost") + xsized 4cm + rotated(45) + withcolor "white" ; + + draw textext("\bs\strut in \ConTeXt") + xsized 5cm + shifted (0,-40mm) + withcolor "white" ; + + draw fullcircle + scaled 6cm + dashed evenly + withcolor "gray" ; +\stopMPpage +\stopbuffer + +\startbuffer[csv] +\startluacode + local tmp = [[ + first,second + first 1,last 1 + first 2,last 2 + ]] + + -- local tmp = io.loaddata("somefile.csv") + + local mycsvsplitter = utilities.parsers.rfc4180splitter() + local list, names = mycsvsplitter(tmp,true) + + context.starttext() + + context.starttitle { title = "Some CSV" } + + context("Just an example.") context.par() + + context.starttabulate { "|c|c|" } + for i=1,#list do + local l = list[i] + context.NC() + context(l[1]) context.NC() + context(l[2]) context.NC() + context.NR() + end + context.stoptabulate() + + context.stoptitle() + + context.stoptext() +\stopluacode +\stopbuffer + +\startbuffer[json] +\startluacode + require("util-jsn") + + -- local str = io.loaddata("somefile.json") + + local str = [[ { + "title": "Some JSON", + "text" : "Just an example.", + "data" : [ + { "a" : "first 1", "b" : "last 1" }, + { "b" : "last 2", "a" : "first 2" } + ] + } ]] + + local tmp = utilities.json.tolua(str) + + context.starttext() + + context.starttitle { title = tmp.title } + + context(tmp.text) context.par() + + context.starttabulate { "|c|c|" } + for i=1,#tmp.data do + local d = tmp.data[i] + context.NC() + context(d.a) context.NC() + context(d.b) context.NC() + context.NR() + end + context.stoptabulate() + + context.stoptitle() + + context.stoptext() +\stopluacode +\stopbuffer + +\startbuffer[mkxi] +% normally there is already a file: + +\startbuffer[demo] +\starttext + \starttitle[title={Some template}] + + Just an example. \blank + + \startlinecorrection + \bTABLE + <?lua for i=1,20 do ?> + \bTR + <?lua for j=1,5 do ?> + \bTD + cell (<?lua inject(i) ?>,<?lua inject(j) ?>) + is <?lua inject(variables.text or "unset") ?> + \eTD + <?lua end ?> + \eTR + <?lua end ?> + \eTABLE + \stoplinecorrection + + \stoptitle +\stoptext + +\stopbuffer + +\savebuffer[file=demo.mkxi,prefix=no,list=demo] + +% the action: + +\startluacode + document.variables.text = "set" +\stopluacode + +\input{demo.mkxi} +\stopbuffer + +\definemeasure[blobwidth] [\textwidth/4-3mm] +\definemeasure[blobscale] [\textwidth/4-3mm-4mm] +\definemeasure[blobheight][\textheight/2-2mm] + +\startbuffer[everything] + +\setlayerframed + [page] + [preset=lefttop] + [align=normal, + offset=2mm, + strut=no, + frame=off, + height=\measure{blobheight}, + width=\measure{blobwidth}, + background=color, + backgroundcolor=darkgray, + foregroundcolor=white] + {\doifelsemode{verbose}{\typebuffer[intro]}{\typesetbuffer[style,intro][frame=on,width=\measure{blobscale}]}} + +\setlayerframed + [page] + [preset=lefttop, + hoffset=4mm, + x=\measure{blobwidth}] + [align=normal, + offset=2mm, + strut=no, + frame=off, + height=\measure{blobheight}, + width=\measure{blobwidth}, + background=color, + backgroundcolor=darkred, + foregroundcolor=white] + {\doifelsemode{verbose}{\typebuffer[tex]}{\typesetbuffer[style,tex][frame=on,width=\measure{blobscale}]}} + +\setlayerframed + [page] + [preset=righttop, + hoffset=4mm, + x=\measure{blobwidth}] + [align=normal, + offset=2mm, + strut=no, + frame=off, + height=\measure{blobheight}, + width=\measure{blobwidth}, + background=color, + backgroundcolor=darkblue, + foregroundcolor=white] + {\doifelsemode{verbose}{\typebuffer[xml]}{\typesetbuffer[style,xml][frame=on,width=\measure{blobscale}]}} + +\setlayerframed + [page] + [preset=righttop] + [align=normal, + offset=2mm, + strut=no, + frame=off, + height=\measure{blobheight}, + width=\measure{blobwidth}, + background=color, + backgroundcolor=darkgreen, + foregroundcolor=white] + {\doifelsemode{verbose}{\typebuffer[lua]}{\typesetbuffer[style,lua][frame=on,width=\measure{blobscale}]}} + +\setlayerframed + [page] + [preset=lefttop, + voffset=4mm, + y=\measure{blobheight}] + [align=normal, + offset=2mm, + strut=no, + frame=off, + height=\measure{blobheight}, + width=\measure{blobwidth}, + background=color, + backgroundcolor=darkcyan, + foregroundcolor=white] + {\doifelsemode{verbose}{\typebuffer[mp]}{\typesetbuffer[style,mp][frame=on,width=\measure{blobscale}]}} + +\setlayerframed + [page] + [preset=lefttop, + hoffset=4mm, + x=\measure{blobwidth}, + voffset=4mm, + y=\measure{blobheight}] + [align=normal, + offset=2mm, + strut=no, + frame=off, + height=\measure{blobheight}, + width=\measure{blobwidth}, + background=color, + backgroundcolor=darkmagenta, + foregroundcolor=white] + {\doifelsemode{verbose}{\typebuffer[csv]}{\typesetbuffer[style,csv][frame=on,width=\measure{blobscale}]}} + +\setlayerframed + [page] + [preset=righttop, + hoffset=4mm, + x=\measure{blobwidth}, + voffset=4mm, + y=\measure{blobheight}] + [align=normal, + offset=2mm, + strut=no, + frame=off, + height=\measure{blobheight}, + width=\measure{blobwidth}, + background=color, + backgroundcolor=darkyellow, + foregroundcolor=white] + {\doifelsemode{verbose}{\typebuffer[json]}{\typesetbuffer[style,json][frame=on,width=\measure{blobscale}]}} + +\setlayerframed + [page] + [preset=righttop, + voffset=4mm, + y=\measure{blobheight}] + [align=normal, + offset=2mm, + strut=no, + frame=off, + height=\measure{blobheight}, + width=\measure{blobwidth}, + background=color, + backgroundcolor=darkorange, + foregroundcolor=white] + {\doifelsemode{verbose}{\typebuffer[mkxi]}{\typesetbuffer[style,mkxi][frame=on,width=\measure{blobscale}]}} + +\startstandardmakeup + \tightlayer[page] +\stopstandardmakeup + +\stopbuffer + +\starttext + +{\enablemode[verbose] \getbuffer[everything]} + \getbuffer[everything] + +\stoptext + |