publ-inc.mkxl /size: 1723 b    last modification: 2021-10-28 13:51
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     \dostarttagged\t!ignore\empty
38       \btx_add_blob{btxattachment}\attachment
39     \dostoptagged
40   \fi\fi}
41
42\permanent\protected\def\btxcomment
43  {\iftrialtypesetting\orelse\ifexporting\iflocation
44     \dostarttagged\t!ignore\empty
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     \dostarttagged\t!ignore\empty
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\protect \endinput
64