publ-imp-definitions.mkvi /size: 3209 b    last modification: 2021-10-28 13:50
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:inject #link #content
31    \ifx\currentbtxinternal\empty
32        #content
33    \else\ifconditional\btxinteractive
34        \goto {#content} [#link]
35    \else
36        #content
37    \fi\fi
38\stoptexdefinition
39
40\startxmlsetups btx:format:doi
41    \edef\currentbtxfielddoi{\btxfield{doi}}
42    \ifx\currentbtxfielddoi\empty
43        {\tttf no-doi}
44    \else\ifconditional\btxinteractive
45        \goto{\hyphenatedurl{\currentbtxfielddoi}}[url(http://dx.doi.org/\currentbtxfielddoi)]
46    \else
47        \hyphenatedurl{\currentbtxfielddoi}
48    \fi\fi
49\stopxmlsetups
50
51\startxmlsetups btx:format:url
52    \edef\currentbtxfieldurl{\btxfield{url}}
53    \ifx\currentbtxfieldurl\empty
54        {\tttf no-url}
55    \else\ifconditional\btxinteractive
56        \goto{\hyphenatedurl{\currentbtxfieldurl}}[url(\currentbtxfieldurl)]
57    \else
58        \hyphenatedurl{\currentbtxfieldurl}
59    \fi\fi
60\stopxmlsetups
61
62\startxmlsetups btx:format:year
63    \edef\currentbtxfieldyear{\btxfield{year}}
64    \ifx\currentbtxfieldyear\empty
65        \btxlabeltext{\currentbtxspecification:nd}
66    \fi
67\stopxmlsetups
68
69\startxmlsetups btx:format:month
70    \edef\currentbtxfieldmonth{\btxfield{month}}
71    \ifx\currentbtxfieldmonth\empty
72        {\tttf no-month}
73    \else
74        \edef\p_monthconversion{\btxparameter\c!monthconversion}
75        \ifx\p_monthconversion\empty % month month:mnem
76            \currentbtxfieldmonth
77        \else
78            \doifelsenumber \currentbtxfieldmonth {
79                \convertnumber\p_monthconversion\currentbtxfieldmonth
80            } {
81                \currentbtxfieldmonth
82            }
83        \fi
84    \fi
85\stopxmlsetups
86
87% macros:
88
89\starttexdefinition mutable protected btx:style:italic #content
90    \dontleavehmode
91    \begingroup
92        \it
93        #content
94        \italiccorrection
95    \endgroup
96\stoptexdefinition
97
98\starttexdefinition mutable protected btx:style:bold #content
99    \dontleavehmode
100    \begingroup
101        \bf
102        #content
103    \endgroup
104\stoptexdefinition
105
106\starttexdefinition mutable protected btx:style:quote #content
107    \dontleavehmode
108    \startquote
109        #content
110    \stopquote
111\stoptexdefinition
112
113\starttexdefinition mutable protected btx:style #style #content
114    \doifelsedefined {btx:style:#style} {
115        \texdefinition{btx:style:#style} {
116            #content
117        }
118    } {
119        #content
120    }
121\stoptexdefinition
122
123\protect
124