m-layout.mkiv /size: 3885 b    last modification: 2020-07-01 14:35
1%D \module
2%D   [       file=m-layout,
3%D        version=2004.01.16,
4%D          title=\CONTEXT\ Modules,
5%D       subtitle=Additional Layouts,
6%D         author={Hans Hagen \& Ton Otten},
7%D           date=\currentdate,
8%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
9%C
10%C This module is part of the \CONTEXT\ macro||package and is
11%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
12%C details.
13
14% layout-preset - thf th tf
15
16%D This is a preliminary module, don't depend on these dimensions yet.
17
18\readsysfile{lang-frq}\donothing\donothing
19\readsysfile{lang-frd}\donothing\donothing
20
21\unprotect
22
23% \def\layouthwratio{\withoutpt\the\dimexpr8\paperheight/\dimexpr(\paperwidth/ 8192)\relax}
24% \def\layouthwratio{\withoutpt\the\dimexpr4\paperheight/\dimexpr(\paperwidth/16384)\relax}
25% \def\layouthwratio{\withoutpt\the\dimexpr2\paperheight/\dimexpr(\paperwidth/32768)\relax}
26
27\def\layouthwratio
28  {\withoutpt\the\dimexpr2\paperheight/(\paperwidth/32768)\relax}
29
30\def\layouthfheight
31  {\dimexpr\layoutparameter\c!header+\layoutparameter\c!headerdistance+
32           \layoutparameter\c!footer+\layoutparameter\c!footerdistance\relax}
33
34\startsetups[preset-1]
35
36  \xdef\layoutwidth {\dimexpr\layoutparameter\c!width\relax}
37  \gdef\layoutheight{\dimexpr\layouthwratio\dimexpr\layoutwidth\relax+\layouthfheight\relax}
38
39\stopsetups
40
41\definelayout
42  [preset-1-1]
43  [\c!preset=preset-1,
44   \c!backspace=\dimexpr(\paperwidth-\layoutwidth)/2\relax,
45   \c!width=\dimexpr2\paperwidth/3\relax,
46   \c!cutspace=\dimexpr(\paperwidth-\layoutwidth)/2\relax,
47   \c!margin=\dimexpr(\paperwidth-\layoutwidth)/3\relax,
48   \c!header=2\lineheight,
49   \c!headerdistance=\lineheight,
50   \c!height=\v!middle, % \layoutheight
51   \c!footerdistance=\layoutparameter\c!headerdistance, % \lineheight,
52   \c!footer=\layoutparameter\c!header, % 2\lineheight,
53   \c!topspace=\dimexpr1\dimexpr\paperheight-(\layoutheight+\layouthfheight)\relax/3\relax,
54   \c!bottomspace=\dimexpr2\dimexpr\paperheight-(\layoutheight+\layouthfheight)\relax/3\relax]
55
56\startsetups[preset-2]
57
58  \gdef\layouthstep{\dimexpr\paperwidth /\layoutparameter\c!columns\relax}
59  \gdef\layoutvstep{\dimexpr\paperheight/\layoutparameter\c!columns\relax}
60
61\stopsetups
62
63\definelayout
64  [preset-2-1]
65  [\c!preset=preset-2,
66   \c!columns=12,
67   \c!backspace=\layouthstep,
68   \c!width=\v!middle,
69   \c!cutspace=2\layouthstep,
70   \c!margin=\layouthstep,
71   \c!header=2\lineheight,
72   \c!headerdistance=\lineheight,
73   \c!height=\v!middle, % \layoutheight
74   \c!footerdistance=\layoutparameter\c!headerdistance,
75   \c!footer=\layoutparameter\c!header,
76   \c!topspace=\dimexpr\layoutvstep-\layoutparameter\c!header-\layoutparameter\c!headerdistance\relax,
77   \c!bottomspace=\dimexpr(2\layoutvstep)-\layoutparameter\c!header-\layoutparameter\c!headerdistance\relax]
78
79\definelayout
80  [preset-2-2]
81  [\c!preset=preset-2,
82   \c!columns=12,
83   \c!backspace=\layouthstep,
84   \c!width=\v!middle,
85   \c!cutspace=2\layouthstep,
86   \c!margin=\layouthstep,
87   \c!header=2\lineheight,
88   \c!headerdistance=\lineheight,
89   \c!height=\v!middle, % \layoutheight
90   \c!footerdistance=\layoutparameter\c!headerdistance,
91   \c!footer=\layoutparameter\c!header,
92   \c!topspace=\layoutvstep,
93   \c!bottomspace=\layoutvstep] % maybe 1.5
94
95%                                                     \setuplayout[preset-1-1] test \showframe \page
96% \setuplayout[preset-1-1][width=65\averagecharwidth] \setuplayout[preset-1-1] test \showframe \page
97%                                                     \setuplayout[preset-2-1] test \showframe \page
98% \setuplayout[preset-2-1][columns=10]                \setuplayout[preset-2-1] test \showframe \page
99%                                                     \setuplayout[preset-2-2] test \showframe \page
100% \setuplayout[preset-2-2][columns=10]                \setuplayout[preset-2-2] test \showframe \page
101
102\protect \endinput
103