summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/biblatex-abnt/abnt.bbx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/biblatex-abnt/abnt.bbx')
-rw-r--r--Master/texmf-dist/tex/latex/biblatex-abnt/abnt.bbx81
1 files changed, 62 insertions, 19 deletions
diff --git a/Master/texmf-dist/tex/latex/biblatex-abnt/abnt.bbx b/Master/texmf-dist/tex/latex/biblatex-abnt/abnt.bbx
index ae5449800c8..ec95c836c8f 100644
--- a/Master/texmf-dist/tex/latex/biblatex-abnt/abnt.bbx
+++ b/Master/texmf-dist/tex/latex/biblatex-abnt/abnt.bbx
@@ -13,7 +13,7 @@
%% The Current Maintainer of this work is Daniel Ballester Marques.
\ProvidesFile{abnt.bbx}%
-[2018/04/04\space v3.3\space ABNT BibLaTeX citation style]%
+[2018-11-17\space v3.4\space ABNT BibLaTeX citation style]%
% Init >>>1
@@ -432,31 +432,74 @@
}%
}% <<<2
-\newcommand{\iffieldendswith}[4]{% >>>2
- \IfEndWith{\strfield{#1}}{#2}{#3}{#4}%
-}% <<<2
-\newcommand{\iffieldendswithpunct}[3]{% >>>2
- \ifboolexpr{%
- test {\iffieldendswith{#1}{.}}%
- or%
- test {\iffieldendswith{#1}{!}}%
- or%
- test {\iffieldendswith{#1}{?}}%
- or%
- test {\iffieldendswith{#1}{-}}%
- or%
- test {\iffieldendswith{#1}{:}}%
- or%
- test {\iffieldendswith{#1}{/}}%
- }{#2}{#3}%
-}% <<<2
+% auxiliary commands
+\ExplSyntaxOn
+% {<string>}{<regex>}
+\NewDocumentCommand { \abntblx@regex@match } { mm } {
+ \regex_match:nnTF { #2 } { #1 }
+}
+\ExplSyntaxOff
+
+% define \iffieldregex{<field>}{<regex>}
+\newcommand*{\blx@imc@iffieldregex}{}
+\newcommand*{\iffieldregex}{}
+
+\protected\def\blx@imc@iffieldregex#1#2{%
+ \blx@imc@iffieldundef{#1}
+ {\@secondoftwo}
+ {\expandafter\expandafter
+ \expandafter\abntblx@regex@match
+ \expandafter\expandafter
+ \expandafter{\csname abx@field@#1\endcsname}{#2}}}
+
+\blx@regimcs{\iffieldregex}
+
+\newcommand*{\iffieldendswithpunct}[1]{%
+ \iffieldregex{#1}{(\.|\!|\?|\-|\:|\/)\Z}%
+}
% <<<1
% Formatting >>>1
+% Use \refname for headings >>>2
+\ifcase\abx@classtype\relax % article
+\or % book/report
+ \defbibheading{bibliography}[\refname]{%
+ \chapter*{#1}%
+ \@mkboth{\abx@MakeMarkcase{#1}}{\abx@MakeMarkcase{#1}}}
+\or % scrartcl
+\or % scrbook/scrreprt
+ \defbibheading{bibliography}[\refname]{%
+ \ifcsundef{bibliography@heading}
+ {\ifkomabibtotocnumbered
+ {\chapter{#1}}
+ {\ifkomabibtotoc
+ {\addchap{#1}}
+ {\chapter*{#1}
+ \ifcsundef{@mkdouble}
+ {\@mkboth{\abx@MakeMarkcase{#1}}{\abx@MakeMarkcase{#1}}}
+ {\@mkdouble{\abx@MakeMarkcase{#1}}}}}}
+ {\bibliography@heading{#1}}}
+\or % memoir (article)
+\or % memoir (book)
+ \ifcsundef{memUChead}{}{\def\abx@MakeMarkcase{\memUChead}}%
+ \defbibheading{bibliography}[\refname]{%
+ \chapter*{#1}%
+ \if@twoside
+ \markboth{\abx@MakeMarkcase{#1}}{\abx@MakeMarkcase{#1}}%
+ \else
+ \markright{\abx@MakeMarkcase{#1}}%
+ \fi
+ \ifmemoirbibintoc
+ {\phantomsection
+ \addcontentsline{toc}{chapter}{#1}}
+ {}}
+\fi
+% <<<2
+
% \IfGivenIsInitial >>>2
\ExplSyntaxOn%