diff options
author | Karl Berry <karl@freefriends.org> | 2016-07-09 22:06:46 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-07-09 22:06:46 +0000 |
commit | 5af25bafb7113aeac5878b6d479fcd5a7a8afc1f (patch) | |
tree | 6498a27085d58577336a1b2465bb3ce27c145d1f /Master/texmf-dist/tex/latex/biblatex-abnt/abnt.cbx | |
parent | 06dfd0dc9ed518e23ce205cd3c37c30a70b65549 (diff) |
biblatex-abnt (9jul16)
git-svn-id: svn://tug.org/texlive/trunk@41668 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/biblatex-abnt/abnt.cbx')
-rw-r--r-- | Master/texmf-dist/tex/latex/biblatex-abnt/abnt.cbx | 330 |
1 files changed, 177 insertions, 153 deletions
diff --git a/Master/texmf-dist/tex/latex/biblatex-abnt/abnt.cbx b/Master/texmf-dist/tex/latex/biblatex-abnt/abnt.cbx index 073aae49dcc..df68b3acc4c 100644 --- a/Master/texmf-dist/tex/latex/biblatex-abnt/abnt.cbx +++ b/Master/texmf-dist/tex/latex/biblatex-abnt/abnt.cbx @@ -12,7 +12,9 @@ %% %% The Current Maintainer of this work is Daniel B. Marques. -\ProvidesFile{abnt.cbx}[2016/05/12\space v1.0.1\space ABNT biblatex citation style] +\ProvidesFile{abnt.cbx}% +[2016/07/06\space v2.0\space ABNT biblatex citation style]% + \RequireBiber[3] \RequireCitationStyle{authoryear} @@ -20,26 +22,26 @@ \newcommand{\addapud}{% \renewcommand*{\multicitedelim}{% - \ifnumequal{\value{multicitecount}}{\value{multicitetotal}} - {\space\bibstring{apud}} + \ifnumequal{\value{multicitecount}}{\value{multicitetotal}}% + {\space\bibstring{apud}}% {\addsemicolon}% \space}% \renewcommand*{\textcitedelim}{% - \ifnumequal{\value{multicitecount}}{\value{multicitetotal}} - {\addspace\bibstring{apud}} + \ifnumequal{\value{multicitecount}}{\value{multicitetotal}}% + {\addspace\bibstring{apud}}% {\addsemicolon}% \space}% } \newcommand{\addand}{% \renewcommand*{\multicitedelim}{% - \ifnumequal{\value{multicitecount}}{\value{multicitetotal}} - {\space\bibstring{and}} + \ifnumequal{\value{multicitecount}}{\value{multicitetotal}}% + {\space\bibstring{and}}% {\addsemicolon}% \space}% \renewcommand*{\textcitedelim}{% - \ifnumequal{\value{multicitecount}}{\value{multicitetotal}} - {\addspace\bibstring{and}} + \ifnumequal{\value{multicitecount}}{\value{multicitetotal}}% + {\addspace\bibstring{and}}% {\addsemicolon}% \space}% } @@ -52,7 +54,7 @@ % Option to use small caps in the citations. \newtoggle{sccite} -\DeclareBibliographyOption{sccite}[true]{ +\DeclareBibliographyOption{sccite}[true]{% \settoggle{sccite}{#1}} @@ -61,76 +63,83 @@ % ---------- \DeclareNameFormat{LAST}{% - \nameparts{#1}% \ifcase\value{uniquename}% - \usebibmacro{name:family} - {\iftoggle{sccite} - {\textsc{\MakeLowercase{\namepartfamily}}} - {\MakeUppercase{\namepartfamily}}} - {\namepartgiven} - {\namepartprefix} + \usebibmacro{name:family}% + {\iftoggle{sccite}% + {\textsc{\MakeLowercase{\namepartfamily}}}% + {\MakeUppercase{\namepartfamily}}}% + {\namepartgiven}% + {\namepartprefix}% {\namepartsuffix}% - \or - \ifuseprefix - {\usebibmacro{name:given-family} - {\iftoggle{sccite} - {\textsc{\MakeLowercase{\namepartfamily}}} - {\MakeUppercase{\namepartfamily}}} - {\namepartgiveni} - {\namepartprefix} - {\namepartsuffixi}} - {\usebibmacro{name:given-family} - {\iftoggle{sccite} - {\textsc{\MakeLowercase{\namepartfamily}}} - {\MakeUppercase{\namepartfamily}}} - {\namepartgiveni} - {\namepartprefixi} + \or% + \ifuseprefix% + {\usebibmacro{name:given-family}% + {\iftoggle{sccite}% + {\textsc{\MakeLowercase{\namepartfamily}}}% + {\MakeUppercase{\namepartfamily}}}% + {\namepartgiveni}% + {\namepartprefix}% + {\namepartsuffixi}}% + {\usebibmacro{name:given-family}% + {\iftoggle{sccite}% + {\textsc{\MakeLowercase{\namepartfamily}}}% + {\MakeUppercase{\namepartfamily}}}% + {\namepartgiveni}% + {\namepartprefixi}% {\namepartsuffixi}}% - \or - \usebibmacro{name:given-family} - {\iftoggle{sccite} - {\textsc{\MakeLowercase{\namepartfamily}}} - {\MakeUppercase{\namepartfamily}}} - {\namepartgiven} - {\namepartprefix} + \or% + \usebibmacro{name:given-family}% + {\iftoggle{sccite}% + {\textsc{\MakeLowercase{\namepartfamily}}}% + {\MakeUppercase{\namepartfamily}}}% + {\namepartgiven}% + {\namepartprefix}% {\namepartsuffix}% - \fi + \fi% \usebibmacro{name:andothers}} \DeclareNameFormat{fullcite}{% - \nameparts{#1}% \ifcase\value{uniquename}% - \usebibmacro{name:given-family} - {\namepartfamily} - {\namepartgiven} - {\namepartprefix} + \usebibmacro{name:given-family}% + {\namepartfamily}% + {\namepartgiven}% + {\namepartprefix}% {\namepartsuffix}% - \or - \ifuseprefix - {\usebibmacro{name:given-family} - {\namepartfamily} - {\namepartgiveni} - {\namepartprefix} - {\namepartsuffixi}} - {\usebibmacro{name:given-family} - {\namepartfamily} - {\namepartgiveni} - {\namepartprefixi} + \or% + \ifuseprefix% + {\usebibmacro{name:given-family}% + {\namepartfamily}% + {\namepartgiveni}% + {\namepartprefix}% + {\namepartsuffixi}}% + {\usebibmacro{name:given-family}% + {\namepartfamily}% + {\namepartgiveni}% + {\namepartprefixi}% {\namepartsuffixi}}% - \or - \usebibmacro{name:given-family} - {\namepartfamily} - {\namepartgiven} - {\namepartprefix} + \or% + \usebibmacro{name:given-family}% + {\namepartfamily}% + {\namepartgiven}% + {\namepartprefix}% {\namepartsuffix}% - \fi + \fi% \usebibmacro{name:andothers}} + % ---------- % DeclareFieldFormat % ---------- -\DeclareFieldFormat{citetitle}{\mkbibemph{#1}} +\DeclareFieldFormat{emphtitle}{\emph{#1}} + +\DeclareFieldFormat{citetitle}{% + \iftoggle{sccite}{% + \normalfont\textsc{\MakeLowercase{\FirstWord{#1}}}% + }{% + \normalfont\MakeUppercase{\FirstWord{#1}}% + }% +}% % ---------- @@ -166,117 +175,117 @@ \DeclareCiteCommand{\@apud} {\usebibmacro{cite:init}% - \iffieldundef{prenote} - {} - {\printfield[uppercasecite]{prenote} - \addspace\bibstring{apud}\addspace}} + \iffieldundef{prenote}% + {}% + {\printfield[uppercasecite]{prenote}% + \addspace\bibstring{apud}\addspace}}% {\usebibmacro{citeindex}% - \usebibmacro{cite}} - {\setunit{\multicitedelim}} + \usebibmacro{cite}}% + {\setunit{\multicitedelim}}% {\usebibmacro{postnote}} \DeclareCiteCommand{\parencite}[\mkbibparens] {\usebibmacro{cite:init}% - \usebibmacro{prenote}} + \usebibmacro{prenote}}% {\usebibmacro{citeindex}% - \usebibmacro{cite}} - {} + \usebibmacro{cite}}% + {}% {\usebibmacro{postnote}} \DeclareCiteCommand{\cite}[\mkbibparens] {\usebibmacro{cite:init}% - \usebibmacro{prenote}} + \usebibmacro{prenote}}% {\usebibmacro{citeindex}% - \usebibmacro{cite}} - {} + \usebibmacro{cite}}% + {}% {\usebibmacro{postnote}} \DeclareCiteCommand{\plaincite} {\usebibmacro{cite:init}% - \usebibmacro{prenote}} + \usebibmacro{prenote}}% {\usebibmacro{citeindex}% - \usebibmacro{cite}} - {\multicitedelim} + \usebibmacro{cite}}% + {\multicitedelim}% {\usebibmacro{postnote}} \DeclareMultiCiteCommand{\cites}[\mkbibparens] - {\cite} + {\cite}% {\setunit{\multicitedelim}} \DeclareCiteCommand*{\cite}[\mkbibparens] {\usebibmacro{cite:init}% - \usebibmacro{prenote}} + \usebibmacro{prenote}}% {\usebibmacro{citeindex}% - \usebibmacro{citeyearpunct}} - {} + \usebibmacro{citeyearpunct}}% + {}% {\usebibmacro{postnote}} \DeclareCiteCommand{\textcite} {\usebibmacro{cite:init}% \boolfalse{cbx:parens}% \renewcommand*{\finalnamedelim}{\addspace\bibstring{and}\addspace}% - \renewcommand*{\multinamedelim}{\addcomma\addspace}} + \renewcommand*{\multinamedelim}{\addcomma\addspace}}% {\usebibmacro{citeindex}% - \iffirstcitekey - {\setcounter{textcitetotal}{1}} + \iffirstcitekey% + {\setcounter{textcitetotal}{1}}% {\stepcounter{textcitetotal}% \textcitedelim}% - \usebibmacro{textcite}} - {\ifbool{cbx:parens} - {\bibcloseparen\global\boolfalse{cbx:parens}} - {}} + \usebibmacro{textcite}}% + {\ifbool{cbx:parens}% + {\bibcloseparen\global\boolfalse{cbx:parens}}% + {}}% {\usebibmacro{textcite:postnote}} \DeclareCiteCommand*{\textcite} {\usebibmacro{cite:init}% \boolfalse{cbx:parens}% \renewcommand*{\finalnamedelim}{\addspace\bibstring{and}\addspace}% - \renewcommand*{\multinamedelim}{\addcomma\addspace}} + \renewcommand*{\multinamedelim}{\addcomma\addspace}}% {\usebibmacro{citeindex}% - \iffirstcitekey - {\setcounter{textcitetotal}{1}} + \iffirstcitekey% + {\setcounter{textcitetotal}{1}}% {\stepcounter{textcitetotal}% \textcitedelim}% - \usebibmacro{textcitefull}} - {\ifbool{cbx:parens} - {\bibcloseparen\global\boolfalse{cbx:parens}} - {}} + \usebibmacro{textcitefull}}% + {\ifbool{cbx:parens}% + {\bibcloseparen\global\boolfalse{cbx:parens}}% + {}}% {\usebibmacro{textcite:postnote}} \DeclareCiteCommand{\citetitle}[\mkbibparens] {\usebibmacro{cite:init}% \boolfalse{citetracker}% \boolfalse{pagetracker}% - \usebibmacro{prenote}} - {\ifciteindex - {\indexfield{indextitle}} + \usebibmacro{prenote}}% + {\ifciteindex% + {\indexfield{indextitle}}% {}% - \printfield[citetitle]{labeltitle}} - {\multicitedelim} + \printfield[emphtitle]{labeltitle}}% + {\multicitedelim}% {\usebibmacro{postnote}} \DeclareCiteCommand*{\citetitle} {\usebibmacro{cite:init}% \boolfalse{citetracker}% \boolfalse{pagetracker}% - \usebibmacro{prenote}} - {\ifciteindex - {\indexfield{indextitle}} + \usebibmacro{prenote}}% + {\ifciteindex% + {\indexfield{indextitle}}% {}% - \printfield[citetitle]{title}\nopunct} - {\multicitedelim} + \printfield[citetitle]{title}\nopunct}% + {\multicitedelim}% {\usebibmacro{postnote}} \DeclareCiteCommand{\citelastname} {\usebibmacro{cite:init}% \boolfalse{citetracker}% \boolfalse{pagetracker}% - \usebibmacro{prenote}} - {\ifciteindex - {\indexnames{labelname}} + \usebibmacro{prenote}}% + {\ifciteindex% + {\indexnames{labelname}}% {}% - \printnames{labelname}} - {\multicitedelim} + \printnames{labelname}}% + {\multicitedelim}% {\usebibmacro{postnote}} @@ -284,6 +293,9 @@ % newbibmacro % ---------- +\newbibmacro*{cite:noname}{% + \printfield[citetitle]{title}} + \newbibmacro*{cite:init}{% \global\undef\cbx@lasthash} @@ -291,66 +303,71 @@ \printtext[bibhyperref]{\printfield{author}}} \renewbibmacro*{textcite}{% - \ifnameundef{labelname} - {\iffieldundef{shorthand} + \ifnameundef{labelname}% + {\iffieldundef{shorthand}% {\usebibmacro{cite:label}% \setunit{% \global\booltrue{cbx:parens}% \nonameyeardelim\bibopenparen}% - \ifnumequal{\value{citecount}}{1} - {\usebibmacro{prenote}} + \ifnumequal{\value{citecount}}{1}% + {\usebibmacro{prenote}}% {}% - \usebibmacro{cite:labelyear+extrayear}} - {\usebibmacro{cite:shorthand}}} + \usebibmacro{cite:labelyear+extrayear}}% + {\usebibmacro{cite:shorthand}}}% {\printnames{labelname}% \setunit{% \global\booltrue{cbx:parens}% \addspace\bibopenparen}% - \ifnumequal{\value{citecount}}{1} - {\usebibmacro{prenote}} + \ifnumequal{\value{citecount}}{1}% + {\usebibmacro{prenote}}% {}% \usebibmacro{citeyear}}} \newbibmacro*{textcitefull}{% - \ifnameundef{labelname} - {\iffieldundef{shorthand} + \ifnameundef{labelname}% + {\iffieldundef{shorthand}% {\usebibmacro{cite:label}% \setunit{% \global\booltrue{cbx:parens}% \nonameyeardelim\bibopenparen}% - \ifnumequal{\value{citecount}}{1} - {\usebibmacro{prenote}} + \ifnumequal{\value{citecount}}{1}% + {\usebibmacro{prenote}}% {}% - \usebibmacro{cite:labelyear+extrayear}} - {\usebibmacro{cite:shorthand}}} + \usebibmacro{cite:labelyear+extrayear}}% + {\usebibmacro{cite:shorthand}}}% {\printnames[fullcite]{labelname}% \setunit{% \global\booltrue{cbx:parens}% \addspace\bibopenparen}% - \ifnumequal{\value{citecount}}{1} - {\usebibmacro{prenote}} + \ifnumequal{\value{citecount}}{1}% + {\usebibmacro{prenote}}% {}% \usebibmacro{citeyear}}} \renewbibmacro*{cite}{% - \iffieldequals{fullhash}{\cbx@lasthash} -% Multiple cites in one command + \iffieldequals{fullhash}{\cbx@lasthash}% {\setunit{\compcitedelim}% \usebibmacro{cite:plabelyear+extrayear}}% -% Single cite - {\ifthenelse{\ifnameundef{labelname}\OR\iffieldequalstr{entrytype}{patent}} -% No author/editor - {\usebibmacro{cite:noname}% - \setunit{\nameyeardelim}% - \usebibmacro{cite:plabelyear+extrayear}% - \savefield{fullhash}{\cbx@lasthash}} -% Normal cite - {\ifnameundef{shortauthor} - {\printnames[LAST]{labelname}}% - {\printnames[LAST]{shortauthor}}% - \setunit{\nameyeardelim}% + {\ifnameundef{shortauthor}{% + \ifnameundef{holder}{% + \ifnameundef{labelname}{% + \iflistundef{organization}{% + \usebibmacro{cite:noname}% + }{% + \printlist[uppercase]{organization}% + } + }{% + \printtext[bibhyperref]{\printnames[LAST]{labelname}}% + } + }{% + \printnames[LAST]{holder}% + } + }{% + \printnames[LAST]{shortauthor}% + } + \setunit{\nameyeardelim}% \usebibmacro{cite:plabelyear+extrayear}% - \savefield{fullhash}{\cbx@lasthash}}}% + \savefield{fullhash}{\cbx@lasthash}}% \setunit{\multicitedelim}} \def\citeresetabnt{\global\let\cbx@abnt@names\@empty} @@ -362,34 +379,41 @@ \renewbibmacro*{cite:label}{% \iffieldundef{label} - {\printtext[bibhyperref]{\printfield[uppercasecite]{labeltitle}}} + {\printtext[bibhyperref]{\printfield[uppercasecite]{labeltitle}}}% {\printtext[bibhyperref]{\printfield{label}}}} \newbibmacro*{cite:plabelyear+extrayear}{% - \iffieldundef{labelyear} - {} + \iffieldundef{labelyear}% + {}% {\printtext[bibhyperref]{% \printfield[noformat]{origyear}\setunit*{\addslash}% \printfield{labelyear}\printfield{extrayear}}}% - \iffieldundef{issue} - {} + \iffieldundef{issue}% + {}% {\addcomma\addspace\printfield{issue}}} \renewbibmacro*{cite:shorthand}{% - \ifciteseen - {\printfield{shorthand}} + \ifciteseen% + {\printfield{shorthand}}% {\printnames[labelname][-\value{listtotal}]{labelname}% \setunit{\nameyeardelim}% \printfield{title}\space\printfield{shorthand}}} \newbibmacro*{citeyearpunct}{% - \iffieldundef{labelyear} - {\usebibmacro{cite:init}} - {\iffieldequals{fullhash}{\cbx@lasthash} + \iffieldundef{labelyear}% + {\usebibmacro{cite:init}}% + {\iffieldequals{fullhash}{\cbx@lasthash}% {\setunit{\compcitedelim}% - \usebibmacro{cite:plabelyear+extrayear}} + \usebibmacro{cite:plabelyear+extrayear}}% {\usebibmacro{cite:plabelyear+extrayear}% \savefield{fullhash}{\cbx@lasthash}}}% \setunit{\multicitedelim}} + +\newcommand\FirstWord[1]{\@firstword#1 \@nil}% +\def\@firstword#1 #2\@nil{\@removecomma#1,\@nil}% +\def\@removecomma#1,#2\@nil{\@removeperiod#1.\@nil} +\def\@removeperiod#1.#2\@nil{\@removesemicolon#1;\@nil} +\def\@removesemicolon#1;#2\@nil{#1} + \endinput |