\setuplayout[tight] \definecombination[Pexeso] \setupcombination[Pexeso][alternative=label] \setupexternalfigures[width=45mm,inbetween=,location=global,directory=1] \setupbodyfont [%pagella, sans, ] \definefontsize[e] \definebodyfontenvironment[default][e=1.85] \showlayout % MP \defineoverlay[Bkg][\useMPgraphic{Bkg}] \startuseMPgraphic{Bkg} newpath pa; pa = (-22mm, -10mm) -- (-15mm, -15mm) -- (15mm, -15mm) -- (22mm, -10mm) -- (22mm, 10mm) -- (15mm, 15mm) -- (-15mm, 15mm) -- (-22mm, 10mm) -- cycle; pa := pa scaled 0.9 randomized 1.mm; color col; col := .333blue; if true : fill pa withcolor (.995 yellow) ; draw pa withpen pencircle scaled (1.25mm) withcolor blue; fi \stopuseMPgraphic % \definecolor[LtrCol][r=.5,g=0.,b=0.,t_=.667,a=.5] \defineoverlay[Ltr][\useMPgraphic{Ltr}] \startuseMPgraphic{Ltr} draw thelabel(btex\bfe \MPtext{1} etex, (0mm, 0mm)) withcolor "LtrCol" ; newpath pa; pa = (0mm, 0mm) -- (42mm, -42mm) -- cycle; setbounds currentpicture to pa; \stopuseMPgraphic %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%ěščřžýáíé \starttext \startluacode local pics = {} local pa = lfs.currentdir() .. "/1" for fn in lfs.dir(pa) do fn = pa .. "/" .. fn local atts = lfs.attributes(fn) print(fn) --inspect(atts); io.read() if atts and atts.mode == "file" then table.insert(pics, (fn:gsub("\\", "/"))) end end --inspect(pics); io.read() local C = context local pics1 = {} for i, pic in ipairs(pics) do table.insert(pics1, pic) if math.mod(i, 10) == 0 or i == #pics then for j, fun in ipairs{ function(i, pic) if not pic then return end local c = pic:match(".*/(.)") C.setMPtext(1, c == "-" and "" or c:upper()) C.framed( {width = "50mm", height = "50mm", frame = "none", background = "foreground,Ltr"}, context.nested.externalfigure{pic}) end, function(i, pic) C.framed({width = "50mm", height = "50mm", frame = "none", background = "Bkg"}, context.nested.bfe("NÁŘADÍ")) end, } do C.startalignment{"middle"} C.bTABLE{ align = "{lohi,middle}", ["frame" .. (j == 2 and "" or "~")] = "off", } for k = 1, math.ceil(#pics1 / 2) * 2 do local pic = pics1[k] if math.mod(k, 2) == 1 then C.bTR() end for _ = 1, 2 do C.bTD() fun(i, pic) C.eTD() end if math.mod(k, 2) == 0 then C.eTR() end end C.eTABLE() C.stopalignment() C.page() end pics1 = {} end end \stopluacode \stoptext