summaryrefslogtreecommitdiff
path: root/tex/context/modules/mkiv/m-typesetting.mkiv
blob: 34713fa3897c3df1940175db83fd6432c8e87dc7 (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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
%D \module
%D   [       file=m-typesetting,
%D        version=2017.11.15, % reused from columnset style
%D          title=\CONTEXT\ Modules,
%D       subtitle=Typesetting pages,
%D         author=Hans Hagen,
%D           date=\currentdate,
%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]

%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

\startmodule[typesetting]

% \setupcombination
%   [style=mono]

\definecombination
  [twopages]

\definecombination
  [fourpages]
  [distance=.5\bodyfontsize,
   width=\textwidth]

\definecombination
  [sixpages]
  [distance=.5\bodyfontsize,
   width=\textwidth]

\definemeasure[twopages]  [\dimexpr\dimexpr\textwidth-3  \bodyfontsize\relax/4\relax]
\definemeasure[fourpages] [\dimexpr\dimexpr\textwidth-3  \bodyfontsize\relax/4\relax]
\definemeasure[sixpages]  [\dimexpr\dimexpr\textwidth-2.5\bodyfontsize\relax/6\relax]
\definemeasure[eightpages][\dimexpr\dimexpr\textwidth-3  \bodyfontsize\relax/4\relax]

\starttexdefinition unexpanded OnePage #1
    \startlinecorrection[blank]
        \startcombination[twopages][1*1]
            {\typesetfile[#1.tex][page=1,lines=15]} {1}
        \stopcombination
    \stoplinecorrection
\stoptexdefinition

\starttexdefinition unexpanded OneSpread #1
    \startlinecorrection[blank]
        \startcombination[twopages][1*1]
            {\typesetfile[#1.tex][page=2,lines=15]} {2}
        \stopcombination
    \stoplinecorrection
\stoptexdefinition

\starttexdefinition unexpanded TwoPages #1
    \startlinecorrection[blank]
        \startcombination[twopages][2*1]
            {\typesetfile[#1.tex][page=1,width=\measure{twopages}]} {1}
            {\typesetfile[#1.tex][page=2,width=\measure{twopages}]} {2}
        \stopcombination
    \stoplinecorrection
\stoptexdefinition

\starttexdefinition unexpanded TwoSpread #1
    \startlinecorrection[blank]
        \startcombination[twopages][2*1]
            {\typesetfile[#1.tex][page=2,width=\measure{twopages}]} {2}
            {\typesetfile[#1.tex][page=3,width=\measure{twopages}]} {3}
        \stopcombination
    \stoplinecorrection
\stoptexdefinition

\starttexdefinition unexpanded FourPages #1
    \startlinecorrection[blank]
        \startcombination[fourpages][4*1]
            {\typesetfile[#1.tex][page=1,width=\measure{fourpages}]} {1}
            {\typesetfile[#1.tex][page=2,width=\measure{fourpages}]} {2}
            {\typesetfile[#1.tex][page=3,width=\measure{fourpages}]} {3}
            {\typesetfile[#1.tex][page=4,width=\measure{fourpages}]} {4}
        \stopcombination
    \stoplinecorrection
\stoptexdefinition

\starttexdefinition unexpanded FourSpread #1
    \startlinecorrection[blank]
        \startcombination[fourpages][4*1]
            {\typesetfile[#1.tex][page=2,width=\measure{fourpages}]} {2}
            {\typesetfile[#1.tex][page=3,width=\measure{fourpages}]} {3}
            {\typesetfile[#1.tex][page=4,width=\measure{fourpages}]} {4}
            {\typesetfile[#1.tex][page=5,width=\measure{fourpages}]} {5}
        \stopcombination
    \stoplinecorrection
\stoptexdefinition

\starttexdefinition unexpanded SixPages #1
    \startlinecorrection[blank]
        \startcombination[sixpages][6*1]
            {\typesetfile[#1.tex][page=1,width=\measure{sixpages}]} {1}
            {\typesetfile[#1.tex][page=2,width=\measure{sixpages}]} {2}
            {\typesetfile[#1.tex][page=3,width=\measure{sixpages}]} {3}
            {\typesetfile[#1.tex][page=4,width=\measure{sixpages}]} {4}
            {\typesetfile[#1.tex][page=5,width=\measure{sixpages}]} {5}
            {\typesetfile[#1.tex][page=6,width=\measure{sixpages}]} {6}
        \stopcombination
    \stoplinecorrection
\stoptexdefinition

\starttexdefinition unexpanded SixSpread #1
    \startlinecorrection[blank]
        \startcombination[sixpages][6*1]
            {\typesetfile[#1.tex][page=2,width=\measure{sixpages}]} {2}
            {\typesetfile[#1.tex][page=3,width=\measure{sixpages}]} {3}
            {\typesetfile[#1.tex][page=4,width=\measure{sixpages}]} {4}
            {\typesetfile[#1.tex][page=5,width=\measure{sixpages}]} {5}
            {\typesetfile[#1.tex][page=6,width=\measure{sixpages}]} {6}
            {\typesetfile[#1.tex][page=7,width=\measure{sixpages}]} {7}
        \stopcombination
    \stoplinecorrection
\stoptexdefinition

\starttexdefinition unexpanded EightPages #1
    \startlinecorrection[blank]
        \startcombination[fourpages][4*2]
            {\typesetfile[#1.tex][page=1,width=\measure{eightpages}]} {#1 / 1}
            {\typesetfile[#1.tex][page=2,width=\measure{eightpages}]} {#1 / 2}
            {\typesetfile[#1.tex][page=3,width=\measure{eightpages}]} {#1 / 3}
            {\typesetfile[#1.tex][page=4,width=\measure{eightpages}]} {#1 / 4}
            {\typesetfile[#1.tex][page=5,width=\measure{eightpages}]} {#1 / 5}
            {\typesetfile[#1.tex][page=6,width=\measure{eightpages}]} {#1 / 6}
            {\typesetfile[#1.tex][page=7,width=\measure{eightpages}]} {#1 / 7}
            {\typesetfile[#1.tex][page=8,width=\measure{eightpages}]} {#1 / 8}
        \stopcombination
    \stoplinecorrection
\stoptexdefinition

\starttexdefinition unexpanded EightSpread #1
    \startlinecorrection[blank]
        \startcombination[fourpages][4*2]
            {\typesetfile[#1.tex][page=2,width=\measure{eightpages}]} {#1 / 2}
            {\typesetfile[#1.tex][page=3,width=\measure{eightpages}]} {#1 / 3}
            {\typesetfile[#1.tex][page=4,width=\measure{eightpages}]} {#1 / 4}
            {\typesetfile[#1.tex][page=5,width=\measure{eightpages}]} {#1 / 5}
            {\typesetfile[#1.tex][page=6,width=\measure{eightpages}]} {#1 / 6}
            {\typesetfile[#1.tex][page=7,width=\measure{eightpages}]} {#1 / 7}
            {\typesetfile[#1.tex][page=8,width=\measure{eightpages}]} {#1 / 8}
            {\typesetfile[#1.tex][page=9,width=\measure{eightpages}]} {#1 / 9}
        \stopcombination
    \stoplinecorrection
\stoptexdefinition

\stopmodule