summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/mkxl/publ-inc.mkxl
blob: 9beae595fa2e42319afbf8af85bac93e589c05e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
%D \module
%D   [       file=publ-inc,
%D        version=2018.06.23,
%D          title=\CONTEXT\ Publication Macros,
%D       subtitle=XML inclusion,
%D         author=Hans Hagen,
%D           date=\currentdate,
%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

\writestatus{loading}{ConTeXt Publication Macros / XML inclusion}

\registerctxluafile{publ-inc}{}

%D A teaser for Alan.

\unprotect

\definesymbol[btxattachment][{\infofont\darkred  btx}]
\definesymbol[btxcomment]   [{\infofont\darkblue btx}]

\protected\def\btx_add_blob#1#2%
  {\relax
     \clf_btxentrytobuffer{\currentbtxdataset}{\currentbtxtag}{temp-btx-export}%
     #2%
       [\c!symbol=#1,%
        \c!space=\v!yes,
        \c!buffer=temp-btx-export,%
        \c!name={\currentbtxtag.bib}]%
   \relax}

\permanent\protected\def\btxattach
  {\iftrialtypesetting\orelse\ifexporting\iflocation
     \dostarttagged\t!ignore\empty
       \btx_add_blob{btxattachment}\attachment
     \dostoptagged
   \fi\fi}

\permanent\protected\def\btxcomment
  {\iftrialtypesetting\orelse\ifexporting\iflocation
     \dostarttagged\t!ignore\empty
       \btx_add_blob{btxcomment}\comment
     \dostoptagged
   \fi\fi}

%D This kind of feature creep is not yet configurable, nor documented.

\permanent\protected\def\btxaddsource
  {\iftrialtypesetting\orelse\ifexporting\iflocation
     \dostarttagged\t!ignore\empty
     \llap{%
       \btx_add_blob{btxattachment}\attachment
       \quad
       \btx_add_blob{btxcomment}\comment
       \hskip\leftmargindistance
     }%
     \dostoptagged
   \fi\fi}

\protect \endinput