From 370853b6ba0be6e880b2f320268d4fefbd6aeef6 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 14 Oct 2019 03:00:58 +0000 Subject: CTAN sync 201910140300 --- systems/doc/luatex/luatex-style.tex | 886 ++++++++++++++++++------------------ 1 file changed, 443 insertions(+), 443 deletions(-) (limited to 'systems/doc/luatex/luatex-style.tex') diff --git a/systems/doc/luatex/luatex-style.tex b/systems/doc/luatex/luatex-style.tex index 502e894a8c..aa0a7edc3f 100644 --- a/systems/doc/luatex/luatex-style.tex +++ b/systems/doc/luatex/luatex-style.tex @@ -1,443 +1,443 @@ -\startenvironment luatex-style - -% todo: use \useMPlibrary[lua] - -\enabletrackers[fonts.usage] - -\usemodule[fonts-statistics] - -\setuplayout - [height=middle, - width=middle, - backspace=2cm, - topspace=10mm, - bottomspace=10mm, - header=10mm, - footer=10mm, - footerdistance=10mm, - headerdistance=10mm] - -\setuppagenumbering - [alternative=doublesided] - -\setuptolerance - [stretch,tolerant] - -\setuptype - [lines=hyphenated] - -\setuptyping - [lines=hyphenated] - -\setupitemize - [each] - [packed] - -\definesymbol[1][\Uchar"2023] -\definesymbol[2][\endash] -\definesymbol[3][\wait] % we want to catch it - -\setupitemize - [each] - [headcolor=maincolor, - symbolcolor=maincolor, - color=maincolor] - -\setupwhitespace - [medium] - -\setuptabulate - [blank={small,samepage}, - headstyle=bold, - rulecolor=maincolor, - rulethickness=1pt, - foregroundcolor=white, - foregroundstyle=\ss\bfx\WORD, - backgroundcolor=maincolor] - -\setupcaptions - [headcolor=darkblue] - -\startluacode - local skipped = table.tohash { 'id', 'subtype', 'next', 'prev' } - - function document.functions.showfields(s) - local t = string.split(s,',') - local f = node.fields(t[1],t[2]) - if f then - local d = false - for i=1,#f do - local fi = f[i] - if skipped[fi] then - -- okay - elseif d then - context(', {\tttf %s}', fi) - else - context('{\tttf %s}', fi) - d = true - end - end - end - end - - function document.functions.showid(s) - local t = string.split(s,',') - context('{tttf %s}',node.id(t[1])) - if t[2] then - context(', {tttf %s}',node.subtype(t[2])) - end - end - - function document.functions.showsubtypes(s) - local s = node.subtypes(s) - local d = false - for k, v in table.sortedhash(s) do - if d then - context(', %s = {\\tttf %s}',k,v) - else - context('%s = {\\tttf %s}',k,v) - d = true - end - end - end -\stopluacode - -\unexpanded\def\showfields #1{\ctxlua{document.functions.showfields("#1")}} -\unexpanded\def\showid #1{\ctxlua{document.functions.showid("#1")}} -\unexpanded\def\showsubtypes#1{\ctxlua{document.functions.showsubtypes("#1")}} - -\definecolor[blue] [b=.5] -\definecolor[red] [r=.5] -\definecolor[green] [g=.5] -\definecolor[maincolor] [b=.5] -\definecolor[keptcolor] [b=.5] -\definecolor[othercolor][r=.5,g=.5] - -\writestatus{luatex manual}{} -\writestatus{luatex manual}{defining lucodaot} \usebodyfont [lucidaot] -\writestatus{luatex manual}{defining pagella} \usebodyfont [pagella] -\writestatus{luatex manual}{defining cambria} \usebodyfont [cambria] -\writestatus{luatex manual}{defining modern} \usebodyfont [modern] -\writestatus{luatex manual}{defining dejavu} \setupbodyfont[dejavu,10pt] -\writestatus{luatex manual}{} - -\setuphead [chapter] [align={flushleft,broad},style=\bfd] -\setuphead [section] [align={flushleft,broad},style=\bfb] -\setuphead [subsection] [align={flushleft,broad},style=\bfa] -\setuphead [subsubsection][align={flushleft,broad},style=\bf] - -\setuphead [chapter] [color=maincolor] -\setuphead [section] [color=maincolor] -\setuphead [subsection] [color=maincolor] -\setuphead [subsubsection][color=maincolor] - -\setupfloats - [ntop=4] - -\definehead - [remark] - [subsubsubject] - -\setupheadertexts - [] - -% \setuplayout -% [style=bold, -% color=maincolor] - -\definemixedcolumns - [twocolumns] - [n=2, - balance=yes, - before=\blank, - after=\blank] - -\definemixedcolumns - [threecolumns] - [twocolumns] - [n=3] - -\definemixedcolumns - [fourcolumns] - [threecolumns] - [n=4] - -% if we do this we also need to do it in table cells -% -% \setuptyping -% [color=maincolor] -% -% \setuptype -% [color=maincolor] - -\definetyping - [functioncall] - -\startMPdefinitions - - color luaplanetcolor ; luaplanetcolor := \MPcolor{maincolor} ; - color luaholecolor ; luaholecolor := white ; - numeric luaextraangle ; luaextraangle := 0 ; - numeric luaorbitfactor ; luaorbitfactor := .25 ; - - vardef lualogo = image ( - - % Graphic design by A. Nakonechnyj. Copyright (c) 1998, All rights reserved. - - save d, r, p ; numeric d, r, p ; - - d := sqrt(2)/4 ; r := 1/4 ; p := r/8 ; - - fill fullcircle scaled 1 - withcolor luaplanetcolor ; - draw fullcircle rotated 40.5 scaled (1+r) - dashed evenly scaled p - withpen pencircle scaled (p/2) - withcolor (luaorbitfactor * luaholecolor) ; - fill fullcircle scaled r shifted (d+1/8,d+1/8) - rotated - luaextraangle - withcolor luaplanetcolor ; - fill fullcircle scaled r shifted (d-1/8,d-1/8) - withcolor luaholecolor ; - luaorbitfactor := .25 ; - ) enddef ; - -\stopMPdefinitions - -\startuseMPgraphic{luapage} - StartPage ; - - fill Page withcolor \MPcolor{othercolor} ; - - luaorbitfactor := 1 ; - - picture p ; p := lualogo ysized (5*\measure{paperheight}/10) ; - draw p - shifted - center p - shifted ( - \measure{spreadwidth} - .5*\measure{paperwidth} + \measure{spinewidth}, - .375*\measure{paperheight} - ) - ; - - StopPage ; -\stopuseMPgraphic - -% \starttexdefinition luaextraangle -% % we can also just access the last page and so in mp directly -% \ctxlua { -% context(\lastpage == 0 and 0 or \realfolio*360/\lastpage) -% } -% \stoptexdefinition - -\startuseMPgraphic{luanumber} - % luaextraangle := \luaextraangle; - luaextraangle := if (LastPageNumber < 10) : 10 else : (RealPageNumber / LastPageNumber) * 360 fi; - luaorbitfactor := 0.25 ; - picture p ; p := lualogo ; - setbounds p to boundingbox fullcircle ; - draw p ysized 1cm ; -\stopuseMPgraphic - -\definelayer - [page] - [width=\paperwidth, - height=\paperheight] - -\setupbackgrounds - [leftpage] - [background=page] - -\setupbackgrounds - [rightpage] - [background=page] - -\definemeasure[banneroffset][\bottomspace-\footerheight-\footerdistance+2cm] - -\startsetups pagenumber:right - \setlayerframed - [page] - [preset=rightbottom,x=1.0cm,y=\measure{banneroffset}] - [frame=off,height=1cm,offset=overlay] - {\strut\useMPgraphic{luanumber}} - \setlayerframed - [page] - [preset=rightbottom,x=2.5cm,y=\measure{banneroffset}] - [frame=off,height=1cm,width=1cm,offset=overlay, - foregroundstyle=bold,foregroundcolor=maincolor] - {\strut\pagenumber} - \setlayerframed - [page] - [preset=rightbottom,x=3.5cm,y=\measure{banneroffset}] - [frame=off,height=1cm,offset=overlay, - foregroundstyle=bold,foregroundcolor=maincolor] - {\strut\getmarking[chapter]} -\stopsetups - -\startsetups pagenumber:left - \setlayerframed - [page] - [preset=leftbottom,x=3.5cm,y=\measure{banneroffset}] - [frame=off,height=1cm,offset=overlay, - foregroundstyle=bold,foregroundcolor=maincolor] - {\strut\getmarking[chapter]} - \setlayerframed - [page] - [preset=leftbottom,x=2.5cm,y=\measure{banneroffset}] - [frame=off,height=1cm,width=1cm,offset=overlay, - foregroundstyle=bold,foregroundcolor=maincolor] - {\strut\pagenumber} - \setlayerframed - [page] - [preset=leftbottom,x=1.0cm,y=\measure{banneroffset}] - [frame=off,height=1cm,offset=overlay] - {\strut\useMPgraphic{luanumber}} -\stopsetups - -\unexpanded\def\nonterminal#1>{\mathematics{\langle\hbox{\rm #1}\rangle}} - -% taco's brainwave -) .. todo: create a typing variant so that we can avoid the !crlf - -\newcatcodetable\syntaxcodetable - -\unexpanded\def\makesyntaxcodetable - {\begingroup - \catcode`\<=13 \catcode`\|=12 - \catcode`\!= 0 \catcode`\\=12 - \savecatcodetable\syntaxcodetable - \endgroup} - -\makesyntaxcodetable - -\unexpanded\def\startsyntax {\begingroup\catcodetable\syntaxcodetable \dostartsyntax} -\unexpanded\def\syntax {\begingroup\catcodetable\syntaxcodetable \dosyntax} - \let\stopsyntax \relax - -\unexpanded\def\syntaxenvbody#1% - {\par - \tt - \startnarrower - % \maincolor - #1 - \stopnarrower - \par} - -\unexpanded\def\syntaxbody#1% - {\begingroup - % \maincolor - \tt #1% - \endgroup} - -\bgroup \catcodetable\syntaxcodetable - -!gdef!dostartsyntax#1\stopsyntax{!let{\mathematics{\langle\hbox{\rm #1}\rangle}} + +% taco's brainwave -) .. todo: create a typing variant so that we can avoid the !crlf + +\newcatcodetable\syntaxcodetable + +\unexpanded\def\makesyntaxcodetable + {\begingroup + \catcode`\<=13 \catcode`\|=12 + \catcode`\!= 0 \catcode`\\=12 + \savecatcodetable\syntaxcodetable + \endgroup} + +\makesyntaxcodetable + +\unexpanded\def\startsyntax {\begingroup\catcodetable\syntaxcodetable \dostartsyntax} +\unexpanded\def\syntax {\begingroup\catcodetable\syntaxcodetable \dosyntax} + \let\stopsyntax \relax + +\unexpanded\def\syntaxenvbody#1% + {\par + \tt + \startnarrower + % \maincolor + #1 + \stopnarrower + \par} + +\unexpanded\def\syntaxbody#1% + {\begingroup + % \maincolor + \tt #1% + \endgroup} + +\bgroup \catcodetable\syntaxcodetable + +!gdef!dostartsyntax#1\stopsyntax{!let