publ-inc.mkiv /size: 1715 b    last modification: 2020-07-01 14:35
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\unexpanded\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\unexpanded\def\btxattach
36  {\iftrialtypesetting \else \ifexporting \iflocation
37     \dostarttagged\t!ignore\empty
38       \btx_add_blob{btxattachment}\attachment
39     \dostoptagged
40   \fi \fi \fi}
41
42\unexpanded\def\btxcomment
43  {\iftrialtypesetting \else \ifexporting \iflocation
44     \dostarttagged\t!ignore\empty
45       \btx_add_blob{btxcomment}\comment
46     \dostoptagged
47   \fi \fi \fi}
48
49%D This kind of feature creep is not yet configurable, nor documented.
50
51\unexpanded\def\btxaddsource
52  {\iftrialtypesetting \else \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 \fi}
62
63\protect \endinput
64