summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/biblatex-abnt/abnt.bbx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-11-17 22:23:15 +0000
committerKarl Berry <karl@freefriends.org>2018-11-17 22:23:15 +0000
commit9189ec48fe9d56f12e7e17b0309331801125770c (patch)
treee7f015893eca4a85859fbc0171b67fe52ab28792 /Master/texmf-dist/tex/latex/biblatex-abnt/abnt.bbx
parent99859351234219667e5b7d226c6793392f7580d9 (diff)
biblatex-abnt (17nov18)
git-svn-id: svn://tug.org/texlive/trunk@49179 c570f23f-e606-0410-a88d-b1316a301751
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%