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,',')
41 for _, a in pairs(node.fields(t
[1],t
[2])) do
42 if not skipped
[a
] then
43 table.insert(r,'\
\type{'.. a .. '
}')
46 tex.sprint(table.concat(r, ', '))
49 function
document.functions.showid(s)
50 local t = string.split(s,',')
51 tex.sprint('\
\type{'.. node.id(t
[1]) .. '
}')
53 tex.sprint(', \
\type{'.. node.subtype(t
[2]) .. '
}')
57 function
document.functions.showsubtypes(s)
58 local s = node.subtypes(s)
60 for k, v in table.sortedhash(s) do
62 context(',
%s = {\\tttf %s}',k,v)
64 context('
%s = {\\tttf %s}',k,v)
71 \unexpanded\def\showfields #1{\ctxlua{document.functions.showfields("
#1")
}}
72 \unexpanded\def\showid #1{\ctxlua{document.functions.showid("
#1")
}}
73 \unexpanded\def\showsubtypes#1{\ctxlua{document.functions.showsubtypes("
#1")
}}
75 \definecolor[blue
] [b=
.5]
76 \definecolor[red
] [r=
.5]
77 \definecolor[green
] [g=
.5]
78 \definecolor[maincolor
] [b=
.5]
79 \definecolor[keptcolor
] [b=
.5]
80 \definecolor[othercolor
][r=
.5,g=
.5]
82 \setupbodyfont[modern
] % we need this in examples so we predefine
84 % \doifmodeelse {atpragma} {
92 % \setuphead [chapter] [style=\bfd]
93 % \setuphead [section] [style=\bfb]
94 % \setuphead [subsection] [style=\bfa]
95 % \setuphead [subsubsection][style=\bf]
99 % \definetypeface[mainfacenormal] [ss][sans] [iwona] [default]
100 % \definetypeface[mainfacenormal] [rm][serif][palatino] [default]
101 % \definetypeface[mainfacenormal] [tt][mono] [modern] [default][rscale=1.1]
102 % \definetypeface[mainfacenormal] [mm][math] [iwona] [default]
104 % \definetypeface[mainfacemedium] [ss][sans] [iwona-medium][default]
105 % \definetypeface[mainfacemedium] [rm][serif][palatino] [default]
106 % \definetypeface[mainfacemedium] [tt][mono] [modern] [default][rscale=1.1]
107 % \definetypeface[mainfacemedium] [mm][math] [iwona-medium][default]
110 % [mainfacenormal,10pt]
112 % \setuphead [chapter] [style=\mainfacemedium\bfd]
113 % \setuphead [section] [style=\mainfacemedium\bfb]
114 % \setuphead [subsection] [style=\mainfacemedium\bfa]
115 % \setuphead [subsubsection][style=\mainfacemedium\bf]
119 \writestatus{luatex manual
}{we assume that dejavu math is available
}
121 \setupbodyfont % assumes dejavu-math
124 \setuphead [chapter
] [align=
{flushleft,broad
},style=
\bfd]
125 \setuphead [section
] [align=
{flushleft,broad
},style=
\bfb]
126 \setuphead [subsection
] [align=
{flushleft,broad
},style=
\bfa]
127 \setuphead [subsubsection
][align=
{flushleft,broad
},style=
\bf]
129 \setuphead [chapter
] [color=maincolor
]
130 \setuphead [section
] [color=maincolor
]
131 \setuphead [subsection
] [color=maincolor
]
132 \setuphead [subsubsection
][color=maincolor
]
169 color luaplanetcolor ; luaplanetcolor :=
\MPcolor{maincolor
} ;
170 color luaholecolor ; luaholecolor := white ;
171 numeric luaextraangle ; luaextraangle :=
0 ;
172 numeric luaorbitfactor ; luaorbitfactor :=
.25 ;
174 vardef lualogo = image (
176 % Graphic design by A. Nakonechnyj. Copyright (c) 1998, All rights reserved.
178 save d, r, p ; numeric d, r, p ;
180 d := sqrt(
2)/
4 ; r :=
1/
4 ; p := r/
8 ;
182 fill fullcircle scaled
1
183 withcolor luaplanetcolor ;
184 draw fullcircle rotated
40.5 scaled (
1+r)
185 dashed evenly scaled p
186 withpen pencircle scaled (p/
2)
187 withcolor (luaorbitfactor * luaholecolor) ;
188 fill fullcircle scaled r shifted (d+
1/
8,d+
1/
8)
189 rotated luaextraangle
190 withcolor luaplanetcolor ;
191 fill fullcircle scaled r shifted (d-
1/
8,d-
1/
8)
192 withcolor luaholecolor ;
193 luaorbitfactor :=
.25 ;
198 \startuseMPgraphic{luapage
}
201 fill Page withcolor
\MPcolor{othercolor
} ;
203 luaorbitfactor :=
1 ;
204 picture p ; p := lualogo xsized (
3PaperWidth/
5) ;
205 draw p shifted center Page shifted (
0,-
.5ypart center ulcorner p) ;
210 \starttexdefinition luaextraangle
211 % we can also just access the last page and so in mp directly
213 context(
\lastpage ==
0 and
0 or
\realfolio*
360/
\lastpage)
217 \startuseMPgraphic{luanumber
}
218 luaextraangle :=
\luaextraangle;
219 luaorbitfactor :=
0.25 ;
220 picture p ; p := lualogo ;
221 setbounds p to boundingbox fullcircle ;
238 \startsetups pagenumber:right
241 [preset=rightbottom,offset=
1cm
]
242 [frame=off,height=
1cm,offset=overlay
]
243 {\useMPgraphic{luanumber
}}
246 [preset=rightbottom,offset=
1cm,x=
1.5cm
]
247 [frame=off,height=
1cm,width=
1cm,offset=overlay
]
251 [preset=rightbottom,offset=
1cm,x=
2.5cm
]
252 [frame=off,height=
1cm,offset=overlay
]
253 {\getmarking[chapter
]}
256 \startsetups pagenumber:left
259 [preset=leftbottom,offset=
1cm,x=
2.5cm
]
260 [frame=off,height=
1cm,offset=overlay
]
261 {\getmarking[chapter
]}
264 [preset=leftbottom,offset=
1cm,x=
1.5cm
]
265 [frame=off,height=
1cm,width=
1cm,offset=overlay
]
269 [preset=leftbottom,offset=
1cm
]
270 [frame=off,height=
1cm,offset=overlay
]
271 {\useMPgraphic{luanumber
}}
274 \unexpanded\def\nonterminal#1>
{\mathematics{\langle\hbox{\rm #1}\rangle}}
276 % taco's brainwave -)
278 \newcatcodetable\syntaxcodetable
280 \unexpanded\def\makesyntaxcodetable
282 \catcode`\<=
13 \catcode`\|=
12
283 \catcode`\!=
0 \catcode`\\=
12
284 \savecatcodetable\syntaxcodetable
289 \unexpanded\def\startsyntax {\begingroup\catcodetable\syntaxcodetable \dostartsyntax}
290 \unexpanded\def\syntax {\begingroup\catcodetable\syntaxcodetable \dosyntax}
291 \let\stopsyntax \relax
293 \unexpanded\def\syntaxenvbody#1%
301 \unexpanded\def\syntaxbody#1%
306 \bgroup \catcodetable\syntaxcodetable
308 !gdef!dostartsyntax
#1\stopsyntax{!let<!nonterminal!syntaxenvbody
{#1}!endgroup
}
309 !gdef!dosyntax
#1{!let<!nonterminal!syntaxbody
{#1}!endgroup
}
323 [chapter,section,subsection
]
326 [chapter,section,subsection,subsubsection
]
335 % Hans doesn't like the bookmarks opening by default so we comment this:
337 % \setupinteractionscreen