diff options
Diffstat (limited to 'macros/latex/contrib/biblatex-contrib/biblatex-unified/unified.bbx')
-rw-r--r-- | macros/latex/contrib/biblatex-contrib/biblatex-unified/unified.bbx | 158 |
1 files changed, 66 insertions, 92 deletions
diff --git a/macros/latex/contrib/biblatex-contrib/biblatex-unified/unified.bbx b/macros/latex/contrib/biblatex-contrib/biblatex-unified/unified.bbx index bb278b4a1c..be261b9f73 100644 --- a/macros/latex/contrib/biblatex-contrib/biblatex-unified/unified.bbx +++ b/macros/latex/contrib/biblatex-contrib/biblatex-unified/unified.bbx @@ -9,7 +9,7 @@ %% --------------------------------------------------------------- %% -\ProvidesFile{unified.bbx}[2020/06/25 v1.00 biblatex bibliography style] +\ProvidesFile{unified.bbx}[2022/02/05 v1.10 biblatex bibliography style] % biblatex by default calls biblatex.def, we add to this authoryear.bbx, which % in turn loads standard.bbx. So, unified.bbx is built on top of those styles; @@ -23,12 +23,8 @@ % abbreviate option also abbreviates the names of months. But then % dateabbrev=false restores the long names of months -% biblatex has a "useprefix" option, which makes "von" count for -% alphabetization; the Unified Stylesheet does not want that, so it is important -% that this option be disabled (even if an author tries to set it to true) - \ExecuteBibliographyOptions{% - sorting=nyt,abbreviate,dateabbrev=false,useprefix=false} + sorting=nyt,abbreviate,dateabbrev=false,useprefix=true} % For backward compatibility: choose labeldate or labeldateparts % depending on the biblatex version @@ -51,91 +47,50 @@ \DeclareBibliographyOption{issueandeditor}[false]{% \settoggle{issueandeditor}{#1}} -% Formatting directives for name lists -% ------------------------------------------------------------------ -% -% In biblatex.def, there are name formats defined: first-last, last-first, -% last-first/first-last. They could be simplified (we don't need provisions for -% using initials only, since the Unified Style doesn't do that), but since -% biblatex.def is loaded automatically, there's no point. The name formats call -% bibmacros that figure out how to order the internal of name components. These -% are re-defined here to make sure that "von" is treated as part of the last -% name (it still doesn't count for sorting -- which is controlled by the -% \useprefix package option) name:last is used to produce citation labels -% name:last-first is used to produce the first author's name listing in the -% alphabetical bibliography - -% Also moved the Jr part to after the first name and inserted another comma, -% because the Unified Stylesheet disagrees with standard.bbx: it wants "Jr." not -% to be treated as part of the last name. - -% The macros here get 4 arguments passed to them. They are: #1 last name, #2 -% first name, #3 von, #4 Jr. - -% In biblatex v3.3 and onwards, the name formatting has changed in a big way. -% See for example: -% http://tex.stackexchange.com/questions/299036/biblatex-3-3-name-formatting, -% https://github.com/plk/biblatex/issues/372, and -% http://www.texdev.net/2016/03/13/biblatex-a-new-syntax-for-declarenameformat/. -% The name formats in biblatex.def are not called first-last etc. anymore but -% given-family etc. And while there are safeguard legacy aliases -% (\DeclareNameAlias{first-last}{given-family}, for example), the new formats -% then use macros like \usebibmacro{name:family-given}, which of course our old -% redefinitions didn't adjust. So, for newer biblatex, we need to do new -% versions of \renewbibmacro{name:...}. - -%% Redefinitions of name:last and name:last-first for biblatex versions before -%% v3.3 - -\renewbibmacro*{name:last}[4]{% - \usebibmacro{name:delim}{#3#1}% - \usebibmacro{name:hook}{#3#1}% - \ifblank{#3} - {} - {\ifcapital - {\mkbibnameprefix{\MakeCapital{#3}}\isdot} - {\mkbibnameprefix{#3}\isdot}% - \ifpunctmark{'}{}{\bibnamedelimc}}% - \mkbibnamelast{#1}}% - -\renewbibmacro*{name:last-first}[4]{% - \usebibmacro{name:delim}{#3#1}% - \usebibmacro{name:hook}{#3#1}% - \ifblank{#3}{}{% - \mkbibnameprefix{#3}\isdot% - \ifpunctmark{'}{}{\bibnamedelimc}}% - \mkbibnamelast{#1}\isdot - \ifblank{#2}{}{\addcomma\bibnamedelimd\mkbibnamefirst{#2}\isdot}% - \ifblank{#4}{}{\addcomma\bibnamedelimd\mkbibnameaffix{#4}\isdot}} - -%% Redefinitions of name:family and name:family-given for biblatex ever since -%% v3.3 - -\renewbibmacro*{name:family}[4]{% - \usebibmacro{name:delim}{#3#1}% - \usebibmacro{name:hook}{#3#1}% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Treating prefixes like "von" as part of the last name, but ignore them for +% sorting (relies on useprefix=true default option) +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\DeclareSortingNamekeyTemplate{ + \keypart{ + \namepart{family} + } + \keypart{ + \namepart{prefix} + } + \keypart{ + \namepart{given} + } + \keypart{ + \namepart{suffix} + } +} + +\renewbibmacro{begentry}{\midsentence} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Moving "Jr." to after the first name +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\renewbibmacro*{name:family-given}[4]{% + \usebibmacro{name:delim}{#3#1}% + \usebibmacro{name:hook}{#3#1}% + \mkbibcompletenamefamilygiven{% \ifdefvoid{#3} {} {\ifcapital {\mkbibnameprefix{\MakeCapital{#3}}\isdot} {\mkbibnameprefix{#3}\isdot}% \ifprefchar{}{\bibnamedelimc}}% - \mkbibnamefamily{#1}\isdot}% - -\renewbibmacro*{name:family-given}[4]{% - \usebibmacro{name:delim}{#3#1}% - \usebibmacro{name:hook}{#3#1}% - \ifdefvoid{#3} - {} - {\mkbibnameprefix{#3}\isdot% - \ifprefchar{}{\bibnamedelimc}}% - \mkbibnamefamily{#1}\isdot - \ifdefvoid{#2} - {} - {\revsdnamepunct\bibnamedelimd\mkbibnamegiven{#2}\isdot}% - \ifdefvoid{#4} - {} - {\addcomma\bibnamedelimd\mkbibnamesuffix{#4}\isdot}} + \mkbibnamefamily{#1}\isdot + \ifdefvoid{#2} + {} + {\revsdnamepunct\bibnamedelimd\mkbibnamegiven{#2}\isdot}% + \ifdefvoid{#4} + {} + {\revsdnamepunct\bibnamedelimd\mkbibnamesuffix{#4}\isdot}} + } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Various bibmacros used in producing the bibliography @@ -413,8 +368,8 @@ % This gets rid of the Oxford comma in name lists and uses the % ampersand rather than "and": -\renewcommand*{\finalnamedelim}{\addspace\&\addspace} -\renewcommand*{\finallistdelim}{\addspace\&\addspace} +\renewcommand*{\finalnamedelim}{\addnbspace\&\addspace} +\renewcommand*{\finallistdelim}{\addnbspace\&\addspace} % no colon after "In" in incollection entries (overriding % biblatex.def): @@ -450,11 +405,6 @@ \DeclareFieldFormat[thesis]{title}{\mkbibemph{#1}} \DeclareFieldFormat{pages}{#1} % no pp. prefix, took \mkpageprefix out [kvf] -\DeclareFieldFormat{doi}{% - \ifhyperref - {\href{https://doi.org/#1}{\nolinkurl{https://doi.org/#1}}} - {\nolinkurl{https://doi.org/#1}}} -\DeclareFieldFormat{url}{\url{#1}} % This is for printing the volume field of a proceedings with an ISSN % as an article in accordance with the unified style sheet guidelines @@ -462,6 +412,30 @@ \DeclareFieldFormat{volume:unified:proc-as-article}{#1} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Display of DOIs etc. +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% The unified style displays DOIs according to the Crossref guidelines as full +% `https://doi.org/...` links. But the user can choose to give the `compactdois' +% option when loading biblatex, which will use a more compact display. + +\newtoggle{unified:compactdois} +\DeclareBibliographyOption[boolean]{compactdois}[true]{% + \settoggle{unified:compactdois}{#1}} + +\DeclareFieldFormat{doi}{% + \iftoggle{unified:compactdois}% + {\mkbibacro{DOI}\addcolon\space% + \ifhyperref + {\href{https://doi.org/#1}{\nolinkurl{#1}}} + {\nolinkurl{https://doi.org/#1}}} + {\ifhyperref + {\href{https://doi.org/#1}{\nolinkurl{https://doi.org/#1}}} + {\nolinkurl{https://doi.org/#1}}}} + +\DeclareFieldFormat{url}{\url{#1}} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % The bibliography drivers, specifying the formats of each type of % entry in the bibliography %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |