1 /** This file is part of Shapes.
3 ** Shapes is free software: you can redistribute it and/or modify
4 ** it under the terms of the GNU General Public License as published by
5 ** the Free Software Foundation, either version 3 of the License, or
8 ** Shapes is distributed in the hope that it will be useful,
9 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
10 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 ** GNU General Public License for more details.
13 ** You should have received a copy of the GNU General Public License
14 ** along with Shapes. If not, see <http://www.gnu.org/licenses/>.
16 ** Copyright 2008, 2014, 2015 Henrik Tidefelt
20 ##lookin ..Shapes..Geometry
22 clock: \ hour minute →
27 hourAngle: 90° - (hour/12)*360°
28 minuteAngle: 90° - (minute/60)*360°
30 [stroke (0cm,0cm)--(hourLength*[dir hourAngle])]
32 [stroke (0cm,0cm)--(minuteLength*[dir minuteAngle])]
35 •catalog.[setpagelabel prefix:`Am ´ number:'8]
36 •catalog.[setbboxgroup 'clock]
37 •stdout << `First page's label: ´ << •catalog.[nextpagelabel] << "{n}
39 •catalog << [clock 8 0]
40 & [destination level:'0 text:`Morning´ color:[rgb 0.5 0.5 0] open:true]
41 & [destination level:'1 text:`Eight´]
43 bar: [circle 5mm] >> stroke >> [shift (3cm,1cm)]
46 [annotationLink site:[site target:bar
47 text:`Leave this place!´
49 name:`four in the afternoon´]
52 & [destination level:'1 text:`Nine´]
54 •catalog.[setpagelabel number:•catalog.[nextpagenumber]+'1]
55 •stdout << `Skipping to page: ´ << •catalog.[nextpagenumber] << "{n}
57 •catalog << [clock •catalog.[nextpagenumber]*1 0]
59 /** Note how the various part of the page label may be set independently of each other.
61 •catalog.[setpagelabel prefix:`Pm ´]
62 •catalog.[setpagelabel number:'33]
63 •catalog.[setpagelabel style:'alphabet]
64 •stdout << `Later page's label: ´ << •catalog.[nextpagelabel] << "{n}
66 •catalog << [clock 3 10]
67 & [destination level:'0 text:`Afternoon´ italic:true]
69 & [destination name:`four in the afternoon´]
71 & [destination level:'1 text:`Five´ bold:true]