publ-imp-definitions.mkvi /size: 3491 b    last modification: 2023-12-21 09:44
1%D \module
2%D   [       file=publ-imp-def,
3%D        version=2013.12.24,
4%D          title=\CONTEXT\ Publication Support,
5%D       subtitle=Definitions,
6%D         author=Hans Hagen,
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%D Here we collect some helper setups. We assume that checking of a field
15%D happens in the calling setup, if only because that is the place where
16%D fences are also dealt with.
17
18% These will become texdefinitions
19
20\unprotect
21
22\startxmlsetups btx:format:crossref
23    \cite[\btxfield{crossref}]
24\stopxmlsetups
25
26\startxmlsetups btx:format:key
27    \btxfield{short}
28\stopxmlsetups
29
30\starttexdefinition mutable protected btx:format:gotointernal #content
31    \ifx\currentbtxinternal\empty
32        #content
33    \else\ifnum\currentbtxinternal=\zerocount
34        #content
35    \else\ifconditional\btxinteractive
36        \goto
37            {#content}
38            [\s!internal(\currentbtxinternal)]
39    \else
40        #content
41    \fi\fi\fi
42\stoptexdefinition
43
44\starttexdefinition mutable protected btx:format:goto #link #content
45    \ifconditional\btxinteractive
46        \goto {#content} [#link]
47    \else
48        #content
49    \fi
50\stoptexdefinition
51
52\startxmlsetups btx:format:doi
53    \edef\currentbtxfielddoi{\btxfield{doi}}
54    \ifx\currentbtxfielddoi\empty
55        {\tttf no-doi}
56    \else
57        \texdefinition {btx:format:goto} {
58            url(http://dx.doi.org/\currentbtxfielddoi)
59        } {
60            \hyphenatedurl{\currentbtxfielddoi}
61        }
62    \fi
63\stopxmlsetups
64
65\startxmlsetups btx:format:url
66    \edef\currentbtxfieldurl{\btxfield{url}}
67    \ifx\currentbtxfieldurl\empty
68        {\tttf no-url}
69    \else
70        \texdefinition {btx:format:goto} {
71            url(\currentbtxfieldurl)
72        } {
73            \hyphenatedurl{\currentbtxfieldurl}
74        }
75    \fi
76\stopxmlsetups
77
78\startxmlsetups btx:format:year
79    \edef\currentbtxfieldyear{\btxfield{year}}
80    \ifx\currentbtxfieldyear\empty
81        \btxlabeltext{\currentbtxspecification:nd}
82    \fi
83\stopxmlsetups
84
85\startxmlsetups btx:format:month
86    \edef\currentbtxfieldmonth{\btxfield{month}}
87    \ifx\currentbtxfieldmonth\empty
88        {\tttf no-month}
89    \else
90        \edef\p_monthconversion{\btxparameter\c!monthconversion}
91        \ifx\p_monthconversion\empty % month month:mnem
92            \currentbtxfieldmonth
93        \else
94            \doifelsenumber \currentbtxfieldmonth {
95                \convertnumber\p_monthconversion\currentbtxfieldmonth
96            } {
97                \currentbtxfieldmonth
98            }
99        \fi
100    \fi
101\stopxmlsetups
102
103% macros:
104
105\starttexdefinition mutable protected btx:style:italic #content
106    \dontleavehmode
107    \begingroup
108        \it
109        #content
110        \italiccorrection
111    \endgroup
112\stoptexdefinition
113
114\starttexdefinition mutable protected btx:style:bold #content
115    \dontleavehmode
116    \begingroup
117        \bf
118        #content
119    \endgroup
120\stoptexdefinition
121
122\starttexdefinition mutable protected btx:style:quote #content
123    \dontleavehmode
124    \startquote
125        #content
126    \stopquote
127\stoptexdefinition
128
129\starttexdefinition mutable protected btx:style #style #content
130    \doifelsedefined {btx:style:#style} {
131        \texdefinition{btx:style:#style} {
132            #content
133        }
134    } {
135        #content
136    }
137\stoptexdefinition
138
139\protect
140