publ-inc.mkxl /size: 3339 b    last modification: 2025-02-21 11:03
1%D \module
2%D   [       file=publ-inc,
3%D        version=2018.06.23,
4%D          title=\CONTEXT\ Publication Macros,
5%D       subtitle=XML inclusion,
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\writestatus{loading}{ConTeXt Publication Macros / XML inclusion}
15
16\registerctxluafile{publ-inc}{}
17
18%D A teaser for Alan.
19
20\unprotect
21
22\definesymbol[btxattachment][{\infofont\darkred  btx}]
23\definesymbol[btxcomment]   [{\infofont\darkblue btx}]
24
25\protected\def\btx_add_blob#1#2%
26  {\relax
27     \clf_btxentrytobuffer{\currentbtxdataset}{\currentbtxtag}{temp-btx-export}%
28     #2%
29       [\c!symbol=#1,%
30        \c!space=\v!yes,
31        \c!buffer=temp-btx-export,%
32        \c!name={\currentbtxtag.bib}]%
33   \relax}
34
35\permanent\protected\def\btxattach
36  {\iftrialtypesetting\orelse\ifexporting\iflocation
37     \dostarttaggednodetail\t!ignore
38       \btx_add_blob{btxattachment}\attachment
39     \dostoptagged
40   \fi\fi}
41
42\permanent\protected\def\btxcomment
43  {\iftrialtypesetting\orelse\ifexporting\iflocation
44     \dostarttaggednodetail\t!ignore
45       \btx_add_blob{btxcomment}\comment
46     \dostoptagged
47   \fi\fi}
48
49%D This kind of feature creep is not yet configurable, nor documented.
50
51\permanent\protected\def\btxaddsource
52  {\iftrialtypesetting\orelse\ifexporting\iflocation
53     \dostarttaggednodetail\t!ignore
54     \llap{%
55       \btx_add_blob{btxattachment}\attachment
56       \quad
57       \btx_add_blob{btxcomment}\comment
58       \hskip\leftmargindistance
59     }%
60     \dostoptagged
61   \fi\fi}
62
63%D Analogue to what we do with math:
64
65\definenote    [publicationnote] % [location=none]
66\setupnotation [publicationnote] [\c!style=\tt]
67
68\protected\def\publ_cite_set_meaning#1%
69  {\setbox\b_btx_cmd\vbox\bgroup
70     \forgetall
71     \nohyphens
72     \let\currentlist\s!btx
73     \setuplist
74       [\s!btx]
75       [\c!before=,%
76        \c!after=]%
77     \setupbtx
78       [\c!specification=\v!default]%
79     \setupbtxrendering
80       [\v!default]%
81       [\c!numbering=\v!no]%
82     \setupinteraction
83       [\c!state=\v!stop]%
84 \let\btx_list_reference_inject_now\relax
85     \btxstartlistentry
86   % \btxsetcurrentlistentry{0}
87   % \btxsetcurrentlistindex{0}
88   % \btxsetcategory{\s!unknown}%
89     \btxsettag{#1}%
90     \btxsetnumber{0}%
91   % \btxsetlanguage{\currentlanguage}%
92     \btxhandlelistentry
93     \btxstoplistentry
94   \egroup}
95
96\protected\def\publ_cite_trace_blob_indeed
97  {\dontleavehmode
98   \hbox to \zeropoint \bgroup
99      \resetinteractioncontrastcolor
100      \resetinteractionstyle
101      \bgroup
102        \darkgray
103        \vrule \s!height .9\strutht \s!depth .9\strutdp \s!width \onepoint \relax
104        \hbox to \zeropoint \bgroup
105          \smallinfofont
106        % \the\currentmathblob\hss
107          \hbox to \zeropoint \s!yoffset -.6\strutdp \bgroup
108            \currentbtxreference
109            \hss
110          \egroup
111        \egroup
112      \egroup
113      \normalexpanded{\btxentrytostring{publicationnote}{note}{\currentbtxreference}}%
114      \hss
115   \egroup}
116
117\installtextracker
118  {publications.textblobs}
119  {\let\publ_cite_trace_blob\publ_cite_trace_blob_indeed}
120  {\let\publ_cite_trace_blob\relax}
121
122\protect \endinput
123