1 \startenvironment luatex-style
17 [alternative=doublesided
]
36 local skipped = table.tohash
{ 'id', 'subtype', 'next', 'prev'
}
38 function
document.functions.showfields(s)
39 local t = string.split(s,',')
40 local f = node.fields(t
[1],t
[2])
48 context(',
{\tttf %s}', fi)
50 context('
{\tttf %s}', fi)
57 function
document.functions.showid(s)
58 local t = string.split(s,',')
59 context('
{tttf
%s}',node.id(t[1]))
61 context(',
{tttf
%s}',node.subtype(t[2]))
65 function
document.functions.showsubtypes(s)
66 local s = node.subtypes(s)
68 for k, v in table.sortedhash(s) do
70 context(',
%s = {\\tttf %s}',k,v)
72 context('
%s = {\\tttf %s}',k,v)
79 \unexpanded\def\showfields #1{\ctxlua{document.functions.showfields("
#1")
}}
80 \unexpanded\def\showid #1{\ctxlua{document.functions.showid("
#1")
}}
81 \unexpanded\def\showsubtypes#1{\ctxlua{document.functions.showsubtypes("
#1")
}}
83 \definecolor[blue
] [b=
.5]
84 \definecolor[red
] [r=
.5]
85 \definecolor[green
] [g=
.5]
86 \definecolor[maincolor
] [b=
.5]
87 \definecolor[keptcolor
] [b=
.5]
88 \definecolor[othercolor
][r=
.5,g=
.5]
90 \setupbodyfont[modern
] % we need this in examples so we predefine
92 % \doifmodeelse {atpragma} {
100 % \setuphead [chapter] [style=\bfd]
101 % \setuphead [section] [style=\bfb]
102 % \setuphead [subsection] [style=\bfa]
103 % \setuphead [subsubsection][style=\bf]
107 % \definetypeface[mainfacenormal] [ss][sans] [iwona] [default]
108 % \definetypeface[mainfacenormal] [rm][serif][palatino] [default]
109 % \definetypeface[mainfacenormal] [tt][mono] [modern] [default][rscale=1.1]
110 % \definetypeface[mainfacenormal] [mm][math] [iwona] [default]
112 % \definetypeface[mainfacemedium] [ss][sans] [iwona-medium][default]
113 % \definetypeface[mainfacemedium] [rm][serif][palatino] [default]
114 % \definetypeface[mainfacemedium] [tt][mono] [modern] [default][rscale=1.1]
115 % \definetypeface[mainfacemedium] [mm][math] [iwona-medium][default]
118 % [mainfacenormal,10pt]
120 % \setuphead [chapter] [style=\mainfacemedium\bfd]
121 % \setuphead [section] [style=\mainfacemedium\bfb]
122 % \setuphead [subsection] [style=\mainfacemedium\bfa]
123 % \setuphead [subsubsection][style=\mainfacemedium\bf]
127 \writestatus{luatex manual
}{we assume that dejavu math is available
}
129 \setupbodyfont % assumes dejavu-math
132 \setuphead [chapter
] [align=
{flushleft,broad
},style=
\bfd]
133 \setuphead [section
] [align=
{flushleft,broad
},style=
\bfb]
134 \setuphead [subsection
] [align=
{flushleft,broad
},style=
\bfa]
135 \setuphead [subsubsection
][align=
{flushleft,broad
},style=
\bf]
137 \setuphead [chapter
] [color=maincolor
]
138 \setuphead [section
] [color=maincolor
]
139 \setuphead [subsection
] [color=maincolor
]
140 \setuphead [subsubsection
][color=maincolor
]
166 % if we do this we also need to do it in table cells
179 color luaplanetcolor ; luaplanetcolor :=
\MPcolor{maincolor
} ;
180 color luaholecolor ; luaholecolor := white ;
181 numeric luaextraangle ; luaextraangle :=
0 ;
182 numeric luaorbitfactor ; luaorbitfactor :=
.25 ;
184 vardef lualogo = image (
186 % Graphic design by A. Nakonechnyj. Copyright (c) 1998, All rights reserved.
188 save d, r, p ; numeric d, r, p ;
190 d := sqrt(
2)/
4 ; r :=
1/
4 ; p := r/
8 ;
192 fill fullcircle scaled
1
193 withcolor luaplanetcolor ;
194 draw fullcircle rotated
40.5 scaled (
1+r)
195 dashed evenly scaled p
196 withpen pencircle scaled (p/
2)
197 withcolor (luaorbitfactor * luaholecolor) ;
198 fill fullcircle scaled r shifted (d+
1/
8,d+
1/
8)
199 rotated luaextraangle
200 withcolor luaplanetcolor ;
201 fill fullcircle scaled r shifted (d-
1/
8,d-
1/
8)
202 withcolor luaholecolor ;
203 luaorbitfactor :=
.25 ;
208 \startuseMPgraphic{luapage
}
211 fill Page withcolor
\MPcolor{othercolor
} ;
213 luaorbitfactor :=
1 ;
214 picture p ; p := lualogo xsized (
3PaperWidth/
5) ;
215 draw p shifted center Page shifted (
0,-
.5ypart center ulcorner p) ;
220 \starttexdefinition luaextraangle
221 % we can also just access the last page and so in mp directly
223 context(
\lastpage ==
0 and
0 or
\realfolio*
360/
\lastpage)
227 \startuseMPgraphic{luanumber
}
228 luaextraangle :=
\luaextraangle;
229 luaorbitfactor :=
0.25 ;
230 picture p ; p := lualogo ;
231 setbounds p to boundingbox fullcircle ;
248 \startsetups pagenumber:right
251 [preset=rightbottom,offset=
1cm
]
252 [frame=off,height=
1cm,offset=overlay
]
253 {\useMPgraphic{luanumber
}}
256 [preset=rightbottom,offset=
1cm,x=
1.5cm
]
257 [frame=off,height=
1cm,width=
1cm,offset=overlay
]
261 [preset=rightbottom,offset=
1cm,x=
2.5cm
]
262 [frame=off,height=
1cm,offset=overlay
]
263 {\getmarking[chapter
]}
266 \startsetups pagenumber:left
269 [preset=leftbottom,offset=
1cm,x=
2.5cm
]
270 [frame=off,height=
1cm,offset=overlay
]
271 {\getmarking[chapter
]}
274 [preset=leftbottom,offset=
1cm,x=
1.5cm
]
275 [frame=off,height=
1cm,width=
1cm,offset=overlay
]
279 [preset=leftbottom,offset=
1cm
]
280 [frame=off,height=
1cm,offset=overlay
]
281 {\useMPgraphic{luanumber
}}
284 \unexpanded\def\nonterminal#1>
{\mathematics{\langle\hbox{\rm #1}\rangle}}
286 % taco's brainwave -)
288 \newcatcodetable\syntaxcodetable
290 \unexpanded\def\makesyntaxcodetable
292 \catcode`\<=
13 \catcode`\|=
12
293 \catcode`\!=
0 \catcode`\\=
12
294 \savecatcodetable\syntaxcodetable
299 \unexpanded\def\startsyntax {\begingroup\catcodetable\syntaxcodetable \dostartsyntax}
300 \unexpanded\def\syntax {\begingroup\catcodetable\syntaxcodetable \dosyntax}
301 \let\stopsyntax \relax
303 \unexpanded\def\syntaxenvbody#1%
311 \unexpanded\def\syntaxbody#1%
316 \bgroup \catcodetable\syntaxcodetable
318 !gdef!dostartsyntax
#1\stopsyntax{!let<!nonterminal!syntaxenvbody
{#1}!endgroup
}
319 !gdef!dosyntax
#1{!let<!nonterminal!syntaxbody
{#1}!endgroup
}
333 [chapter,section,subsection
]
336 [chapter,section,subsection,subsubsection
]
346 [subsection,subsubsection
]
350 % Hans doesn't like the bookmarks opening by default so we comment this:
352 % \setupinteractionscreen