summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/x-res-11.tex
blob: b8569d22e6f897fa4127481bc6a9f7021e5bd7d0 (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
%D \module
%D   [      file=x-fig-11,
%D        version=2003.02.08,
%D          title=\CONTEXT\ Style File,
%D       subtitle=Resource Reporting (3),
%D         author=Hans Hagen,
%D           date=\currentdate,
%D      copyright={PRAGMA / 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. 

\usemodule[res-00]

\defineXMLenvironment [rl:library] 
  {\starttext 
   \doiffileelse{\outputfilename.zip}{\setups[rl:attach]}{}
   \disablemode[rl:used]}
  {\doifnotmode{rl:used}{No images processed.}
   \page
   \stoptext}

\defineXMLenvironment [rl:usage] 
  {\bgroup} 
  {\doifnot{\XMLflush{rl:file}}{dummy}
     {\setups[rl:usage]
      \enablemode[rl:used]}
   \egroup}

\defineXMLsave [rl:base]    % base
\defineXMLsave [rl:type]    % figure
\defineXMLsave [rl:state]   % found|missing
\defineXMLsave [rl:label]   % label
\defineXMLsave [rl:file]    % filename
\defineXMLsave [rl:suffix]  % filesuffix
\defineXMLsave [rl:comment] % text 
\defineXMLsave [rl:width]   % width in pt
\defineXMLsave [rl:height]  % height in pt
\defineXMLsave [rl:page]    % page from file 

\def\XMLbpentry#1%
  {\PointsToWholeBigPoints{\XMLflush{#1}}\temp\temp bp}

\def\XMLrlentry#1#2#3%
  {\tableiftextelse{\XMLflush{#2}}
     {\NC\bf#1\NC\XMLflush{#2}\doif{#3}{1}{ (\XMLbpentry{#2})}\NC\NR}{}}

\unprotect 

\setuplayout[\v!middle]

\startsetups[rl:figure]

  \externalfigure[\XMLflush{rl:file}][\c!width=4cm]
 
\stopsetups

\startsetups[rl:table]

% by using a dedicated tabulation, we permit usage in dutch interface

\definetabulate[XMLRLG][|lw(4.5em)|p|]

\startXMLRLG
  \XMLrlentry {base}   {rl:base}   {0}
  \XMLrlentry {type}   {rl:type}   {0}
  \XMLrlentry {state}  {rl:state}  {0}
  \XMLrlentry {file}   {rl:file}   {0}
  \XMLrlentry {label}  {rl:label}  {0}
  \XMLrlentry {suffix} {rl:suffix} {0}
  \XMLrlentry {page}   {rl:page}   {0}
  \XMLrlentry {width}  {rl:width}  {1}
  \XMLrlentry {height} {rl:height} {1}
  \XMLrlentry {comment}{rl:comment}{0}
\stopXMLRLG

\stopsetups 

\startsetups[rl:usage]

  \startfiguretext {\v!none} {\setups[rl:figure]}
    \setups[rl:table]
  \stopfiguretext 

\stopsetups 

\startsetups[rl:attach]

  \useMPlibrary[nav]

  \setupcolors[\c!state=\v!start]

  \setupinteraction[\c!state=\v!start]

  \useattachment[whatever][\outputfilename.zip]

  \startlocalsetups[rl:attach:button]

    \inframed
      [\c!offset=\v!overlay,\c!frame=\v!off]
      {\attachment[whatever]}

  \stoplocalsetups
 
  \setupfootertexts[archive with dummies: \setups{rl:attach:button}] 

\stopsetups

\protect \endinput