summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/x-fe.tex
blob: 8562b1d52961be5078216d019633a40a2123a56a (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
%D \module
%D   [      file=x-fe,
%D        version=2004.03.12, % based on earlier experiments
%D          title=\FOXET,
%D       subtitle=Simple Extensions,
%D         author=Hans Hagen,
%D           date=\currentdate,
%D      copyright={PRAGMA ADE / Hans Hagen \& Ton Otten}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

%D Extensions: fe:definecolor

% menus
% extra areas
% protruding and hz
% compound
% title container
% more float placements

\unprotect

% \XMLattributes{aural},

\defineXMLnested
  [fe:table-next]
  [id=,
   \XMLattributes{accessibility},
   \XMLattributes{border-padding-background},
   \XMLattributes{relative-position},
   border-after-precedence=,
   border-before-precedence=,
   border-end-precedence=,
   border-start-precedence=,
   visibility=]
  {\bTABLEnext}
  {\eTABLEnext}

% definitions

\defineXMLcommand
  [fe:definecolor]
  [name=,r=,g=,b=,c=,m=,y=,k=,s=,p=,a=,t=]
  {\expanded{\definecolor[\XMLop{name}]
     [r=\XMLop r,g=\XMLop g,b=\XMLop b,
      c=\XMLop c,m=\XMLop m,y=\XMLop y,k=\XMLop k,
      s=\XMLop s,p=\XMLop p,a=\XMLop a,t=\XMLop t]}}

\defineXMLcommand
  [fe:definefontsynonym]
  [name=,file=,encoding=]
  {\doifelsenothing{\XMLop{encoding}}
     {\expanded{\definefontsynonym[\XMLop{name}][\XMLop{file}][encoding=\XMLop{encoding}]}}
     {\expanded{\definefontsynonym[\XMLop{name}][\XMLop{file}]}}}

%D Extensions: fe:include

\defineXMLsingular
  [fe:include]
  [url=,n=1]
  {\doifelse{\XMLop{n}}{1}
     {\readfile{\XMLpar{fe:include}{url}{}}{}{}}
     {\dorecurse{\XMLop{n}}{\readfile{\XMLpar{fe:include}{url}{}}{}{}\endgraf}}}

%D Extensions: fe:sample

\defineXMLenvironment
  [fe:sample]
  [origin=unknown]
  {\removeunwantedspaces\ignorespaces}
  {\removeunwantedspaces}

%D Extensions: fe:

% \defineXMLenvironmentsave
%   [fe:loop]
%   [n=1]
%   {}
%   {\dorecurse{\XMLop{n}}{\XMLflush{fe:loop}}}

\defineXMLargument
  [fe:loop]
  [n=1]
  {\dorecurse{\XMLop{n}}}

%D Extensions: fe:compound

\defineXMLsingular
  [fe:compound]
  [character=-]
  {\prewordbreak\XMLop{character}\prewordbreak}

%D Extensions: fe:message

\defineXMLargument
  [fe:message]
  [category=XML-FO]
  {\expanded{\writestatus{\XMLop{category}}}}

%D Handy

\defineXMLargument
  [fe:trace]
  [attribute=,option=]
  {\showXMLinh[\XMLop{attribute}]%
   \XMLval{fe:trace}{\XMLop{option}}{}}

\mapXMLvalue
  {fe:trace}
  {font}
  {\hbox\bgroup\infofont[%
   \xFOfont/\xFOfontsize/\xFOfontsizeadjust/\xFOfontfamily/\xFOfontweight/\xFOfontstyle/\xFOfontvariant:\FOfontdefinition
   ]\egroup}

%D Extensions:

\startsetups fe:page:option:fit:start
  \startTEXpage[margin=page]
\stopsetups

\startsetups fe:page:option:fit:stop
  \stopTEXpage
\stopsetups

\useMPlibrary[pre]

\mapXMLvalue {fe:tracing}  {true}  {\tracingFOtrue}
\mapXMLvalue {fe:tracing}  {false} {\tracingFOfalse}
\mapXMLvalue {fe:testgrid} {true}  {\setupbackgrounds[page][background=pagegrid]}

\startsetups fe:setup
  \XMLval{fe:tracing} {\XMLop{fe:tracing}} {}
  \XMLval{fe:testgrid}{\XMLop{fe:testgrid}}{}
\stopsetups

%D Private (testing)

\defineXMLcommand[fe:synchronizeoutput]{\synchronizeoutput}


\protect \endinput