diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/biblatex-abnt/abnt.bbx')
-rw-r--r-- | Master/texmf-dist/tex/latex/biblatex-abnt/abnt.bbx | 336 |
1 files changed, 220 insertions, 116 deletions
diff --git a/Master/texmf-dist/tex/latex/biblatex-abnt/abnt.bbx b/Master/texmf-dist/tex/latex/biblatex-abnt/abnt.bbx index 110c6d09357..5e91e59ef02 100644 --- a/Master/texmf-dist/tex/latex/biblatex-abnt/abnt.bbx +++ b/Master/texmf-dist/tex/latex/biblatex-abnt/abnt.bbx @@ -1,4 +1,4 @@ -%% Copyright 2016 Daniel B. Marques +%% Copyright 2016 Daniel Ballester Marques %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -10,29 +10,31 @@ %% %% This work has the LPPL maintenance status `maintained'. %% -%% The Current Maintainer of this work is Daniel B. Marques. +%% The Current Maintainer of this work is Daniel Ballester Marques. \ProvidesFile{abnt.bbx}% -[2017/07/28\space v3.1\space ABNT BibLaTeX citation style]% +[2017/11/09\space v3.2\space ABNT BibLaTeX citation style]% % Init >>>1 \RequireBiber[3]% -\DeclareLanguageMapping{brazil}{abnt-brazilian}% -\DeclareLanguageMapping{brazilian}{abnt-brazilian}% -\DeclareLanguageMapping{portuguese}{abnt-brazilian}% -\DeclareLanguageMapping{portuges}{abnt-brazilian}% -\DeclareLanguageMapping{spanish}{abnt-spanish}% -\DeclareLanguageMapping{english}{abnt-english}% + +\RequirePackage{xparse}% +\RequirePackage{xpatch}% +\RequirePackage{expl3}% + +\DeclareLanguageMappingSuffix{-abnt} \RequireBibliographyStyle{standard}% \ExecuteBibliographyOptions{% - block=none, - urldate=long, - pagetracker, - uniquename=false, + language=brazil,% + block=none,% + urldate=long,% + pagetracker,% + uniquename=false,% + sorting=nty,% }% \InitializeBibliographyStyle{\global\undef\bbx@lasthash}% @@ -40,6 +42,10 @@ \let\origbibsetup\bibsetup% \appto{\bibsetup}{\raggedright}% +\setcounter{biburlnumpenalty}{3000}% +\setcounter{biburllcpenalty}{6000}% +\setcounter{biburlucpenalty}{9000}% + % <<<1 @@ -170,30 +176,46 @@ }{}}% % <<<2 -% Show extrayear in bibliography >>>2 -\newtoggle{extrayear}% +% Show extradate in bibliography >>>2 +\newtoggle{extradate}% +\DeclareBibliographyOption{extradate}[true]{% + \settoggle{extradate}{#1}}% +\DeclareEntryOption[boolean]{extradate}[true]{% + \settoggle{extradate}{#1}}% \DeclareBibliographyOption{extrayear}[true]{% - \settoggle{extrayear}{#1}}% + \settoggle{extradate}{#1}}% \DeclareEntryOption[boolean]{extrayear}[true]{% - \settoggle{extrayear}{#1}}% + \settoggle{extradate}{#1}}% % <<<2 % Justify text >>>2 \DeclareBibliographyOption{justify}[true]{% - \ExecuteBibliographyOptions{block=space}% + % \ExecuteBibliographyOptions{block=space}% \renewcommand*{\bibsetup}{\origbibsetup}% }% % <<<2 % Make it pretty >>>2 \DeclareBibliographyOption{pretty}[true]{% - \ExecuteBibliographyOptions{% - ittitles, - sccite, - scbib, - indent, - justify, - }% + \ifstrequal{#1}{true}{% + \ExecuteBibliographyOptions{% + ittitles,% + sccite,% + scbib,% + indent,% + justify,% + }% + }{}% +}% +% <<<2 + +% Show count in backref >>>2 +\newtoggle{citecount}% +\DeclareBibliographyOption{citecount}[true]{% + \settoggle{citecount}{#1}% + \ifstrequal{#1}{true}{% + \ExecuteBibliographyOptions{backref, citecounter}% + }{}% }% % <<<2 @@ -202,7 +224,7 @@ % Data model and sorting >>>1 -\DeclareSortingScheme{nty}{%% >>>2 +\DeclareSortingTemplate{nty}{%% >>>2 \sort{% \field{presort}% }% @@ -314,23 +336,19 @@ % Capitalization commands >>>2 -\renewcommand*{\mkbibacro}[1]{% - \iftoggle{scbib}{% - \textsc{\MakeLowercase{#1}}% - }{\MakeUppercase{#1}}% -}% - -\newcommand\FirstWordUpper[1]{\@firstwordupper#1 \@nil}% +\newcommand\FirstWordUpper[1]{\@firstwordupper#1 \@nil}% >>>3 \newcommand\@firstwordupper{}% -\def\@firstwordupper#1 #2\@nil{\MakeUppercase{#1} #2\unskip}% +\def\@firstwordupper#1 #2\@nil{\MakeUppercase{#1} #2\unskip}% <<<3 -\newcommand\FirstWordSC[1]{\@firstwordsc#1 \@nil}% +\newcommand\FirstWordSC[1]{\@firstwordsc#1 \@nil}% >>>3 \newcommand\@firstwordsc{}% -\def\@firstwordsc#1 #2\@nil{\textsc{#1} #2\unskip}% +\def\@firstwordsc#1 #2\@nil{\textsc{#1} #2\unskip}% <<<3 -\newcommand\FirstWordLCSC[1]{\@firstwordlcsc#1 \@nil}% +\newcommand\FirstWordLCSC[1]{\@firstwordlcsc#1 \@nil}% >>>3 \newcommand\@firstwordlcsc{}% -\def\@firstwordlcsc#1 #2\@nil{\textsc{\MakeLowercase{#1}} #2\unskip}% +\def\@firstwordlcsc#1 #2\@nil{\textsc{\MakeLowercase{#1}} #2\unskip}% <<<3 + +% Helper macros >>>3 \long\def\addto#1#2{\expandafter\def\expandafter#1\expandafter{#1#2}}% @@ -354,78 +372,103 @@ }% \def\traceparamE\end{}% -\def\smartuppercase#1{% +% <<<3 + +\def\smartuppercase#1{% >>>3 \bgroup % \traceparam{#1}% \MakeUppercase{\paramL}% \egroup% -}% +}% <<<3 -\def\smartlowercase#1{% +\def\smartlowercase#1{% >>>3 \bgroup % \traceparam{#1}% \MakeLowercase{\paramL}% \egroup% -}% +}% <<<3 -\def\smartlcsc#1{% +\def\smartlcsc#1{% >>>3 \bgroup % \traceparam{#1}% \textsc{\MakeLowercase{\paramL}}% \egroup% -}% +}% <<<3 -\def\smartsc#1{% +\def\smartsc#1{% >>>3 \bgroup % \traceparam{#1}% \textsc{\paramL}% \egroup% -}% - -% <<<2 +}% <<<3 -% Name format >>>2 - -% Name delimiters >>>3 -\newtoggle{byeditor+others}% +\renewcommand*{\mkbibacro}[1]{% >>>3 + \iftoggle{scbib}{% + \textsc{\MakeLowercase{#1}}% + }{\MakeUppercase{#1}}% +}% <<<3 -\renewcommand*{\multinamedelim}{% - \iftoggle{byeditor+others}{% - \addcomma\addspace% +\newcommand*{\UpperOrSC}[1]{% >>>3 + \let\MakeCapital\relax% + \iftoggle{scbib}{% + \textsc{\MakeLowercase{#1}}% }{% - \addsemicolon\addspace% + \MakeUppercase{#1}% }% -}% +}% <<<3 -\renewcommand*{\finalnamedelim}{% - \iftoggle{byeditor+others}{% - \addspace\bibstring{and}\addspace% +\newcommand*{\NormalOrSC}[1]{% >>>3 + \iftoggle{scbib}{% + \textsc{\MakeLowercase{#1}}% }{% - \addsemicolon\addspace% + #1% }% +}% <<<3 + +% <<<2 + +% \IfGivenIsInitial >>>2 + +\ExplSyntaxOn% + +\ProvideDocumentCommand{\IfGivenIsInitial}{mm}{% + \regex_match:nVTF {\w\.} \namepartgiven {#1} {#2}% }% -% <<< +\cs_generate_variant:Nn \regex_match:nnTF { nV }% + +\ExplSyntaxOff% + +% <<<2 + +% Name format >>>2 \DeclareNameFormat{LAST-first}{%% >>>3 + \renewcommand*{\mkbibnamefamily}[1]{\UpperOrSC{##1}}% + \renewcommand*{\mkbibnamegiven}[1]{\ifgiveninits{\NormalOrSC{##1}}{##1}}% + \renewcommand*{\mkbibnamegiven}[1]{% + \ifgiveninits{% + \NormalOrSC{##1}% + }{% + \IfGivenIsInitial{\NormalOrSC{##1}}{##1}% + }% + }% + \renewcommand*{\mkbibnameprefix}[1]{% + \ifuseprefix{% + \UpperOrSC{##1}% + }{% + \ifgiveninits{\NormalOrSC{##1}}{##1}% + }% + }% + \renewcommand*{\mkbibnamesuffix}[1]{\UpperOrSC{##1}}% \ifgiveninits{% - \usebibmacro{name:family-given}{% - \iftoggle{scbib}{% - \textsc{\namepartfamily}% - }{% - \MakeUppercase{\namepartfamily}% - }% - }% + \usebibmacro{name:family-given}% + {\namepartfamily}% {\namepartgiveni}% {\namepartprefix}% {\namepartsuffix}% }{% - \usebibmacro{name:family-given}{% - \iftoggle{scbib}{% - \textsc{\MakeLowercase{\namepartfamily}}% - }{% - \MakeUppercase{\namepartfamily}% - }% - }% + \usebibmacro{name:family-given}% + {\namepartfamily}% {\namepartgiven}% {\namepartprefix}% {\namepartsuffix}% @@ -433,6 +476,8 @@ \usebibmacro{name:andothers}% }% <<< +\DeclareNameAlias{default}{LAST-first}% + \DeclareNameFormat{full}{%% >>>3 \usebibmacro{name:given-family}% {\namepartfamily}% @@ -441,8 +486,6 @@ {\namepartsuffix}% }% <<< -\DeclareNameAlias{default}{LAST-first}% - \DeclareNameAlias{byauthor}{full}% \DeclareNameAlias{bybookauthor}{byauthor}% \DeclareNameAlias{byeditor}{full}% @@ -461,6 +504,29 @@ \DeclareBibliographyAlias{jurisdiction}{article}% \DeclareBibliographyAlias{legal}{article}% +% Name delimiters >>>3 +\newtoggle{byeditor+others}% + +\let\multinamedelimorig\multinamedelim% +\let\finalnamedelimorig\finalnamedelim% + +\renewcommand*{\multinamedelim}{% + \iftoggle{byeditor+others}{% + \addcomma\addspace% + }{% + \addsemicolon\addspace% + }% +}% + +\renewcommand*{\finalnamedelim}{% + \iftoggle{byeditor+others}{% + \addspace\bibstring{and}\addspace% + }{% + \addsemicolon\addspace% + }% +}% +% <<< + % <<<2 % Field format >>>2 @@ -590,7 +656,7 @@ \bibstring{monography}\addspace\printtext[parens]{#1}% }%% <<< -\DeclareFieldFormat{origlanguage}{%% >>>4 +\DeclareListFormat{origlanguage}{%% >>>4 \ifbibstring{#1}% {\bibxstring{#1}}% {\ifbibstring{from#1}% @@ -1123,11 +1189,11 @@ % Publisher, location, date, issue >>>2 \renewbibmacro*{date}{% - \iftoggle{extrayear}{% + \iftoggle{extradate}{% \printdateextra% }{% \printdate% - } + }% \printunit{\addperiod\addspace}% }% @@ -1248,7 +1314,7 @@ % <<<2 -% Misc >>> +% Misc >>>2 \renewbibmacro*{volume+number+eid}{%% >>>3 \printfield{volume}% @@ -1268,17 +1334,6 @@ }% }%% <<<3 -\renewbibmacro*{pageref}{%% >>>3 - \iflistundef{pageref}% - {}% - {\printunit{\addperiod\addspace} - \printtext{% \printtext[parens]{% - \ifnumgreater{\value{pageref}}{1}% - {\bibstring{backrefpages}\ppspace}% - {\bibstring{backrefpage}\ppspace}% - \printlist[pageref][-\value{listtotal}]{pageref}}}% -}%% <<<3 - \renewbibmacro*{url+urldate}{%% >>>3 \usebibmacro{url}% \iffieldundef{urlyear}% @@ -1307,11 +1362,11 @@ \ifboolexpr{% test {\iflistundef{language}}% or% - test {\iffieldundef{origlanguage}}% + test {\iflistundef{origlanguage}}% }% {}% {% - \printtext{\printlist{language}\addspace\printfield{origlanguage}}% + \printtext{\printlist{language}\addspace\printlist{origlanguage}}% }% }%% <<<3 @@ -1329,15 +1384,45 @@ {}}% \renewbibmacro*{related:init}{}% \DeclareNameAlias{sortname}{default}% - \ifbibmacroundef{date+extrayear}% + \ifbibmacroundef{date+extradate}% {}% - {\renewbibmacro*{date+extrayear}{}% + {\renewbibmacro*{date+extradate}{}% \renewbibmacro*{date}{\printdate}}% \renewbibmacro*{pageref}{}}% {\thefield{entrytype}}}% }%% <<<3 -% <<< +\renewbibmacro*{pageref}{% >>>3 + \iftoggle{citecount}{% + \printunit{\addperiod\addspace}% + \iflistundef{pageref}{% + \bibstring{citecountnopage}% + }{% + \printtext{% + \ifnumgreater{\value{pageref}}{1}{% + \bibstring{citecountpages}\ppspace% + }{% + \bibstring{citecountpage}\ppspace% + }% + \printlist[pageref][-\value{listtotal}]{pageref}% + }% + }% + }{% + \iflistundef{pageref}{}{% + \printunit{\addperiod\addspace}% + \printtext{% + \ifnumgreater{\value{pageref}}{1}{% + \bibstring{backrefpages}\ppspace% + }{% + \bibstring{backrefpage}\ppspace% + }% + \printlist[pageref][-\value{listtotal}]{pageref}% + }% + }% + }% +}% <<<3 + +% <<<2 % <<<1 @@ -1395,9 +1480,10 @@ \newunit% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usebibmacro{addendum+pubstate}% - \printunit{\bibpagerefpunct}% + \setunit*{\bibpagerefpunct}% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usebibmacro{pageref}% + \setunit*{\addperiod\addspace}% \newunit% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \iftoggle{bbx:related}% @@ -1464,9 +1550,11 @@ \newunit% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usebibmacro{addendum+pubstate}% - \printunit{\bibpagerefpunct}% + \setunit*{\bibpagerefpunct}% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usebibmacro{pageref}% + \setunit*{\addperiod\addspace}% + \setunit*{\addperiod\addspace}% \newunit% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \iftoggle{bbx:related}% @@ -1520,9 +1608,10 @@ \newunit% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usebibmacro{addendum+pubstate}% - \printunit{\bibpagerefpunct}% + \setunit*{\bibpagerefpunct}% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usebibmacro{pageref}% + \setunit*{\addperiod\addspace}% \newunit% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \iftoggle{bbx:related}% @@ -1587,9 +1676,10 @@ \newunit% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usebibmacro{addendum+pubstate}% - \printunit{\bibpagerefpunct}% + \setunit*{\bibpagerefpunct}% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usebibmacro{pageref}% + \setunit*{\addperiod\addspace}% \newunit% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \iftoggle{bbx:related}% @@ -1648,9 +1738,10 @@ \newunit% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usebibmacro{addendum+pubstate}% - \printunit{\bibpagerefpunct}% + \setunit*{\bibpagerefpunct}% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usebibmacro{pageref}% + \setunit*{\addperiod\addspace}% \newunit% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \iftoggle{bbx:related}% @@ -1717,9 +1808,10 @@ \newunit% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usebibmacro{addendum+pubstate}% - \printunit{\bibpagerefpunct}% + \setunit*{\bibpagerefpunct}% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usebibmacro{pageref}% + \setunit*{\addperiod\addspace}% \newunit% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \iftoggle{bbx:related}% @@ -1772,9 +1864,10 @@ \newunit% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usebibmacro{addendum+pubstate}% - \printunit{\bibpagerefpunct}% + \setunit*{\bibpagerefpunct}% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usebibmacro{pageref}% + \setunit*{\addperiod\addspace}% \newunit% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \iftoggle{bbx:related}% @@ -1839,9 +1932,10 @@ \newunit% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usebibmacro{addendum+pubstate}% - \printunit{\bibpagerefpunct}% + \setunit*{\bibpagerefpunct}% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usebibmacro{pageref}% + \setunit*{\addperiod\addspace}% \newunit% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \iftoggle{bbx:related}% @@ -1900,9 +1994,10 @@ \newunit% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usebibmacro{addendum+pubstate}% - \printunit{\bibpagerefpunct}% + \setunit*{\bibpagerefpunct}% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usebibmacro{pageref}% + \setunit*{\addperiod\addspace}% \newunit% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \iftoggle{bbx:related}% @@ -1951,9 +2046,10 @@ \newunit% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usebibmacro{addendum+pubstate}% - \printunit{\bibpagerefpunct}% + \setunit*{\bibpagerefpunct}% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usebibmacro{pageref}% + \setunit*{\addperiod\addspace}% \newunit% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \iftoggle{bbx:related}% @@ -2028,9 +2124,10 @@ \newunit% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usebibmacro{addendum+pubstate}% - \printunit{\bibpagerefpunct}% + \setunit*{\bibpagerefpunct}% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usebibmacro{pageref}% + \setunit*{\addperiod\addspace}% \newunit% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \iftoggle{bbx:related}% @@ -2078,9 +2175,10 @@ \newunit% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usebibmacro{addendum+pubstate}% - \printunit{\bibpagerefpunct}% + \setunit*{\bibpagerefpunct}% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usebibmacro{pageref}% + \setunit*{\addperiod\addspace}% \newunit% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \iftoggle{bbx:related}% @@ -2145,9 +2243,10 @@ \newunit% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usebibmacro{addendum+pubstate}% - \printunit{\bibpagerefpunct}% + \setunit*{\bibpagerefpunct}% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usebibmacro{pageref}% + \setunit*{\addperiod\addspace}% \newunit% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \iftoggle{bbx:related}% @@ -2207,9 +2306,10 @@ \newunit% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usebibmacro{addendum+pubstate}% - \printunit{\bibpagerefpunct}% + \setunit*{\bibpagerefpunct}% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usebibmacro{pageref}% + \setunit*{\addperiod\addspace}% \newunit% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \iftoggle{bbx:related}% @@ -2291,9 +2391,10 @@ \newunit% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usebibmacro{addendum+pubstate}% - \printunit{\bibpagerefpunct}% + \setunit*{\bibpagerefpunct}% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usebibmacro{pageref}% + \setunit*{\addperiod\addspace}% \newunit% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \iftoggle{bbx:related}% @@ -2355,9 +2456,10 @@ \newunit% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usebibmacro{addendum+pubstate}% - \printunit{\bibpagerefpunct}% + \setunit*{\bibpagerefpunct}% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usebibmacro{pageref}% + \setunit*{\addperiod\addspace}% \newunit% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \iftoggle{bbx:related}% @@ -2406,9 +2508,10 @@ \newunit% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usebibmacro{addendum+pubstate}% - \printunit{\bibpagerefpunct}% + \setunit*{\bibpagerefpunct}% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usebibmacro{pageref}% + \setunit*{\addperiod\addspace}% \newunit% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \iftoggle{bbx:related}% @@ -2476,9 +2579,10 @@ \newunit% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usebibmacro{addendum+pubstate}% - \printunit{\bibpagerefpunct}% + \setunit*{\bibpagerefpunct}% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \usebibmacro{pageref}% + \setunit*{\addperiod\addspace}% \newunit% \newblock%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \iftoggle{bbx:related}% |