diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/publ-ini.mkiv')
-rw-r--r-- | Master/texmf-dist/tex/context/base/publ-ini.mkiv | 86 |
1 files changed, 77 insertions, 9 deletions
diff --git a/Master/texmf-dist/tex/context/base/publ-ini.mkiv b/Master/texmf-dist/tex/context/base/publ-ini.mkiv index 7270b5f4d18..6d57a233d02 100644 --- a/Master/texmf-dist/tex/context/base/publ-ini.mkiv +++ b/Master/texmf-dist/tex/context/base/publ-ini.mkiv @@ -14,6 +14,8 @@ % TODO: s! vs v! for default and neutral key/values % todo: too many refs in list +% todo: no need for all these %'s + % todo: tagging % todo: we cannot use 'default' as this wipes metadata names (maybe no longer do that) % todo: \v!cite => \s!cite @@ -71,6 +73,7 @@ \def\s!btxbtx {btxbtx} \def\s!btxspc {btxspc} \def\s!btxlst {btxlst} +\def\s!btxcom {btxcom} \definelabelclass[btxlabel][2] @@ -147,11 +150,41 @@ \installswitchcommandhandler \??btx {btx} \??btx +% because we have lots of setups we provide a checker for sloppy users + +\unexpanded\def\btx_check_chain#1#2#3% + {\doifelsesomething{#3} + {\writestatus{btx #1}{defining\space"#2"\space as\space descendant\space of\space"#3"}% we're in definition regime (no space) + \definebtx[#2][#3]} + {\writestatus{btx #1}{defining\space"#2"}% + \definebtx[#2]}} + +% \unexpanded\def\btxcheckdefine#1#2{\doifelsecommandhandler\??btx{#1}\donothing{\btx_check_chain{define}{#1}{#2}}} +% \unexpanded\def\btxchecksetup #1#2{\doifelsecommandhandler\??btx{#1}\donothing{\btx_check_chain {setup}{#1}{#2}}} + +\unexpanded\def\btxcheckdefine#1{\doifelsecommandhandler\??btx{#1}\gobbleoneargument{\btx_check_chain{define}{#1}}} % {#2} +\unexpanded\def\btxchecksetup #1{\doifelsecommandhandler\??btx{#1}\gobbleoneargument{\btx_check_chain {setup}{#1}}} % {#2} + +% fpr the moment experimental: + +\unexpanded\def\btxenableautodefine + {\prependtoks + \clf_checkinterfacechain{\currentbtx}{btxcheckdefine}% + \to \everydefinebtx + \prependtoks + \ifnum\btxsetupmode=\doingrootsetupnamed + \clf_checkinterfacechain{\currentbtx}{btxchecksetup}% + \fi + \to \everysetupbtx + \let\btxenableautodefine\relax} + \appendtoks \ifnum\btxsetupmode=\doingrootsetuproot \publ_specification_set{\btxparameter\c!specification}% \else\ifnum\btxsetupmode=\doingrootsetupnamed - \publ_specification_set{\btxparameter\c!specification}% + \doifelsecommandhandler\??btx\currentbtx + {\publ_specification_set{\btxparameter\c!specification}}% + {}% maybe a warning \fi\fi \to \everysetupbtx @@ -590,7 +623,7 @@ \begingroup \setbtxlist % probably already set \btx_reset_page - \setbtxparameterset\s!page\s!list + \setbtxparameterset\s!list\s!page \btxparameter\c!pagecommand {\usebtxstyleandcolor\c!style\c!color \btxparameter\c!pageleft @@ -633,12 +666,15 @@ \publ_fast_setup\plusfour\s!list\currentbtxcategory \removeunwantedspaces \endgroup - \ifconditional\c_btx_list_pages - \btx_entry_inject_pages - \fi \ifx\currentbtxcombis\empty \else \btxrenderingparameter\c!separator - \processcommacommand[\currentbtxcombis]\btx_entry_inject_combi + % maybe move this loop to lua + \begingroup + \processcommacommand[\currentbtxcombis]\btx_entry_inject_combi + \endgroup + \fi + \ifconditional\c_btx_list_pages + \btx_entry_inject_pages \fi \ifconditional\c_btx_list_texts \currentbtxafter @@ -657,6 +693,15 @@ \ctxcommand{showbtxentry("\currentbtxdataset","\currentbtxtag")} \fi\fi} +\unexpanded\def\btxstartcombientry + {\begingroup} + +\unexpanded\def\btxstopcombientry + {\endgroup} + +\unexpanded\def\btxhandlecombientry + {\btx_reference_indeed} + \def\btx_entry_inject_combi#1% {\begingroup \def\currentbtxtag{#1}% @@ -665,6 +710,18 @@ \removeunwantedspaces \endgroup} +% uses reference when set + +% \def\btx_entry_inject_combi#1% +% {\begingroup +% \def\currentbtxtag{#1}% +% \ignorespaces +% \btxdoifelsecombiinlist\currentbtxdataset\currentbtxtag +% {\clf_btxflushlistcombi{\currentbtxdataset}{\currentbtxtag}} +% {\publ_fast_setup\plusfour\s!list\currentbtxcategory}% +% \removeunwantedspaces +% \endgroup} + \unexpanded\def\completebtxrendering{\dodoubleempty\publ_place_list_complete} \unexpanded\def\placebtxrendering {\dodoubleempty\publ_place_list_standard} @@ -709,8 +766,12 @@ \unexpanded\def\btxdoifelsesameasprevious {\btxdoifelsesameaspreviouschecked\v!doublesided} +\unexpanded\def\btxdoifelsecombiinlist#1#2% + {\clf_btxdoifelsecombiinlist{#1}{#2}} + \let\btxdoifsameaspreviouscheckedelse\btxdoifelsesameaspreviouschecked \let\btxdoifsameaspreviouselse \btxdoifelsesameasprevious +\let\btxdoifcombiinlistelse \btxdoifelsecombiinlist \def\publ_place_list_indeed#1[#2][#3]% {\begingroup @@ -920,6 +981,7 @@ \s!btxref=\currentbtxtag,% \s!btxspc=\currentbtxspecification,% \s!btxlst=\number\c_btx_list_reference,% check if needed + %\ifx\currentbtxcombis\empty\else\s!btxcom={\currentbtxcombis},\fi% \ifx\currentbtxbefore\empty\else\s!btxbtx={\currentbtxbefore},\fi% \ifx\currentbtxafter \empty\else\s!btxatx={\currentbtxafter },\fi% \ifx\currentbtxbacklink\currentbtxbacktrace\s!btxint=\currentbtxbacklink\else\s!btxbck=\currentbtxbacktrace\fi}% @@ -952,6 +1014,7 @@ [\c!type=\s!btx]% \c!location=\v!none [\ifx\currentbtxdataset\v!default\else\s!btxset=\currentbtxdataset,\fi% \s!btxref=\currentbtxtag,% + %\ifx\currentbtxcombis\empty\else\s!btxcom={\currentbtxcombis},\fi% \ifx\currentbtxbefore\empty\else\s!btxbtx={\currentbtxbefore},\fi% \ifx\currentbtxafter \empty\else\s!btxatx={\currentbtxafter },\fi% \s!btxint=\number\currentbtxbacklink @@ -968,8 +1031,11 @@ \appendtoks \edef\currentbtxnumbering{\btxrenderingparameter\c!numbering}% - \edef\p_numbering{\btxrenderingparameter\c!numbering}% link to headnumber - \ifx\p_numbering\v!no + \ifx\currentbtxnumbering\v!yes + \def\currentbtxnumbering{num}% convenient alias + \letbtxrenderingparameter\c!numbering\currentbtxnumbering + \letlistparameter\c!headnumber\v!always + \else\ifx\currentbtxnumbering\v!no \letlistparameter\c!headnumber\v!no \let\currentbtxnumbering\empty % \letlistparameter\c!textcommand\outdented % needed? we can use titlealign @@ -978,7 +1044,7 @@ \letlistparameter\c!numbercommand\firstofoneargument % for the moment, no doubling needed \else \letlistparameter\c!headnumber\v!always - \fi + \fi\fi \let\currentlistmethod\s!btx \to \everysetupbtxlistplacement @@ -1015,6 +1081,7 @@ kind {list}% etallimit {\btxparameter\c!etallimit}% etaldisplay {\btxparameter\c!etaldisplay}% + etaloption {\btxparameter\c!etaloption}% symbol {\btxparameter{\c!stopper:initials}}% }% \relax @@ -1040,6 +1107,7 @@ kind {cite}% etallimit {\btxparameter\c!etallimit}% etaldisplay {\btxparameter\c!etaldisplay}% + etaloption {\btxparameter\c!etaloption}% symbol {\btxparameter{\c!stopper:initials}}% }% \relax |