diff options
author | Karl Berry <karl@freefriends.org> | 2016-05-12 21:33:14 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-05-12 21:33:14 +0000 |
commit | 3741767b117497328f24453307d8e21ee14d1cbd (patch) | |
tree | d8f0d73795420b37f564fea2ba9452acc6e92fd3 /Master/texmf-dist/tex/latex/biblatex-abnt/abnt.bbx | |
parent | 3f3d2167e6a42ba15e9bfe912d9141bdd8cbfd97 (diff) |
biblatex-abnt (12may16)
git-svn-id: svn://tug.org/texlive/trunk@41070 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.bbx | 1831 |
1 files changed, 1831 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/biblatex-abnt/abnt.bbx b/Master/texmf-dist/tex/latex/biblatex-abnt/abnt.bbx new file mode 100644 index 00000000000..6643588f03b --- /dev/null +++ b/Master/texmf-dist/tex/latex/biblatex-abnt/abnt.bbx @@ -0,0 +1,1831 @@ +%% 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.bbx}[2016/05/12\space v1.0\space ABNT biblatex citation style] +\RequireBiber[3] +\DeclareLanguageMapping{brazilian}{abnt-brazilian}% + +\RequireBibliographyStyle{standard}% + +\ExecuteBibliographyOptions{block=none,urldate=long,pagetracker}% + +\InitializeBibliographyStyle{\global\undef\bbx@lasthash}% + + +% ---------- +% Options +% ---------- + +% Option to make titles bold. +\newtoggle{bftitles}% +\DeclareBibliographyOption{bftitles}[true]{% + \settoggle{bftitles}{#1}}% + +% Option to use small caps in the bibliography. +\newtoggle{scbib}% +\DeclareBibliographyOption{scbib}[true]{% + \settoggle{scbib}{#1}}% + +% Option to hide "[s.l.]". +\newtoggle{nosl}% +\DeclareBibliographyOption{nosl}[true]{% + \settoggle{nosl}{#1}}% +\DeclareEntryOption[boolean]{nosl}[true]{% + \settoggle{nosl}{#1}}% + +% Option to hide "[s.n.]". +\newtoggle{nosn}% +\DeclareBibliographyOption{nosn}[true]{% + \settoggle{nosn}{#1}}% +\DeclareEntryOption[boolean]{nosn}[true]{% + \settoggle{nosn}{#1}}% + +% Option to hide "[S.l.: sn]". +\newtoggle{noslsn}% +\DeclareBibliographyOption{noslsn}[true]{% + \settoggle{noslsn}{#1}% + \settoggle{nosl}{#1}% + \settoggle{nosn}{#1}}% +\DeclareEntryOption[boolean]{noslsn}[true]{% + \settoggle{noslsn}{#1}% + \settoggle{nosl}{#1}% + \settoggle{nosn}{#1}}% + +% This is the dashed option from authorstyle.bbx, +% I changed it's name and made it default. +\newtoggle{repeatfields}% +\DeclareBibliographyOption[boolean]{repeatfields}[true]{% + \settoggle{repeatfields}{#1}% + \ifstrequal{#1}{true}% + {\renewbibmacro*{bbx:savehash}{}% + \renewbibmacro*{saveorghash}{}}% + {\ExecuteBibliographyOptions{pagetracker}% + \renewbibmacro*{bbx:savehash}{\savefield{fullhash}{\bbx@lasthash}}% + \renewbibmacro*{saveorghash}{\savelist{organization}{\bbx@lasthash}}}}% +\DeclareEntryOption[boolean]{repeatfields}[true]{% + \settoggle{repeatfields}{#1}}% + +% Option to use the original dashes instead of underscores. +\DeclareBibliographyOption[boolean]{usedashes}[true]{% + \ifstrequal{#1}{true}% + {\renewcommand*{\bibnamedash}{% + \ifdimless{\leftmargin}{0.75em}% + {\mbox{\textemdash\addspace}}% + {\makebox[\leftmargin][l]{% + \ifdimless{\leftmargin}{1.25em}% + {\textendash}% + {\textemdash}}}}}{}}% + +% Option to use hanging indentation. +\setlength{\bibhang}{0pt}% +\DeclareBibliographyOption{indent}[true]{% + \ifstrequal{#1}{true}% + {\setlength{\bibhang}{\ifnumequal{\parindent}{0}{1em}{\parindent}}}% + {}}% + + +% ---------- +% DeclareSortingScheme +% ---------- + +\DeclareSortingScheme{nty}{ + \sort{ + \field{presort}% + }% + \sort[final]{ + \field{sortkey}% + }% + \sort{ + \field{sortname}% + \field{author}% + \field{editor}% + \field{organization}% + \field{sorttitle}% + \field{issuetitle}% + \field{title}% + \field{subtitle}% + }% + \sort{ + \field{nameaddon}% + \field{sorttitle}% + \field{issuetitle}% + \field{title}% + \field{subtitle}% + }% + \sort{ + \field{sorttitle}% + \field{issuetitle}% + \field{title}% + \field{subtitle}% + }% + \sort{ + \field{sortyear}% + \field{year}% + }% + \sort{ + \field[padside=left,padwidth=4,padchar=0]{volume}% + \literal{0000}% + }% +}% + + +% ---------- +% DeclareSourcemap +% ---------- + +% This maps some fields used in abntex2cite to biblatex fields. +\DeclareSourcemap{ + \maps[datatype=bibtex]{ + \map{ + \step[fieldsource=conference-number,fieldtarget=number] + \step[fieldsource=conference-year,fieldtarget=eventdate] + \step[fieldsource=conference-location,fieldtarget=venue] + \step[fieldsource=conference-number,fieldtarget=number] + \step[fieldsource=org-short,fieldtarget=shortauthor] + \step[fieldsource=urlaccessdate,fieldtarget=urldate] + \step[fieldsource=year-presented,fieldtarget=eventyear] + \step[fieldsource=furtherresp,fieldtarget=titleaddon] + \step[typesource=journalpart,typetarget=supperiodical] + }% + \map[overwrite=false]{ + \step[fieldsource=reprinted-from, final] + \step[fieldset=related, origfieldval] + }% + \map[overwrite=false]{ + \step[fieldsource=reprinted-text, final] + \step[fieldset=relatedtype, fieldvalue={reprintfrom}] + }% + \map{ + \pertype{patent}% Use the organization as sourcekey for patents + \step[fieldsource=organization, final] + \step[fieldset=sortkey, origfieldval] + }% + \map[overwrite=false]{ + \pertype{phdthesis}% + \pertype{mastersthesis}% + \pertype{monography}% + \step[fieldset=bookpagination, fieldvalue={sheet}] + }% + }% +}% + +\DeclareDatamodelFields[type=field,datatype=literal]{ + section, + illustrated, + dimensions, + reprinted-text, +}% + +\DeclareDatamodelEntryfields[monography]{ + location, + author, + chapter + pages, + pagetotal, + bookpagination, + institution, + title, + type, + note, + isbn, + doi, + eprint, + url, + addendum, + pubstate, + pageref, + date}% + + +% ---------- +% newcommand +% ---------- + +\newcommand{\abntnum}[1]{\ifrmnum{#1}{\rmntonum{#1}}{#1}} + +% Use "John Doe, Jack Roe and Joe Blow" for byeditor+others, +% "Doe; Roe; Blow" everywhere else. +\newtoggle{byeditor+others} +\renewcommand*{\multinamedelim}{\iftoggle{byeditor+others}{\addcomma\addspace}{\addsemicolon\addspace}}% +\renewcommand*{\finalnamedelim}{\iftoggle{byeditor+others}{\addspace\bibstring{and}\addspace}{\addsemicolon\addspace}}% + +\renewcommand*{\nameyeardelim}{\addcomma\addspace}% + +\renewcommand*{\subtitlepunct}{\addcolon\addspace}% + +% Use a period to separate the backref from what comes before +% E.g.: "1973. p. 33–79. Ver p. 2." +\renewcommand*{\bibpagerefpunct}{\addperiod\addspace}% + +% A command to make the first word in a sentence uppercase, +% used for the title when a book has no author. +\newcommand\FirstWordUpper[1]{\@firstwordupper#1 \@nil}% +\newcommand\@firstwordupper{}% +\def\@firstwordupper#1 #2\@nil{\MakeUppercase{#1} #2\unskip}% + +% A command to print the first word in a sentence in small caps, +% used for the title when a book has no author. +\newcommand\FirstWordSC[1]{\@firstwordsc#1 \@nil}% +\newcommand\@firstwordsc{}% +\def\@firstwordsc#1 #2\@nil{\textsc{#1} #2\unskip}% + +% A command to print the first word in a sentence in lowercase and in small caps. +\newcommand\FirstWordLCSC[1]{\@firstwordlcsc#1 \@nil}% +\newcommand\@firstwordlcsc{}% +\def\@firstwordlcsc#1 #2\@nil{\textsc{\MakeLowercase{#1}} #2\unskip}% + +% This has to do with the dashed option +\newbool{bbx@inset}% + +% This replaces repeated authors' names. +\renewcommand*{\bibnamedash}{\underline{\hspace*{4em}}\addperiod\addspace}% + +% Use or not small caps for acronyms, depending on the scbib option. +\renewcommand*{\mkbibacro}[1]{% + \iftoggle{scbib}% + {\textsc{\MakeLowercase{#1}}}% + {#1}}% + + +% ---------- +% DeclareNameFormat +% ---------- + +\DeclareNameFormat{LAST-first}{% + \nameparts{#1}% + \ifgiveninits{% + \usebibmacro{name:family-given}{% + \iftoggle{scbib}{% + \textsc{\namepartfamily}% + }{% + \MakeUppercase{\namepartfamily}% + }% + }% + {\namepartgiveni}% + {\namepartprefix}% + {\namepartsuffix}% + }{% + \usebibmacro{name:family-given}{% + \iftoggle{scbib}{% + \textsc{\MakeLowercase{\namepartfamily}}% + }{% + \MakeUppercase{\namepartfamily}% + }% + }% + {\namepartgiven}% + {\namepartprefix}% + {\namepartsuffix}% + }% + \usebibmacro{name:andothers}% +}% + +\DeclareNameFormat{full}{% + \nameparts{#1}% + \usebibmacro{name:given-family} + {\namepartfamily} + {\namepartgiven} + {\namepartprefix} + {\namepartsuffix}} + +\DeclareNameAlias{default}{LAST-first}% + +\DeclareNameAlias{byauthor}{full}% +\DeclareNameAlias{bybookauthor}{byauthor}% +\DeclareNameAlias{byeditor}{full}% +\DeclareNameAlias{byeditora}{byeditor}% +\DeclareNameAlias{byeditorb}{byeditor}% +\DeclareNameAlias{byeditorc}{byeditor}% +\DeclareNameAlias{bytranslator}{full}% + +\DeclareNameAlias{withcommentator}{given-family}% +\DeclareNameAlias{withannotator}{given-family}% +\DeclareNameAlias{withintroduction}{given-family}% +\DeclareNameAlias{withforeword}{given-family}% +\DeclareNameAlias{withafterword}{given-family}% + +% ---------- +% DeclareFieldFormat +% ---------- + +% Use bold or italics for the main titles, depending on what the user chose. +\DeclareFieldFormat{journaltitle}{\iftoggle{bftitles}{\addspace\mkbibbold{#1}\isdot}{\addspace\mkbibemph{#1}\isdot}}% +\DeclareFieldFormat{issuetitle}{\iftoggle{bftitles}{\addspace\mkbibbold{#1}\isdot}{\addspace\mkbibemph{#1}\isdot}}% +\DeclareFieldFormat{maintitle}{\iftoggle{bftitles}{\addspace\mkbibbold{#1}\isdot}{\addspace\mkbibemph{#1}\isdot}}% +\DeclareFieldFormat{booktitle}{\iftoggle{bftitles}{\addspace\mkbibbold{#1}\isdot}{\addspace\mkbibemph{#1}\isdot}}% +\DeclareFieldFormat{citetitle}{\iftoggle{bftitles}{\addspace\mkbibbold{#1}\isdot}{\addspace\mkbibemph{#1}\isdot}}% +\DeclareFieldFormat*{title}{\iftoggle{bftitles}{\addspace\mkbibbold{#1}\isdot}{\addspace\mkbibemph{#1}\isdot}}% + +% Use normal text for the title in these entries. +\DeclareFieldFormat + [article, inbook, incollection, bookinbook, inproceedings, unpublished] + {title}{\addspace #1\isdot}% + +\DeclareNumChars*{,-/}% Strings with these characters will still be considered numbers. + +% Add "n." and "v." abbreviations and make them, along with "p.", always lowercase, +% even if preceded by a period. E.g.: "London: Routledge, 2009. p. 235–250." +\DeclareFieldFormat*{number}{% + \ifnumerals{#1}% + {\addspace \MakeLowercase{\bibstring{number}}~\abntnum{#1}}% + {\addspace #1\isdot}}% + +\DeclareFieldFormat[book, proceedings, inproceedings, misc]{number}{\addcomma\addspace #1}% + +\DeclareFieldFormat*{volume}{ + \ifnumerals{#1}% + {\addspace \MakeLowercase{\bibstring{volume}}~#1}% + {\addspace #1\isdot}}% + +\DeclareFieldFormat*{chapter}{% + \ifnumerals{#1}% + {\addspace \MakeLowercase{\bibstring{chapter}~#1}}% + {\addspace #1\isdot}}% + +\DeclareFieldFormat{edition}{ + \ifnumerals{#1}% + {\addspace #1\adddot\addspace\bibstring{edition}}% + {\addspace #1\isdot}}% + +\DeclareFieldFormat*{pages}{\MakeLowercase{\mkpageprefix[bookpagination]{#1}}}% +\DeclareFieldFormat*{pagetotal}{\MakeLowercase{\mkpagetotal[bookpagination]{#1}}}% +% Always use "f." for the pagination in thesis. +%\DeclareFieldFormat[thesis]{pagetotal}{\MakeLowercase{#1 \bibstring{sheet}}}% + +\DeclareFieldFormat{illustrated}{\addspace #1\isdot}% + +\DeclareFieldFormat{url}{\bibstring{url}\addcolon\addspace\url{<#1>}}% +\DeclareFieldFormat{urldate}{\bibstring{urlseen}\addcolon\addspace #1}% + +\DeclareFieldFormat*{note}{\addspace #1\addperiod\addspace}% + +\DeclareFieldFormat{mathesis}{\bibstring{mathesis}}% +\DeclareFieldFormat{phdthesis}{\bibstring{phdthesis}}% + +\DeclareFieldFormat[monography]{type}{\bibstring{monography}\addspace\printtext[parens]{#1}}% + +\DeclareFieldFormat{uppercase}{\iftoggle{scbib}{\textsc{\smartlowercase{#1}}}{\smartuppercase{#1}}}% +\DeclareFieldFormat{lowercase}{\smartlowercase{#1}}% +\DeclareFieldFormat{upperfirst}{% + \iftoggle{scbib}{% + \ifgiveninits{% + \normalfont\FirstWordSC{#1}% + }{% + \normalfont\FirstWordLCSC{#1}% + }% + }{% + \normalfont\FirstWordUpper{#1}% + }% +}% +\DeclareFieldFormat{noformat}{\normalfont{#1}}% + +\DeclareFieldFormat{nameaddon}{\addspace #1}% + +\DeclareFieldFormat{relatedstring:reprintfrom}{\addspace #1\addcolon\addspace}% +\DeclareFieldFormat{relatedstring:default}{\addspace #1\addcolon\addspace}% + +\DeclareFieldFormat{origlanguage}{% + \ifbibstring{#1}% + {\bibxstring{#1}}% + {\ifbibstring{from#1}% + {\bibxstring{from#1}}% + {#1}}% +}% + +\DeclareListFormat{uppercase}{% + \usebibmacro{list:delim}{#1}% + \iftoggle{scbib}{% + \ifgiveninits{% + \normalfont\smartuppercase{#1}% + }{% + \normalfont\smartlcsc{#1}% + }% + }{% + \normalfont\FirstWordUpper{#1}% + }% + \isdot% + \usebibmacro{list:andothers}}% + +\DeclareListFormat{upperfirst}{% + \usebibmacro{list:delim}{#1}% + \iftoggle{scbib}{% + \ifgiveninits{% + \normalfont\FirstWordSC{#1}% + }{% + \normalfont\FirstWordLCSC{#1}% + }% + }{% + \normalfont\FirstWordUpper{#1}% + }% + \isdot% + \usebibmacro{list:andothers} +}% + + +% ---------- +% newbibmacro +% ---------- + +% Always use a period after the year. +\renewbibmacro*{date}{\printdate\addperiod}% + +% Use a comma after journal volumes. +\renewbibmacro*{volume+number+eid}{% + \printfield{volume}% + \setunit*{\addcomma\addspace}% + \printfield{number}% + \setunit{\addcomma\addspace}% + \printfield{eid}}% + +% Don't use parenthesis around the date. +\renewbibmacro*{issue+date}{% + \iffieldundef{issue}% + {\usebibmacro{date}}% + {\printfield{issue}% + \setunit*{\addspace}% + \usebibmacro{date}}% + \newunit}% + +% Add a comma after journal names and remove the date. +\renewbibmacro*{journal+issuetitle}{% + \usebibmacro{journal}% + \setunit*{\addcomma\addspace}% + \iffieldundef{series}% + {}% + {\newunit% + \printfield{series}% + \setunit{\addspace}}% + \usebibmacro{volume+number+eid}% + \newunit}% + +% Remove the parenthesis around the backref. +\renewbibmacro*{pageref}{% + \iflistundef{pageref}% + {}% + {\printtext{% \printtext[parens]{% + \ifnumgreater{\value{pageref}}{1}% + {\bibstring{backrefpages}\ppspace}% + {\bibstring{backrefpage}\ppspace}% + \printlist[pageref][-\value{listtotal}]{pageref}}}}% + +\newbibmacro*{titleiskey}[2]{% +\ifboolexpr{% + test {\ifnameundef{author}}% + and + test {\ifcsundef{saveded}}% + and + test {\ifcsundef{savedorg}}% + and + test {\iffieldundef{eventtitle}}% +}% + {#1}% + {#2}}% + +\renewbibmacro*{title}{% + \ifboolexpr{% + test {\iffieldundef{title}}% + and + test {\iffieldundef{subtitle}}% + } + {\global\undef\bbx@lasttitle + \global\undef\bbx@lastsubtitle}% + {\usebibmacro{bbx:titledashcheck}% + {\unspace\bibnamedash}% + {\usebibmacro{bbx:savetitle}% + \usebibmacro{bbx:savesubtitle}% + \printtext[title]{% + \usebibmacro{titleiskey}% + {\unspace\printfield[upperfirst]{title}}% + {\iffieldundef{maintitle}% + {\printfield[titlecase]{title}}% + {\printfield[noformat]{title}}}% + \normalfont{\setunit*{\subtitlepunct}% + \printfield[noformat]{subtitle}% + \setunit{\addperiod\addspace}}}% + \newunit}}% + \printfield{titleaddon}}% + +\newbibmacro*{inmaintitle}{% + \iffieldundef{maintitle}{}{% + \usebibmacro{in:}% + \iftoggle{repeatfields}% + {\addspace\usebibmacro{author/editor+others}}% + {\addspace\bibnamedash}% + \newunit\newblock% + \usebibmacro{maintitle}% + }% +}% + +\renewbibmacro*{maintitle+booktitle}{% + \iffieldundef{maintitle}% + {}% + {\usebibmacro{maintitle}% + \newunit\newblock + \iffieldundef{volume}% + {}% + {\printfield{volume}% + \printfield{part}% + \setunit{\addcolon\addspace}}}% + \usebibmacro{booktitle}% + \newunit}% + +\newbibmacro*{maintitle/booktitle}{% + \iffieldundef{maintitle}% + {\usebibmacro{booktitle}}% + {\usebibmacro{maintitle}} +}% + +\renewbibmacro*{booktitle}{% + \ifboolexpr{ + test {\iffieldundef{booktitle}}% + and + test {\iffieldundef{booksubtitle}}% + }% + {}% + {\printtext[booktitle]{% + \printfield[titlecase]{booktitle}% + \normalfont{\setunit*{\subtitlepunct}}% + \printfield[noformat]{booksubtitle}}% + \newunit}% + \printfield{booktitleaddon}}% + +\renewbibmacro*{maintitle}{% + \ifboolexpr{ + test {\iffieldundef{maintitle}} + and + test {\iffieldundef{mainsubtitle}} + } + {} + {\printtext[maintitle]{% + \printfield[titlecase]{maintitle}% + \normalfont{\setunit*{\subtitlepunct}}% + \printfield[noformat]{mainsubtitle}}% + \newunit}% + \printfield{maintitleaddon}} + +\newbibmacro*{publisher}{% + \iflistundef{publisher}% + {\iftoggle{nosn}{}{\printtext[brackets]{\bibstring{sinenomine}}}}% + {\printlist{publisher}}}% + +\newbibmacro*{location}{% + \iflistundef{location}% + {\iftoggle{nosl}{}{\printtext[brackets]{\bibstring{sineloco}}}}% + {\printlist{location}}}% + +\newbibmacro*{venue}{% + \iffieldundef{venue}% + {\iftoggle{nosl}{}{\printtext[brackets]{\bibstring{sineloco}}}}% + {\printfield{venue}}}% + +\renewbibmacro*{location+date}{% + \usebibmacro{location}% + \setunit*{\addcomma\addspace}% + \usebibmacro{date}% + \newunit +}% + +\renewbibmacro*{series+number}{% + \iffieldundef{series}{}{% + \printtext[parens]{% + \printfield{series}% + \setunit*{\addspace}% + \printfield{number}% + \newunit}% + }% + }% + +% Add s.l. and s.n. when fields are missing. +\renewbibmacro*{publisher+location+date}{% + \ifboolexpr{% + test {\iflistundef{publisher}}% + and + test {\iflistundef{location}}% + and + not test {\iftoggle{nosl}}% + and + not test {\iftoggle{nosn}}% + }% + {\printtext[brackets]{\bibstring{sineloco}% + \setunit{\addcolon\addnbspace}% + \bibstring{sinenomine}}}% + {\ifboolexpr{% + test {\ifnameundef{author}}% + and + test {\ifnameundef{editor}}% + and + test {\iflistundef{publisher}}% + and + not test {\iflistundef{organization}}% + }% + {\usebibmacro{location}}% + {\usebibmacro{location}% + \setunit*{\addcolon\addspace}% + \usebibmacro{publisher}}}% + \setunit*{\addcomma\addspace}% + \usebibmacro{date}% + \newunit}% + +\renewbibmacro*{url+urldate}{% + \usebibmacro{url}% + \iffieldundef{urlyear}% + {}% + {\setunit*{\addperiod\addspace}% + \usebibmacro{urldate}}}% + +\newbibmacro*{mathesis}{% + \iffieldundef{type}{% + \bibstring{dissertation}\addspace\printtext[parens]{\bibstring{mathesis}}% + }{% + \bibstring{dissertation}\addspace\printtext[parens]{\printfield{type}}% + }% +}% + +\newbibmacro*{phdthesis}{% + \iffieldundef{type}{% + \bibstring{thesis}\addspace\printtext[parens]{\bibstring{phdthesis}}% + }{% + \bibstring{thesis}\addspace\printtext[parens]{\printfield{type}}% + }% +}% + +\newbibmacro*{inbookauthor+others}{% + \usebibmacro{in:}% + \ifboolexpr{% + test {\ifnameundef{author}}% + and + test {\ifcsundef{saveded}}% + and + test {\ifcsundef{savedorg}}% + }% + {}% + {\ifboolexpr{% + test {\ifnameundef{bookauthor}}% + or + test {\ifnamesequal{author}{bookauthor}}% + }% + {\iftoggle{repeatfields}% + {\usebibmacro{author/editor+others}}% + {\bibnamedash}}% + {\printnames{bookauthor}}}% +}% + +% For @bookinbook entries: use the bookauthor when available, +% else use editor+others. +\newbibmacro*{bookauthor/editor+others}{% + \ifnameundef{bookauthor}{% + \usebibmacro{editor+others}}% + {\printnames{bookauthor}}}% + +\renewbibmacro*{periodical}{% + \iffieldundef{title}% + {}% + {\iffieldundef{issue}{% + \printtext[title]{% + \unspace\printfield[upperfirst]{title}% + \normalfont{\setunit*{\subtitlepunct}% + \printfield[noformat]{subtitle}}}% + }% + {\printtext[title]{% + \printfield[titlecase]{title}% + \normalfont{\setunit*{\subtitlepunct}% + \printfield[noformat]{subtitle}}}}% + }% +}% + +\renewbibmacro*{issue}{% + \iffieldundef{issuetitle}% + {}% + {\printtext[issuetitle]{% + \printfield[upperfirst]{issuetitle}% + \setunit*{\subtitlepunct}% + \printfield[noformat]{issuesubtitle}}}}% + +\newbibmacro*{organization}{% + \iflistundef{organization}% + {\global\undef\bbx@lastorg}% + {\usebibmacro{bbx:dashcheck}% + {\bibnamedash}% + {\usebibmacro{bbx:saveorg}% + \printlist[uppercase]{organization}}% + \savelistcs*{organization}{savedorg}% + \clearlist{organization}% + \newunit\newblock% + \printfield{nameaddon}}% +}% + +\renewbibmacro*{author}{% + \ifboolexpr{ + test \ifuseauthor + and + not test {\ifnameundef{author}}% + }{% + \usebibmacro{bbx:dashcheck}{% + \bibnamedash + }{% + \usebibmacro{bbx:savehash}% + \printnames{author}% + }% + \addspace + \usebibmacro{authorstrg}% + \newunit\newblock + \printfield{nameaddon}% + }{% + \global\undef\bbx@lasthash + }% +}% + +\renewbibmacro*{editor+others}{% + \ifboolexpr{ + test \ifuseeditor + and + not test {\ifnameundef{editor}}% + }{% + \usebibmacro{bbx:dashcheck}{% + \bibnamedash% + }{% + \usebibmacro{bbx:savehash}% + \printnames{editor}% + \setunit{\addperiod\addspace}% + \printtext[parens]{\usebibmacro{editor+othersstrg}}% + }% + \savenamecs*{editor}{saveded}% + \clearname{editor}% + }{% + \global\undef\bbx@lasthash% + \usebibmacro{organization}% + }% +}% + +\newbibmacro*{in:editor+others}{% + \usebibmacro{in:} + \addspace + \ifnameundef{editor}{% + \printlist[uppercase]{organization} + }{% + \printnames{editor}% + \setunit*{\addperiod\addspace}% + \printtext[parens]{\usebibmacro{editor+othersstrg}}% + \clearname{editor}% + } +} + +\newbibmacro*{in:eventtitle/organization/editor}{% + \usebibmacro{in:}% + \iffieldundef{eventtitle}{% + \ifnameundef{editor}{% + \printlist[uppercase]{organization}% + \clearlist{organization} + }{% + \printname{editor} + }% + }{% + \printfield[uppercase]{eventtitle} + } +} + +\newbibmacro*{editor+others/organization}{% + \ifnameundef{editor}% + {\usebibmacro{organization}}% + {\usebibmacro{editor+others}}}% + +\newbibmacro*{author/organization}{% + \ifnameundef{author}% + {\usebibmacro{organization}}% + {\usebibmacro{author}}}% + +\newbibmacro*{organization/eventtitle}{% + \iffieldundef{eventtitle}% + {\usebibmacro{organization}}% + {\printfield[uppercase]{eventtitle}}}% + +\renewbibmacro*{byeditor+others}{% + \toggletrue{byeditor+others} + \ifnameundef{editor}% + {}% + {\usebibmacro{byeditor+othersstrg}% + \setunit*{\addspace}% + \printnames[byeditor]{editor}% + \clearname{editor}% + \newunit}% + \usebibmacro{byeditorx}% + \usebibmacro{bytranslator+others}} + \togglefalse{byeditor+others}% + +\renewbibmacro*{related:reprintfrom}[1]{% + \entrydata*{#1}{% + \usedriver + {\ifnameundef{savedauthor}% + {\ifnameundef{savededitor}% + {}% + {\ifnamesequal{editor}{savededitor}% + {\clearname{editor}}% + {}}}% + {\ifnamesequal{author}{savedauthor}% + {\clearname{author}}% + {}}% + \renewbibmacro*{related:init}{}% + \DeclareNameAlias{sortname}{default}% + \ifbibmacroundef{date+extrayear}% + {}% + {\renewbibmacro*{date+extrayear}{}% + \renewbibmacro*{date}{\printdate}}% + \renewbibmacro*{pageref}{}}% + {\thefield{entrytype}}}}% + +\newbibmacro*{language}{% + \ifboolexpr{% + test {\iflistundef{language}}% + and + test {\iffieldundef{origlanguage}}% + }% + {}% + {% + \printtext{\printlist{language}\addspace\printfield{origlanguage}}% + }% +}% + +\newbibmacro{journal+section}{% + \usebibmacro{journal}% + \iffieldundef{section}% + {}% + {\setunit{\addspace\textendash\addspace}% + \printfield{section}}% +}% + +\newbibmacro*{bbx:savehash}{% + \savefield{fullhash}{\bbx@lasthash}}% + +\newbibmacro*{bbx:saveorg}{% + \savelist{organization}{\bbx@lastorg}}% + +\newbibmacro*{bbx:savetitle}{% + \savefield{title}{\bbx@lasttitle}}% + +\newbibmacro*{bbx:savesubtitle}{% + \savefield{subtitle}{\bbx@lastsubtitle}}% + +\newtoggle{isdashed}% + +\newbibmacro*{bbx:dashcheck}[2]{% + \ifboolexpr{ + (test {\iffieldequals{fullhash}{\bbx@lasthash}}% + or + test {\iflistequals{organization}{\bbx@lastorg}}% + ) + and + not test \iffirstonpage + and + not test {\iftoggle{repeatfields}}% + and + ( + not bool {bbx@inset}% + or + test {\iffieldequalstr{entrysetcount}{1}}% + ) + }% + {\settoggle{isdashed}{true}#1}% + {\settoggle{isdashed}{false}#2}}% + +\newbibmacro*{bbx:titledashcheck}[2]{% + \iftoggle{isdashed}{% + \ifboolexpr{ + test {\iffieldequals{title}{\bbx@lasttitle}} + and + test {\iffieldequals{subtitle}{\bbx@lastsubtitle}} + } + {#1} + {#2} + }{% + #2 + } +}% + +\renewbibmacro*{begrelated}{% + \booltrue{bbx@inset}}% + + +% ---------- +% Drivers +% ---------- + +\DeclareBibliographyDriver{article}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author/organization}% + \setunit{\labelnamepunct}\newblock + \usebibmacro{title}% + \newunit + \printlist{language}% + \newunit\newblock + \usebibmacro{byauthor}% + \newunit\newblock + \usebibmacro{byeditor+others}% + \newunit + \usebibmacro{bytranslator+others}% + \newunit\newblock + \printfield{version}% + \newunit\newblock + \iffieldundef{relatedtype}{}{% + \bibstring{\strfield{relatedtype}}}% + \setunit*{\addcolon\addspace}% + \usebibmacro{journal+section}% + \setunit*{\addcomma\addspace}% + \printlist{publisher}% + \setunit*{\addcomma\addspace}% + \printlist{location}% + \setunit*{\addcomma\addspace}% + \usebibmacro{volume+number+eid}% + \setunit{\addcomma\addspace}% + \printfield{pages}% + \setunit*{\addcomma\addspace}% + \printfield{pagetotal}% + \setunit{\addcomma\addspace}% + \usebibmacro{date}% + \newunit + \printfield{note}% + \setunit{\addcolon\addspace}% + \usebibmacro{issue}% + \newunit\newblock + \iftoggle{bbx:isbn}% + {\printfield{issn}}% + {}% + \newunit\newblock + \usebibmacro{doi+eprint+url}% + \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related}% + {\usebibmacro{related:init}% + \usebibmacro{related}}% + {}% + \usebibmacro{finentry}}% + +\DeclareBibliographyDriver{mvbook}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author/editor+others}% + \setunit{\labelnamepunct}\newblock + \usebibmacro{title}% + \newunit\newblock + \usebibmacro{inmaintitle}% + \newunit\newblock + \usebibmacro{byeditor+others}% + \newunit\newblock + \printfield{edition}% + \newunit\newblock + \usebibmacro{publisher+location+date}% + \newunit\newblock + \printfield{volumes}% + \newunit\newblock + \usebibmacro{chapter+pages}% + \newunit\newblock + \printfield{pagetotal}% + \setunit*{\addcomma\addspace}% + \printfield{illustrated}% + \setunit*{\addcomma\addspace}% + \printfield{dimensions}% + \newunit\newblock + \usebibmacro{series+number}% + \newunit\newblock + \printfield{howpublished}% + \newunit\newblock + \usebibmacro{language}% + \newunit\newblock + \printfield{note}% + \newunit\newblock + \iftoggle{bbx:isbn}% + {\printfield{isbn}}% + {}% + \newunit\newblock + \usebibmacro{doi+eprint+url}% + \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related}% + {\usebibmacro{related:init}% + \usebibmacro{related}}% + {}% + \usebibmacro{finentry}}% + +\DeclareBibliographyDriver{book}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author/editor+others}% + \setunit{\labelnamepunct}\newblock + \usebibmacro{title}% + \newunit\newblock + \usebibmacro{inmaintitle}% + \newunit\newblock + \usebibmacro{byeditor+others}% + \newunit\newblock + \printfield{edition}% + \newunit\newblock + \usebibmacro{publisher+location+date}% + \newunit\newblock + \printfield{volume}% + \printfield{part}% + \setunit{\addcomma\addspace} + \printfield{chapter}% + \setunit*{\addcomma\addspace} + \printfield{pages} + \newunit\newblock + \printfield{pagetotal}% + \setunit*{\addcomma\addspace}% + \printfield{illustrated}% + \setunit*{\addcomma\addspace}% + \printfield{dimensions}% + \newunit\newblock + \usebibmacro{series+number}% + \newunit\newblock + \printfield{howpublished}% + \newunit\newblock + \usebibmacro{language}% + \newunit\newblock + \printfield{note}% + \newunit\newblock + \iftoggle{bbx:isbn}% + {\printfield{isbn}}% + {}% + \newunit\newblock + \usebibmacro{doi+eprint+url}% + \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related}% + {\usebibmacro{related:init}% + \usebibmacro{related}}% + {}% + \usebibmacro{finentry}}% + +\DeclareBibliographyDriver{inbook}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author/editor+others}% + \setunit{\labelnamepunct}\newblock + \usebibmacro{title}% + \newunit + \usebibmacro{inbookauthor+others}% + \newunit\newblock + \usebibmacro{maintitle/booktitle}% + \newunit + \usebibmacro{byeditor+others}% + \newunit\newblock + \printfield{edition}% + \newunit\newblock + \usebibmacro{publisher+location+date}% + \newunit + \printfield{volume}% + \printfield{part}% + \setunit*{\addcomma\addspace} + \usebibmacro{chapter+pages}% + \newunit\newblock + \usebibmacro{series+number}% + \newunit\newblock + \printfield{note}% + \newunit\newblock + \iftoggle{bbx:isbn}% + {\printfield{isbn}}% + {}% + \newunit\newblock + \usebibmacro{doi+eprint+url}% + \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related}% + {\usebibmacro{related:init}% + \usebibmacro{related}}% + {}% + \usebibmacro{finentry}}% + +\DeclareBibliographyDriver{mvcollection}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{editor+others}% + \setunit{\labelnamepunct}\newblock + \usebibmacro{title}% + \newunit\newblock + \usebibmacro{inmaintitle}% + \newunit\newblock + \usebibmacro{byeditor+others}% + \newunit\newblock + \printfield{edition}% + \newunit\newblock + \usebibmacro{publisher+location+date}% + \newunit\newblock + \printfield{volumes}% + \newunit\newblock + \usebibmacro{chapter+pages}% + \newunit\newblock + \printfield{pagetotal}% + \setunit*{\addcomma\addspace}% + \printfield{illustrated}% + \setunit*{\addcomma\addspace}% + \printfield{dimensions}% + \newunit\newblock + \usebibmacro{series+number}% + \newunit\newblock + \printfield{howpublished}% + \newunit\newblock + \usebibmacro{language}% + \newunit\newblock + \printfield{note}% + \newunit\newblock + \iftoggle{bbx:isbn}% + {\printfield{isbn}}% + {}% + \newunit\newblock + \usebibmacro{doi+eprint+url}% + \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related}% + {\usebibmacro{related:init}% + \usebibmacro{related}}% + {}% + \usebibmacro{finentry}}% + +\DeclareBibliographyDriver{collection}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{editor+others}% + \setunit{\labelnamepunct}\newblock + \usebibmacro{title}% + \newunit\newblock + \usebibmacro{inmaintitle}% + \newunit\newblock + \usebibmacro{byeditor+others}% + \newunit\newblock + \printfield{edition}% + \newunit\newblock + \usebibmacro{publisher+location+date}% + \newunit\newblock + \printfield{volume}% + \printfield{part}% + \setunit{\addcomma\addspace} + \printfield{chapter}% + \setunit*{\addcomma\addspace} + \printfield{pages} + \newunit\newblock + \printfield{pagetotal}% + \setunit*{\addcomma\addspace}% + \printfield{illustrated}% + \setunit*{\addcomma\addspace}% + \printfield{dimensions}% + \newunit\newblock + \usebibmacro{series+number}% + \newunit\newblock + \printfield{howpublished}% + \newunit\newblock + \usebibmacro{language}% + \newunit\newblock + \printfield{note}% + \newunit\newblock + \iftoggle{bbx:isbn}% + {\printfield{isbn}}% + {}% + \newunit\newblock + \usebibmacro{doi+eprint+url}% + \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related}% + {\usebibmacro{related:init}% + \usebibmacro{related}}% + {}% + \usebibmacro{finentry}}% + +\DeclareBibliographyDriver{incollection}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author}% + \setunit{\labelnamepunct}\newblock + \usebibmacro{title}% + \newunit\newblock + \usebibmacro{in:editor+others}% + \newunit\newblock + \usebibmacro{maintitle/booktitle}% + \newunit + \usebibmacro{byeditor+others}% + \newunit\newblock + \printfield{edition}% + \newunit\newblock + \usebibmacro{publisher+location+date}% + \newunit + \printfield{volume}% + \printfield{part} + \newunit\newblock + \usebibmacro{series+number}% + \newunit\newblock + \printfield{note}% + \newunit\newblock + \usebibmacro{chapter+pages}% + \newunit\newblock + \iftoggle{bbx:isbn}% + {\printfield{isbn}}% + {}% + \newunit\newblock + \usebibmacro{doi+eprint+url}% + \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related}% + {\usebibmacro{related:init}% + \usebibmacro{related}}% + {}% + \usebibmacro{finentry}}% + +\DeclareBibliographyDriver{periodical}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{editor+others/organization}% + \setunit{\labelnamepunct}\newblock + \usebibmacro{title}% + \newunit\newblock + \usebibmacro{publisher+location+date}% + \newunit + \printlist{language}% + \newunit\newblock + \usebibmacro{byeditor}% + \newunit\newblock + \usebibmacro{chapter+pages}% + \setunit*{\addcomma\addspace}% + \printfield{pagetotal}% + \newunit\newblock + \printfield{note}% + \newunit\newblock + \iftoggle{bbx:isbn}% + {\printfield{issn}}% + {}% + \newunit\newblock + \usebibmacro{doi+eprint+url}% + \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related}% + {\usebibmacro{related:init}% + \usebibmacro{related}}% + {}% + \usebibmacro{finentry}}% + +\DeclareBibliographyDriver{supperiodical}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author/editor+others}% + \setunit{\labelnamepunct}\newblock + \usebibmacro{issue}% + \setunit*{\addperiod\addspace}% + \usebibmacro{periodical}% + \setunit*{\addperiod\addspace}% + \usebibmacro{location}% + \setunit*{\addcolon\addspace}% + \usebibmacro{publisher}% + \setunit*{\addcomma\addspace}% + \printfield{volume}% + \setunit*{\addcomma\addspace}% + \printfield{number}% + \setunit*{\addcomma\addspace}% + \printfield{pages}% + \setunit*{\addcomma\addspace}% + \usebibmacro{date}% + \newunit + \printlist{language}% + \newunit\newblock + \usebibmacro{byauthor}% + \newunit\newblock + \usebibmacro{byeditor+others}% + \newunit\newblock + \printfield{howpublished}% + \newunit\newblock + \printfield{type}% + \newunit + \printfield{version}% + \newunit\newblock + \usebibmacro{chapter+pages}% + \setunit*{\addcomma\addspace}% + \printfield{pagetotal}% + \newunit + \printfield{note}% + \newunit\newblock + \usebibmacro{doi+eprint+url}% + \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related}% + {\usebibmacro{related:init}% + \usebibmacro{related}}% + {}% + \usebibmacro{finentry}}% + +% TODO: For now there is no way to make just part of the +% organization name uppercase (C.f. 10520-2002:6.3-6) +\DeclareBibliographyDriver{manual}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author/editor+others}% + \setunit{\labelnamepunct}\newblock + \usebibmacro{maintitle+title}% + \newunit + \printlist{language}% + \newunit\newblock + \usebibmacro{byauthor}% + \newunit\newblock + \usebibmacro{byeditor}% + \newunit\newblock + \printfield{edition}% + \newunit\newblock + \printfield{type}% + \newunit + \printfield{version}% + \newunit\newblock + \usebibmacro{location+date}% + \newunit\newblock + \usebibmacro{chapter+pages}% + \newunit + \printfield{pagetotal}% + \newunit\newblock + \usebibmacro{series+number}% + \newunit + \printfield{note}% + \newunit\newblock + \iftoggle{bbx:isbn}% + {\printfield{isbn}}% + {}% + \newunit\newblock + \usebibmacro{doi+eprint+url}% + \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related}% + {\usebibmacro{related:init}% + \usebibmacro{related}}% + {}% + \usebibmacro{finentry}}% + +\DeclareBibliographyDriver{proceedings}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{organization/eventtitle}% + \setunit{\addcomma\addspace}% + \printfield{number}% + \setunit*{\adddot\addcomma\addspace}% + \printeventdate% + \setunit{\addcomma\addspace}% + \usebibmacro{venue}% + \newunit + \usebibmacro{maintitle+title}% + \newunit\newblock + \usebibmacro{byeditor+others}% + \newunit\newblock + \usebibmacro{publisher+location+date}% + \newunit\newblock + \iffieldundef{maintitle}% + {\printfield{volume}% + \printfield{part}}% + {}% + \newunit\newblock + \printfield{note}% + \newunit\newblock + \printlist{organization}% This has to be printed conditionally + \newunit\newblock + \usebibmacro{chapter+pages}% + \newunit + \printfield{pagetotal}% + \newunit\newblock + \iftoggle{bbx:isbn}% + {\printfield{isbn}}% + {}% + \newunit\newblock + \usebibmacro{doi+eprint+url}% + \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related}% + {\usebibmacro{related:init}% + \usebibmacro{related}}% + {}% + \usebibmacro{finentry}}% + +\DeclareBibliographyDriver{inproceedings}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author/translator+others}% + \setunit{\labelnamepunct}\newblock + \usebibmacro{title}% + \newunit + \printlist{language}% + \newunit\newblock + \usebibmacro{byauthor}% + \newunit\newblock + \usebibmacro{in:eventtitle/organization/editor}% + \setunit*{\addcomma\addspace}% + \printfield{number}% + \setunit*{\adddot\addcomma\addspace}% + \printeventdate% + \setunit*{\addcomma\addspace}% + \printfield{venue}% + \newunit\newblock + \usebibmacro{maintitle+booktitle}% + \newunit\newblock + \usebibmacro{byeditor+others}% + \newunit + \ifboolexpr{ + test {\iffieldundef{booktitle}}% + and + test {\iffieldundef{maintitle}}% + }% + {}% + {\usebibmacro{publisher+location+date}}% + \newunit\newblock + \iffieldundef{maintitle}% + {\printfield{volume}% + \printfield{part}}% + {}% + \newunit + \printfield{volumes}% + \newunit\newblock + \usebibmacro{series+number}% + \newunit\newblock + \printlist{organization}% + \newunit\newblock + \usebibmacro{chapter+pages}% + \newunit + \printfield{pagetotal}% + \newunit\newblock + \printfield{note}% + \newunit\newblock + \iftoggle{bbx:isbn}% + {\printfield{isbn}}% + {}% + \newunit\newblock + \usebibmacro{doi+eprint+url}% + \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related}% + {\usebibmacro{related:init}% + \usebibmacro{related}}% + {}% + \usebibmacro{finentry}}% + +\DeclareBibliographyDriver{thesis}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author}% + \setunit{\labelnamepunct}\newblock + \usebibmacro{title}% + \newunit + \usebibmacro{date}% + \newunit\newblock + \usebibmacro{chapter+pages}% + \newunit + \printfield{pagetotal}% + \newunit\newblock + \printfield{type}% + \setunit*{\addspace\textendash\addspace}% + \printlist{institution}% + \setunit*{\addcomma\addspace}% + \printlist{location}% + \setunit*{\addcomma\addspace}% + \printeventdate% + \newunit\newblock + \printfield{note}% + \newunit\newblock + \iftoggle{bbx:isbn}% + {\printfield{isbn}}% + {}% + \newunit\newblock + \usebibmacro{doi+eprint+url}% + \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related}% + {\usebibmacro{related:init}% + \usebibmacro{related}}% + {}% + \usebibmacro{finentry}}% + +\DeclareBibliographyDriver{monography}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author}% + \setunit{\labelnamepunct}\newblock + \usebibmacro{title}% + \newunit + \usebibmacro{date}% + \newunit\newblock + \usebibmacro{chapter+pages}% + \newunit + \printfield{pagetotal}% + \newunit\newblock + \printfield{type}% + \setunit*{\addspace\textendash\addspace}% + \printlist{institution}% + \setunit*{\addcomma\addspace}% + \printlist{location}% + \setunit*{\addcomma\addspace}% + \printeventdate% + \newunit\newblock + \printfield{note}% + \newunit\newblock + \iftoggle{bbx:isbn}% + {\printfield{isbn}}% + {}% + \newunit\newblock + \usebibmacro{doi+eprint+url}% + \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related}% + {\usebibmacro{related:init}% + \usebibmacro{related}}% + {}% + \usebibmacro{finentry}}% + +\DeclareBibliographyDriver{booklet}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author/editor+others}% + \setunit{\labelnamepunct}\newblock + \usebibmacro{maintitle+title}% + \newunit + \printlist{language}% + \newunit\newblock + \usebibmacro{byauthor}% + \newunit\newblock + \usebibmacro{byeditor+others}% + \newunit\newblock + \printfield{edition}% + \newunit\newblock + \usebibmacro{series+number}% + \newunit\newblock + \printfield{type}% + \newunit + \printfield{version}% + \newunit\newblock + \usebibmacro{location+date}% + \newunit\newblock + \usebibmacro{chapter+pages}% + \newunit + \printfield{note}% + \newunit + \printfield{pagetotal}% + \newunit\newblock + \iftoggle{bbx:isbn}% + {\printfield{isbn}}% + {}% + \newunit\newblock + \usebibmacro{doi+eprint+url}% + \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related}% + {\usebibmacro{related:init}% + \usebibmacro{related}}% + {}% + \usebibmacro{finentry}}% + +\DeclareBibliographyDriver{patent}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \iflistundef{organization}% + {\usebibmacro{author/editor+others}% + \clearnames{author}}% + {\usebibmacro{organization}}% + \setunit{\labelnamepunct}\newblock + \ifnameundef{author}% + {\printnames[given-family]{editor}}% + {\printnames[given-family]{author}}% + \newunit + \usebibmacro{title}% + \newunit + \printlist{language}% + \newunit\newblock + \usebibmacro{byauthor}% + \newunit\newblock + \usebibmacro{byeditor+others}% + \newunit\newblock + \printlist{location}% + \setunit*{\addcomma\addspace}% + \usebibmacro{date}% + \setunit*{\addcomma\addspace}% + \printfield{number}% + \setunit*{\addcomma\addspace}% + \printfield{howpublished}% + \newunit\newblock + \printfield{type}% + \newunit + \printfield{version}% + \newunit + \printfield{note}% + \newunit\newblock + \usebibmacro{doi+eprint+url}% + \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related}% + {\usebibmacro{related:init}% + \usebibmacro{related}}% + {}% + \usebibmacro{finentry}}% + +\DeclareBibliographyDriver{report}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author/editor+others}% + \setunit{\labelnamepunct}\newblock + \usebibmacro{maintitle+title}% + \newunit + \printlist{language}% + \newunit\newblock + \usebibmacro{byauthor}% + \newunit\newblock + \usebibmacro{byeditor+others}% + \newunit\newblock + \printfield{edition}% + \newunit + \iffieldundef{maintitle}% + {\printfield{volume}% + \printfield{part}}% + {}% + \newunit + \printfield{volumes}% + \newunit\newblock + \usebibmacro{location+date}% + \newunit\newblock + \usebibmacro{chapter+pages}% + \newunit + \printfield{pagetotal}% + \newunit\newblock + \usebibmacro{series+number}% + \newunit\newblock + \printfield{note}% + \newunit\newblock + \iftoggle{bbx:isbn}% + {\printfield{isbn}}% + {}% + \newunit\newblock + \usebibmacro{doi+eprint+url}% + \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related}% + {\usebibmacro{related:init}% + \usebibmacro{related}}% + {}% + \usebibmacro{finentry}}% + +\DeclareBibliographyDriver{misc}{% + \usebibmacro{bibindex}% + \usebibmacro{begentry}% + \usebibmacro{author/editor+others}% + \setunit{\labelnamepunct}\newblock + \usebibmacro{maintitle+title}% + \newunit + \printlist{language}% + \newunit\newblock + \usebibmacro{byauthor}% + \newunit\newblock + \usebibmacro{byeditor+others}% + \newunit\newblock + \printfield{edition}% + \newunit + \iffieldundef{maintitle}% + {\printfield{volume}% + \printfield{part}}% + {}% + \newunit + \printfield{volumes}% + \newunit\newblock + \usebibmacro{publisher+location+date}% + \newunit\newblock + \usebibmacro{chapter+pages}% + \newunit + \printfield{pagetotal}% + \setunit*{\addcomma\addspace}% + \printfield{dimensions}% + \newunit\newblock + \printfield{howpublished}% + \newunit\newblock + \usebibmacro{series+number}% + \newunit\newblock + \printfield{note}% + \newunit\newblock + \iftoggle{bbx:isbn}% + {\printfield{isbn}}% + {}% + \newunit\newblock + \usebibmacro{doi+eprint+url}% + \newunit\newblock + \usebibmacro{addendum+pubstate}% + \setunit{\bibpagerefpunct}\newblock + \usebibmacro{pageref}% + \newunit\newblock + \iftoggle{bbx:related}% + {\usebibmacro{related:init}% + \usebibmacro{related}}% + {}% + \usebibmacro{finentry}}% + +% I copied this from authoryear.bbx for the dashed option. +\DeclareBibliographyDriver{set}{% + \booltrue{bbx@inset}% + \entryset{}{}% + \newunit\newblock + \usebibmacro{setpageref}% + \finentry}% + + +% ---------- +% Helper commands +% ---------- + +\long\def\addto#1#2{\expandafter\def\expandafter#1\expandafter{#1#2}} + +\def\traceparam#1{\def\paramL{}\traceparamA #1\end} +\def\traceparamA{\futurelet\next\traceparamB} +\def\traceparamB{% + \let\nexts=\undefined + \expandafter\ifx\space\next \let\nexts=\traceparamS \fi + \ifx\bgroup\next \let\nexts=\traceparamD \fi + \ifx\end\next \let\nexts=\traceparamE \fi + \ifx\nexts\undefined \let\nexts=\traceparamC\fi + \nexts +} +\def\traceparamS{\addto\paramL{ }\afterassignment\traceparamA \let\next= } +\def\traceparamC#1{\addto\paramL{#1}\traceparamA} +\def\traceparamD#1{% + \expandafter\addto\expandafter\paramL\expandafter + {\expandafter\noexpand\csname ll:\detokenize{#1}\endcsname}% + \expandafter\def\csname ll:\detokenize{#1}\endcsname{#1}% + \traceparamA +} +\def\traceparamE\end{} + +\def\smartuppercase#1{% + \bgroup + \traceparam{#1}% + \MakeUppercase{\paramL}% + \egroup +} + +\def\smartlowercase#1{% + \bgroup + \traceparam{#1}% + \MakeLowercase{\paramL}% + \egroup +} + +\def\smartlcsc#1{% + \bgroup + \traceparam{#1}% + \textsc{\MakeLowercase{\paramL}}% + \egroup +} + + +\endinput |