summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/m-layout.tex
blob: 5ccf0e98731922464c7fd7cb444a6cab428ec02d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
%D \module
%D   [       file=m-layout,
%D        version=2004.01.16,
%D          title=\CONTEXT\ Modules,
%D       subtitle=Additional Layouts,
%D         author={Hans Hagen \& Ton Otten},
%D           date=\currentdate,
%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

% layout-preset - thf th tf

%D This is a preliminary module, don't depend on these dimensions yet.

\readsysfile{lang-frq}\donothing\donothing
\readsysfile{lang-frd}\donothing\donothing

\unprotect

% \def\layouthwratio{\withoutpt\the\dimexpr8\paperheight/\dimexpr(\paperwidth/ 8192)\relax}
% \def\layouthwratio{\withoutpt\the\dimexpr4\paperheight/\dimexpr(\paperwidth/16384)\relax}
% \def\layouthwratio{\withoutpt\the\dimexpr2\paperheight/\dimexpr(\paperwidth/32768)\relax}

\def\layouthwratio
  {\withoutpt\the\dimexpr2\paperheight/(\paperwidth/32768)\relax}

\def\layouthfheight
  {\dimexpr\layoutparameter\c!header+\layoutparameter\c!headerdistance+
           \layoutparameter\c!footer+\layoutparameter\c!footerdistance\relax}

\startsetups[preset-1]

  \xdef\layoutwidth {\dimexpr\layoutparameter\c!width\relax}
  \gdef\layoutheight{\dimexpr\layouthwratio\dimexpr\layoutwidth\relax+\layouthfheight\relax}

\stopsetups

\definelayout
  [preset-1-1]
  [\c!preset=preset-1,
   \c!backspace=\dimexpr(\paperwidth-\layoutwidth)/2\relax,
   \c!width=\dimexpr2\paperwidth/3\relax,
   \c!cutspace=\dimexpr(\paperwidth-\layoutwidth)/2\relax,
   \c!margin=\dimexpr(\paperwidth-\layoutwidth)/3\relax,
   \c!header=2\lineheight,
   \c!headerdistance=\lineheight,
   \c!height=\v!middle, % \layoutheight
   \c!footerdistance=\layoutparameter\c!headerdistance, % \lineheight,
   \c!footer=\layoutparameter\c!header, % 2\lineheight,
   \c!topspace=\dimexpr1\dimexpr\paperheight-(\layoutheight+\layouthfheight)\relax/3\relax,
   \c!bottomspace=\dimexpr2\dimexpr\paperheight-(\layoutheight+\layouthfheight)\relax/3\relax]

\startsetups[preset-2]

  \gdef\layouthstep{\dimexpr\paperwidth /\layoutparameter\c!columns\relax}
  \gdef\layoutvstep{\dimexpr\paperheight/\layoutparameter\c!columns\relax}

\stopsetups

\definelayout
  [preset-2-1]
  [\c!preset=preset-2,
   \c!columns=12,
   \c!backspace=\layouthstep,
   \c!width=\v!middle,
   \c!cutspace=2\layouthstep,
   \c!margin=\layouthstep,
   \c!header=2\lineheight,
   \c!headerdistance=\lineheight,
   \c!height=\v!middle, % \layoutheight
   \c!footerdistance=\layoutparameter\c!headerdistance,
   \c!footer=\layoutparameter\c!header,
   \c!topspace=\dimexpr\layoutvstep-\layoutparameter\c!header-\layoutparameter\c!headerdistance\relax,
   \c!bottomspace=\dimexpr(2\layoutvstep)-\layoutparameter\c!header-\layoutparameter\c!headerdistance\relax]

\definelayout
  [preset-2-2]
  [\c!preset=preset-2,
   \c!columns=12,
   \c!backspace=\layouthstep,
   \c!width=\v!middle,
   \c!cutspace=2\layouthstep,
   \c!margin=\layouthstep,
   \c!header=2\lineheight,
   \c!headerdistance=\lineheight,
   \c!height=\v!middle, % \layoutheight
   \c!footerdistance=\layoutparameter\c!headerdistance,
   \c!footer=\layoutparameter\c!header,
   \c!topspace=\layoutvstep,
   \c!bottomspace=\layoutvstep] % maybe 1.5

%                                                     \setuplayout[preset-1-1] test \showframe \page
% \setuplayout[preset-1-1][width=65\averagecharwidth] \setuplayout[preset-1-1] test \showframe \page
%                                                     \setuplayout[preset-2-1] test \showframe \page
% \setuplayout[preset-2-1][columns=10]                \setuplayout[preset-2-1] test \showframe \page
%                                                     \setuplayout[preset-2-2] test \showframe \page
% \setuplayout[preset-2-2][columns=10]                \setuplayout[preset-2-2] test \showframe \page

\protect \endinput