diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/biblatex-abnt/abnt-ibid.cbx')
-rw-r--r-- | Master/texmf-dist/tex/latex/biblatex-abnt/abnt-ibid.cbx | 479 |
1 files changed, 479 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/biblatex-abnt/abnt-ibid.cbx b/Master/texmf-dist/tex/latex/biblatex-abnt/abnt-ibid.cbx new file mode 100644 index 00000000000..88941c28413 --- /dev/null +++ b/Master/texmf-dist/tex/latex/biblatex-abnt/abnt-ibid.cbx @@ -0,0 +1,479 @@ +%% Copyright 2016 Daniel B. Marques +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3 +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% http://www.latex-project.org/lppl.txt +%% and version 1.3 or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Daniel B. Marques. + +\ProvidesFile{abnt-ibid.cbx}% +[2016/10/03\space v3.0\space ABNT BibLaTeX citation style]% + +\newtoggle{sccite}% + +% Format >>>1 + +\DeclareFieldFormat{citetitle}{%% >>>2 + \iftoggle{sccite}{% + \normalfont\textsc{\MakeLowercase{\FirstWord{#1}}}% + }{% + \normalfont\MakeUppercase{\FirstWord{#1}}% + }% +}%% <<<2 + +\DeclareNameFormat{LAST}{%% >>>2 + \ifcase\value{uniquename}% + \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}% + {\namepartsuffixi}}% + \or% + \usebibmacro{name:given-family}% + {\iftoggle{sccite}% + {\textsc{\MakeLowercase{\namepartfamily}}}% + {\MakeUppercase{\namepartfamily}}}% + {\namepartgiven}% + {\namepartprefix}% + {\namepartsuffix}% + \fi% + \usebibmacro{name:andothers}% +}% <<<2 + +% \DeclareDelimFormat{nameyeardelim}{\addcomma\addspace}% +\renewcommand*{\nameyeardelim}{\addcomma\addspace}% + +% <<<1 + +% Options >>>1 + +\DeclareBibliographyOption{sccite}[true]{ + \settoggle{sccite}{#1}% +} + +\InitializeCitationStyle{\numgdef{\cbx@resetcount}{\cbx@resetcount+1}}% + +\DeclareFieldFormat{bibhyperlink}{% + \bibhyperlink{\iffootnote{f}{t}:\cbx@resetcount:\thefield{entrykey}}{#1}}% +\DeclareFieldFormat{bibhypertarget}{% + \bibhypertarget{\iffootnote{f}{t}:\cbx@resetcount:\thefield{entrykey}}{#1}}% + +\newcommand*{\cbx@resetcount}{0}% +\providecommand*{\mkidem}[1]{#1}% +\providecommand*{\mkibid}[1]{#1}% +\providecommand*{\mkopcit}[1]{#1}% +\renewcommand*{\iffinalcitedelim}{% + \ifnumequal{\value{textcitecount}}{\value{textcitetotal}-1}}% + +\newtoggle{cbx:loccit}% + +\newbibmacro*{footcite:citepages}{}% +\newbibmacro*{footcite:full:citepages}{}% +\newbibmacro*{footcite:postnote}{}% + +\DeclareBibliographyOption[boolean]{ibidpage}[true]{% + \ifstrequal{#1}{true}% + {\ExecuteBibliographyOptions{loccittracker=constrict}}% + {\ExecuteBibliographyOptions{loccittracker=false}}}% + +\DeclareBibliographyOption[string]{footcitepages}[permit]{% + \ifcsdef{cbx@opt@citepages@#1}% + {\csuse{cbx@opt@citepages@#1}}% + {\PackageError{biblatex}% + {Invalid option 'citepages=#1'}% + {Valid values are 'permit', 'suppress', 'omit', 'separate'.}}}% + +\providebibmacro*{footcite:citepages}{}% +\providebibmacro*{footcite:full:citepages}{}% +\providebibmacro*{footcite:postnote}{}% + +\def\cbx@opt@citepages@permit{% >>>2 + \renewbibmacro*{footcite:citepages}{}% + \renewbibmacro*{footcite:full:citepages}{}% + \renewbibmacro*{footcite:postnote}{% + \usebibmacro{footcite:postnote:ibidpage}}}% <<<2 + +\def\cbx@opt@citepages@suppress{% >>>2 + \renewbibmacro*{footcite:citepages}{}% + \renewbibmacro*{footcite:full:citepages}{% + \clearfield{pages}% + \clearfield{pagetotal}}% + \renewbibmacro*{footcite:postnote}{% + \usebibmacro{footcite:postnote:ibidpage}}}% <<<2 + +\def\cbx@opt@citepages@omit{% >>>2 + \renewbibmacro*{footcite:citepages}{}% + \renewbibmacro*{footcite:full:citepages}{% + \ifboolexpr{% + test {\ifnumequal{\value{footcitecount}}{\value{footcitetotal}}}% + and% + test {\iffieldpages{postnote}}% + }% + {\clearfield{pages}% + \clearfield{pagetotal}}% + {}}% + \renewbibmacro*{footcite:postnote}{% + \usebibmacro{footcite:postnote:ibidpage}}}% <<<2 + +\def\cbx@opt@citepages@separate{% >>>2 + \providetoggle{cbx:fullcite}% + \renewbibmacro*{footcite:citepages}{% + \global\togglefalse{cbx:fullcite}}% + \renewbibmacro*{footcite:full:citepages}{% + \global\toggletrue{cbx:fullcite}}% + \renewbibmacro*{footcite:postnote}{% + \ifboolexpr{% + togl {cbx:fullcite}% + and% + test {\iffieldpages{postnote}}% + and% + test {\ifnumequal{\value{footcitecount}}{\value{footcitetotal}}}% + and% + (% + not test {\iffieldundef{pages}}% + or% + not test {\iffieldundef{pagetotal}}% + )% + }% + {\usebibmacro{footcite:postnote:pages}}% + {\usebibmacro{footcite:postnote:ibidpage}}}% + \providebibmacro*{footcite:postnote:pages}{% + \setunit{\postnotedelim}% + \bibstring{thiscite}% + \setunit{\addspace}% + \printfield{postnote}}}% <<<2 + +\ExecuteBibliographyOptions{% >>>2 + loccittracker=constrict, + citetracker=context,% + ibidtracker=constrict,% + idemtracker=constrict,% + opcittracker=constrict,% + pagetracker,% + autocite=footnote,% + footcitepages=permit,% + labeldateparts,% + labeldate=year,% +}% <<<2 + +% <<<1 + +% Macros >>>1 + +\newbibmacro*{footcite}{% >>>2 + \usebibmacro{footcite:citepages}% + \global\togglefalse{cbx:loccit}% + \ifciteseen{% + \iffieldundef{shorthand}{% + \ifboolexpr{% + test {\ifciteibid}% + and% + not test {\iffirstonpage}% + }{% + \usebibmacro{footcite:ibid}% + }{% + \ifboolexpr{% + test {\ifciteidem}% + and% + not test {\iffirstonpage}% + }{% + \usebibmacro{footcite:idem}% + }{% + \ifboolexpr{% + test {\ifopcit}% + and% + not test {\iffirstonpage}% + }{% + \usebibmacro{footcite:opcit}% + }{% + \usebibmacro{footcite:short}% + }% + }% + }% + }{% + \usebibmacro{footcite:shorthand}% + }% + }{% + \usebibmacro{footcite:full}% + }% +}% <<<2 + +\newbibmacro*{footcite:full}{% >>>2 + \usebibmacro{footcite:full:citepages}% + \printtext[bibhypertarget]{% + \usedriver% + {\DeclareNameAlias{sortname}{default}}% + {\thefield{entrytype}}}% + \usebibmacro{shorthandintro}}% + +\newbibmacro*{footcite:short}{% + \ifnameundef{labelname}{% + \printtext[bibhyperref]{% + \printfield[citetitle]{labeltitle}% + }% + }{% + \printnames[LAST]{labelname}% + }% + \setunit*{\nameyeardelim}% + \iffieldundef{labelyear}{% + }{% + \printtext[bibhyperlink]{% + \printfield{labelyear}% + \printfield{extrayear}% + }% + }% +}% <<<2 + +\newbibmacro*{footcite:opcit}{% >>>2 + \ifnameundef{labelname}{% + \printtext[bibhyperref]{% + \printfield[citetitle]{labeltitle}% + }% + }{% + \printnames[LAST]{labelname}% + }% + \setunit*{\nameyeardelim}% + \printtext[bibhyperlink]{\bibstring[\mkopcit]{opcit}}% +}% + +\newbibmacro*{footcite:idem}{% + \printtext[bibhyperlink]{\bibstring[\mkidem]{idem}}% + \setunit*{\nameyeardelim}% + \iffieldundef{labelyear}{% + }{% + \printtext[bibhyperlink]{% + \printfield{labelyear}% + \printfield{extrayear}% + }% + }% +}% <<<2 + +\newbibmacro*{footcite:ibid}{% >>>2 + \printtext[bibhyperlink]{\bibstring[\mkibid]{ibidem}}% + \ifloccit% + {\global\toggletrue{cbx:loccit}}% + {}}% <<<2 + +\newbibmacro*{footcite:shorthand}{% >>>2 + \printtext[bibhyperlink]{% + \printfield{shorthand}}}% <<<2 + +\newbibmacro*{footcite:postnote:ibidpage}{% >>>2 + \iftoggle{cbx:loccit}% + {}% + {\MakeLowercase{\usebibmacro{postnote}}}}% <<<2 + +% <<<1 + +% Commands >>>1 + +\DeclareCiteCommand{\cite}% >>>2 + {\usebibmacro{prenote}}% + {\usebibmacro{citeindex}% + \usebibmacro{footcite}}% + {\multicitedelim}% + {\usebibmacro{footcite:postnote}}% <<<2 + +\DeclareCiteCommand{\parencite}[\mkbibparens]% >>>2 + {\usebibmacro{prenote}}% + {\usebibmacro{citeindex}% + \usebibmacro{footcite}}% + {\multicitedelim}% + {\usebibmacro{footcite:postnote}}% <<<2 + +\DeclareCiteCommand{\footcite}[\mkbibfootnote]% >>>2 + {\usebibmacro{prenote}}% + {\usebibmacro{citeindex}% + \usebibmacro{footcite}}% + {\multicitedelim}% + {\usebibmacro{footcite:postnote}}% <<<2 + +\DeclareCiteCommand*{\footcite}[\mkbibfootnote]% >>>2 + {\usebibmacro{prenote}}% + {\usebibmacro{citeindex}% + \usebibmacro{footcite:citepages}% + \global\togglefalse{cbx:loccit}% + \usebibmacro{footcite:short}}% + {\multicitedelim}% + {\usebibmacro{footcite:postnote}}% <<<2 + +\DeclareCiteCommand{\footcitetext}[\mkbibfootnotetext]% >>>2 + {\usebibmacro{prenote}}% + {\usebibmacro{citeindex}% + \usebibmacro{footcite}}% + {\multicitedelim}% + {\usebibmacro{footcite:postnote}}% <<<2 + +\DeclareCiteCommand{\smartcite}[\iffootnote\mkbibparens\mkbibfootnote]% >>>2 + {\usebibmacro{prenote}}% + {\usebibmacro{citeindex}% + \usebibmacro{footcite}}% + {\multicitedelim}% + {\usebibmacro{footcite:postnote}}% <<<2 + +% <<<1 + +% apud >>>1 + +\newcommand{\addapud}{%% >>>2 + \renewcommand*{\multicitedelim}{% + \ifnumequal{\value{multicitecount}}{\value{multicitetotal}}% + {\space\bibstring{apud}}% + {\addsemicolon}% + \space}% + \renewcommand*{\textcitedelim}{% + \ifnumequal{\value{multicitecount}}{\value{multicitetotal}}% + {\addspace\bibstring{apud}}% + {\addsemicolon}% + \space}% +}% <<<2 + +\newcommand{\addand}{%% >>>2 + \renewcommand*{\multicitedelim}{% + \ifnumequal{\value{multicitecount}}{\value{multicitetotal}}% + {\space\bibstring{and}}% + {\addsemicolon}% + \space}% + \renewcommand*{\textcitedelim}{% + \ifnumequal{\value{multicitecount}}{\value{multicitetotal}}% + {\addspace\bibstring{and}}% + {\addsemicolon}% + \space}% +}% <<<2 + +\DeclareCiteCommand{\@apud}[\mkbibfootnote]% >>>2 + {\iffieldundef{prenote}% + {}% + {\printfield[uppercasecite]{prenote}% + \addspace\bibstring{apud}\addspace}}% + {\usebibmacro{citeindex}% + \usebibmacro{footcite:short}}% + {\setunit{\multicitedelim}}% + {\usebibmacro{postnote}}% <<<2 + +\DeclareMultiCiteCommand{\apud}[\addapud\mkbibfootnote]% >>>2 + {\@apud}% + {\setunit{\multicitedelim}% +}% <<<2 + +% <<<1 + +% textcite >>>1 + +\renewbibmacro*{textcite}{% >>>2 + \ifnameundef{labelname}% + {\printfield[citetitle]{labeltitle}}% + {\printnames{labelname}}}% <<<2 + +\newbibmacro*{textcite:init}{% >>>2 + \citetrackerfalse% + \pagetrackerfalse% + \iffirstcitekey% + {\global\undef\cbx@lasthash}% + {}}% <<<2 + +\newbibmacro*{textcite:count}{% >>>2 + \stepcounter{textcitetotal}% + \ifnumgreater{\value{uniquelist}}{\value{maxnames}}% + {\ifnumgreater{\value{uniquelist}}{\value{textcitemaxnames}}% + {\setcounter{textcitemaxnames}{\value{uniquelist}}}% + {}}% + {\ifnumless{\value{labelname}}{\value{maxnames}}% + {\ifnumgreater{\value{labelname}}{\value{textcitemaxnames}}% + {\setcounter{textcitemaxnames}{\value{labelname}}}% + {}}% + {\ifnumgreater{\value{maxnames}}{\value{textcitemaxnames}}% + {\setcounter{textcitemaxnames}{\value{maxnames}}}% + {}}}}% <<<2 + +\DeclareCiteCommand{\cbx@textcite}% >>>2 + {\usebibmacro{textcite:init}}% + {\iffieldequals{namehash}{\cbx@lasthash}% + {}% + {\iffirstcitekey% + {}% + {\textcitedelim}% + \stepcounter{textcitecount}% + \usebibmacro{textcite}% + \savefield{namehash}{\cbx@lasthash}}}% + {}% + {}% <<<2 + +\DeclareCiteCommand{\textcite}[\cbx@textcite@init\cbx@textcite\footcite]% >>>2 + {\usebibmacro{textcite:init}% + \gdef\cbx@savedkeys{}% + \DeferNextCitekeyHook}% + {\ifthenelse{\iffirstcitekey\AND\value{multicitetotal}>0}% + {\protected@xappto\cbx@footcite@args{% + (\thefield{multiprenote})(\thefield{multipostnote})}}% + {}% + \xappto\cbx@savedkeys{\thefield{entrykey},}% + \iffieldequals{namehash}{\cbx@lasthash}% + {}% + {\usebibmacro{textcite:count}% + \savefield{namehash}{\cbx@lasthash}}% + \ifnumequal{\value{footcitecount}}{\value{footcitetotal}}% + {\protected@xappto\cbx@textcite@args{{\cbx@savedkeys}}% + \protected@xappto\cbx@footcite@args{% + [\thefield{prenote}][\thefield{postnote}]{\cbx@savedkeys}}% + \iflastcitekey% + {\protected@xappto\cbx@textcite@args{\thefield{postpunct}}% + \protected@xappto\cbx@footcite@args{\nopunct}}% + {}}% + {}}% + {}% + {}% <<<2 + +% textcite has nested \DeclareCiteCommand definitions for +% textcite and we want to use % the normal textcite context +\DeclareDelimcontextAlias{cbx@textcite}{textcite}% + +\newrobustcmd{\cbx@textcite@init}[3]{% >>>2 + \setcounter{textcitetotal}{0}% + \setcounter{textcitecount}{0}% + \setcounter{textcitemaxnames}{0}% + \def\cbx@textcite@args{#1}\def\cbx@footcite@args{#2}#3% + \cbx@textcite@args\@empty\cbx@footcite@args\@empty}% <<<2 + +\DeclareMultiCiteCommand{\cbx@textcites}{\cbx@textcite}{}% +\DeclareMultiCiteCommand{\textcites}% + [\cbx@textcites@init\cbx@textcites\footcites]{\textcite}{}% + +\let\cbx@textcites@init\cbx@textcite@init% >>>2 +\pretocmd{\cbx@textcites@init}{% + \UseNextMultiCiteHook% + \AtNextMultiCite{% + \renewbibmacro{multiprenote}{}% + \renewbibmacro{multipostnote}{}}}{}{}% <<<2 + +% <<<1 + +\endinput% + + +% vim: set foldmarker=\ >>>,\ <<< : + |