summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/publ-ini.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mkiv/publ-ini.mkiv')
-rw-r--r--tex/context/base/mkiv/publ-ini.mkiv75
1 files changed, 60 insertions, 15 deletions
diff --git a/tex/context/base/mkiv/publ-ini.mkiv b/tex/context/base/mkiv/publ-ini.mkiv
index 9f970547d..ead46929d 100644
--- a/tex/context/base/mkiv/publ-ini.mkiv
+++ b/tex/context/base/mkiv/publ-ini.mkiv
@@ -107,23 +107,27 @@
%D to split between cite and list here as it only complicates matters (timing) and is
%D not clear either.
-\let\currentbtxspecification\empty
+\let\currentbtxspecification \empty
+\let\currentbtxspecificationfallback\empty
+
+\installmacrostack\currentbtxspecification
+\installmacrostack\currentbtxspecificationfallback
\unexpanded\def\startbtxrenderingdefinitions[#1]%
{\unprotect
- \pushmacro\currentbtxspecification
+ \push_macro_currentbtxspecification
\edef\currentbtxspecification{#1}}
\unexpanded\def\stopbtxrenderingdefinitions
- {\popmacro\currentbtxspecification
+ {\pop_macro_currentbtxspecification
\protect}
\unexpanded\def\loadbtxdefinitionfile [#1]{\clf_btxloaddefinitionfile {#1}}
\unexpanded\def\loadbtxreplacementfile[#1]{\clf_btxloadreplacementfile{#1}}
\unexpanded\def\publ_specification_push#1%
- {\pushmacro\currentbtxspecification
- \pushmacro\currentbtxspecificationfallback
+ {\push_macro_currentbtxspecification
+ \push_macro_currentbtxspecificationfallback
\edef\currentbtxspecification{#1}%
\edef\currentbtxspecificationfallback{\namedbtxparameter\currentbtxspecification\c!default}%
\ifx\currentbtxspecificationfallback\currentbtxspecification
@@ -132,8 +136,8 @@
\clf_btxsetspecification{\currentbtxspecification}}
\unexpanded\def\publ_specification_pop
- {\popmacro\currentbtxspecificationfallback
- \popmacro\currentbtxspecification
+ {\pop_macro_currentbtxspecificationfallback
+ \pop_macro_currentbtxspecification
\clf_btxsetspecification{\currentbtxspecification}}
\unexpanded\def\publ_specification_set#1% beware: is global
@@ -223,9 +227,6 @@
\installcommandhandler \??btxregister {btxregister} \??btxregister
\installcommandhandler \??btxrendering {btxrendering} \??btxrendering
-\let\currentbtxcitealternative \empty
-\let\currentbtxspecificationfallback\empty
-
\unexpanded\def\setbtxparameterset#1#2%
{\edef\currentbtx
{\ifcsname\??btx\currentbtxspecification:#1:#2:\s!parent\endcsname
@@ -333,6 +334,11 @@
\expandafter\publ_command_nop
\fi{#1}}
+\newtoks\t_btx_cmd
+\newbox \b_btx_cmd
+
+\t_btx_cmd{\global\setbox\b_btx_cmd\hpack{\clf_btxcmdstring}}
+
\let\btxcmd\btxcommand
\def\publ_command_yes#1%
@@ -341,10 +347,10 @@
\def\publ_command_nop#1%
{\ifcsname#1\endcsname
\showmessage\m!publications{10}{#1,#1}%
- \global\expandafter\let\csname\??btxcommand#1\expandafter\endcsname\csname#1\endcsname
+ \expandafter\glet\csname\??btxcommand#1\expandafter\endcsname\csname#1\endcsname
\else\ifcsname\utfupper{#1}\endcsname
\showmessage\m!publications{10}{#1}{\utfupper{#1}}%
- \global\expandafter\let\csname\??btxcommand#1\expandafter\endcsname\csname\utfupper{#1}\endcsname
+ \expandafter\glet\csname\??btxcommand#1\expandafter\endcsname\csname\utfupper{#1}\endcsname
\else
\showmessage\m!publications{11}{#1}%
\setugvalue{\??btxcommand#1}{\underbar{\tttf#1}}%
@@ -385,6 +391,12 @@
\let\btxsetup\fastsetup
+\def\btxfield #1{\dostarttagged\t!pubfld{#1}\clf_btxfield {\currentbtxdataset}{\currentbtxtag}{#1}\dostoptagged}
+\def\btxdetail #1{\dostarttagged\t!pubfld{#1}\clf_btxdetail{\currentbtxdataset}{\currentbtxtag}{#1}\dostoptagged}
+\def\btxflush #1{\dostarttagged\t!pubfld{#1}\clf_btxflush {\currentbtxdataset}{\currentbtxtag}{#1}\dostoptagged}
+\def\btxdirect #1{\dostarttagged\t!pubfld{#1}\clf_btxdirect{\currentbtxdataset}{\currentbtxtag}{#1}\dostoptagged}
+%def\btxauthorfield#1{\dostarttagged\t!pubfld{#1}\clf_btxauthorfield \currentbtxauthorindex{#1}\dostoptagged}
+
%D How complex will we go? Can we assume that e.g. an apa style will not be mixed
%D with another one? I think this assumption is okay. For manuals we might want to
%D mix but we can work around it.
@@ -629,11 +641,13 @@
\unexpanded\def\btxnumberingsetup#1%
{\begingroup
+ \dostarttagged\t!listtag\empty
\setbtxparameterset{\c!list:\s!numbering}\currentbtxnumbering % brrrr \setbtxlist
\btxparameter\c!left
% \btxparameter\c!command{\publ_fast_setup\plusthree{\s!list:\s!numbering}{#1}}%
\publ_fast_setup\plusthree{\s!list:\s!numbering}{#1}%
\btxparameter\c!right
+ \dostoptagged
\endgroup
\btx_reset_numbering} % probably not needed
@@ -655,21 +669,34 @@
\def\btx_entry_inject_list_text
{\publ_fast_setup\plusfour\s!list\s!text}
+\ifdefined\dotagpublication \else \let\dotagpublication \gobbletwoarguments \fi
+
\unexpanded\def\btx_entry_inject
{\begingroup
+ \dostarttagged\t!publication\empty
+ \dotagpublication\currentbtxdataset\currentbtxtag
\redoconvertfont % see (**) in strc-lst, this will become an configuration option
\edef\currentbtxcategory{\btxfield{category}}%
\ignorespaces
\ifconditional\c_btx_list_texts
+ \dostarttagged\t!listtext\s!left
\currentbtxbefore
+ \dostoptagged
\fi
+ %\dostarttagged\t!listcontent\empty
\btx_entry_inject_list_text
+ %\dostoptagged
\ifconditional\c_btx_list_pages
+ \dostarttagged\t!listpage\empty
\btx_entry_inject_pages
+ \dostoptagged
\fi
\ifconditional\c_btx_list_texts
+ \dostarttagged\t!listtext\s!right
\currentbtxafter
+ \dostoptagged
\fi
+ \dostoptagged
\endgroup}
\unexpanded\def\btxshowentryinline
@@ -843,6 +870,8 @@
\expandafter\p_command\expandafter{\number\nofbtxlistentries}\relax
\fi
\else
+ \dostarttagged\t!publications\currentbtxrendering
+ \dostarttagged\t!list{btx}%
\startpacked[\v!blank]%
% sorting and so
\clf_btxpreparelistentries{\currentbtxdataset}% could be put in collect
@@ -865,6 +894,8 @@
{\let\currentbtxlistentry\recurselevel
\clf_btxflushlistentry{\currentbtxdataset}\currentbtxlistentry\relax}%
\stoppacked
+ \dostoptagged
+ \dostoptagged
\fi
\btxrenderingparameter\c!after
\fi
@@ -978,8 +1009,10 @@
\strc_lists_apply_renderingsetup}
\def\btx_entry_indeed
- {\btx_list_reference_inject
- \btx_entry_inject}
+ {\dostarttagged\t!listcontent\empty
+ \btx_list_reference_inject
+ \btx_entry_inject
+ \dostoptagged}
\def\btx_page_indeed
{}
@@ -1113,7 +1146,8 @@
\let\btxcitereference\btx_cite_reference_inject
-\let\currentbtxnumbering\empty
+\let\currentbtxnumbering \empty
+\let\currentbtxcitealternative \empty
\appendtoks
\edef\currentbtxnumbering{\btxrenderingparameter\c!numbering}%
@@ -1995,4 +2029,15 @@
\fetchruntimecommand \showbtxfields \f!publ_tra
\fetchruntimecommand \showbtxtables \f!publ_tra
+%D Some potential crap:
+%D
+%D Because I consider this bad data management and a weird mix of languages only one
+%D accessor is provided.
+
+\unexpanded\def\btxshortcut
+ {\dosingleempty\publ_shortcut}
+
+\def\publ_shortcut[#1]#2%
+ {\clf_btxshortcut{\iffirstargument#1\else\s!default\fi}{#2}}
+
\protect