summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/biblatex/blx-dm.def
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/biblatex/blx-dm.def')
-rw-r--r--Master/texmf-dist/tex/latex/biblatex/blx-dm.def27
1 files changed, 24 insertions, 3 deletions
diff --git a/Master/texmf-dist/tex/latex/biblatex/blx-dm.def b/Master/texmf-dist/tex/latex/biblatex/blx-dm.def
index 864c5cec58b..d5e65b6fbdb 100644
--- a/Master/texmf-dist/tex/latex/biblatex/blx-dm.def
+++ b/Master/texmf-dist/tex/latex/biblatex/blx-dm.def
@@ -3,13 +3,17 @@
\newbool{dmskipout}%
\newbool{dmlabelfield}%
-\listadd\blx@globalopts{datamodel}% for passing to the .bcf
-
% Data model .bcf output macros
\xdef\blx@xml@datamodel#1{%
~~<bcf:datamodel>\blx@nl
#1%
~~</bcf:datamodel>\blx@nl}
+\xdef\blx@xml@datamodel@constants#1{%
+ ~~~~<bcf:constants>\blx@nl
+ #1%
+ ~~~~</bcf:constants>\blx@nl}
+\xdef\blx@xml@datamodel@constant#1#2#3{%
+ ~~~~~~<bcf:constant type="#1" name="#2">#3</bcf:constant>\blx@nl}
\xdef\blx@xml@datamodel@entrytypes#1{%
~~~~<bcf:entrytypes>\blx@nl
#1%
@@ -61,6 +65,7 @@
\xdef\blx@xml@datamodel@constraintfieldsub#1{%
~~~~~~~~~~<bcf:field>#1</bcf:field>\blx@nl}
+
% Data model specification macros
\newrobustcmd*{\ResetDatamodelEntrytypes}{%
\global\cslet{blx@bcf@datamodel@entrytypes}\@empty
@@ -203,6 +208,20 @@
\booltrue{dmlabelfield}}
{}}
+\newrobustcmd*{\DeclareDatamodelConstant}[3][]{%
+ \begingroup
+ \let\blx@tempa\@empty
+ \ifblank{#1}
+ {\def\blx@tempa{string}}
+ {\setkeys{blx@datamodel@constant}{#1}}%
+ \xappto\blx@bcf@datamodel@constants{\blx@xml@datamodel@constant{\blx@tempa}{#2}{#3}}%
+ \csxdef{blx@datamodel@constant@#2}{#3}%
+ \csxdef{blx@datamodel@constanttype@#2}{\blx@tempa}%
+ \endgroup}
+
+\define@key{blx@datamodel@constant}{type}{%
+ \def\blx@tempa{#1}}
+
\newrobustcmd*{\DeclareDatamodelEntryfields}[2][]{%
\begingroup
\let\blx@tempa\@empty
@@ -300,6 +319,9 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Data model specification
+\DeclareDatamodelConstant[type=list]{gender}{sf,sm,sn,pf,pm,pn,pp}
+\DeclareDatamodelConstant[type=list]{nameparts}{prefix,family,suffix,given}
+\DeclareDatamodelConstant[type=list]{optiondatatypes}{boolean,integer,string,xml}
\DeclareDatamodelEntrytypes{
article,
@@ -1571,7 +1593,6 @@
\DeclareDatamodelConstraints[inproceedings]{
\constraint[type=mandatory]{
\constraintfield{author}
- \constraintfield{editor}
\constraintfield{title}
\constraintfield{booktitle}
}