% socialsciences|huberlin --% % Copyright (c) 2018 Lukas C. Bossert % % 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. \def\sshu@date{2018/05/24} \def\sshu@version{0.0.1} \def\sshu@bbxid{\sshu@date\space v\sshu@version\space biblatex-socialsciences|huberlin bibliography style (LCB)} \def\sshu@cbxid{\sshu@date\space v\sshu@version\space biblatex-socialsciences|huberlin citation style (LCB)} \def\sshu@lbxid{\sshu@date\space v\sshu@version\space biblatex-socialsciences|huberlin localization (LCB)} \ProvidesFile{socialscienceshuberlin.bbx}[\sshu@bbxid] \RequireBibliographyStyle{ext-authoryear} \AtBeginDocument{% \urlstyle{same}% \typeout{* * * socialsciences|huberlin * * *} } \def\socialscienceshuberlinversion{\sshu@version} \def\socialscienceshuberlindate{\sshu@date} \ExecuteBibliographyOptions{% innamebeforetitle=true, autocite=inline, isbn=false, } %----------------------- \newtoggle{bbx:colornames} \DeclareBibliographyOption{colornames}[true]{% \csuse{toggle#1}{bbx:colornames}} \DeclareFieldFormat{pages}{#1} \DeclareFieldFormat{postnote}{\mknormrange{#1}} \DeclareFieldFormat{multipostnote}{\mknormrange{#1}} \DeclareFieldFormat{biblabeldate}{#1} \DeclareFieldFormat{origdate}{\mkbibbrackets{#1}} \DeclareFieldFormat{editortype}{\mkbibparens{#1}} \DeclareDelimFormat{editortypedelim}{\addspace} \DeclareDelimFormat[bib,biblist]{innametitledelim}{\addcomma\space} \DeclareFieldFormat[article]{number}{\mkbibparens{#1}} \DeclareFieldFormat*{title}{#1} \DeclareFieldFormat[book]{title}{\mkbibemph{#1}} \RequirePackage{xcolor} \definecolor{sshuberlincolor}{cmyk}{1, .50, .10, .01} %default \renewcommand*{\labelnamepunct}{\addcolon\space} \renewcommand*{\volnumdelim}{\space} \renewcommand{\postnotedelim}{\addcolon\space} \DeclareRedundantLanguages{german}{german,ngerman,austrian,naustrian} \DeclareRedundantLanguages{english,american}{english,american,british,% canadian,australian,newzealand,USenglish,UKenglish} \DeclareLanguageMapping{german}{german-socialscienceshuberlin} % get origdates after date \renewbibmacro*{date+extradate}{% \iffieldundef{labelyear} {} {\printtext[\blx@delimcontext labeldate]{% \iflabeldateisdate {\printdateextra} {\printlabeldateextra}} \iffieldequalstr{labeldatesource}{orig} {} {\printorigdate}}} % https://tex.stackexchange.com/a/364192/98739 \DeclareNameFormat{color-family-given}{% \ifgiveninits {\usebibmacro{name:color:family-given} {\namepartfamily} {\namepartgiveni} {\namepartprefix} {\namepartsuffix}} {\usebibmacro{name:color:family-given} {\namepartfamily} {\namepartgiven} {\namepartprefix} {\namepartsuffix}}% \usebibmacro{name:andothers}} \newbibmacro*{name:color:family-given}[4]{% \ifuseprefix {\usebibmacro{name:delim}{#3#1}% \usebibmacro{name:hook}{#3#1}% \textcolor{red}{% \ifdefvoid{#3}{}{% \ifcapital {\mkbibnameprefix{\MakeCapital{#3}}\isdot} {\mkbibnameprefix{#3}\isdot}% \ifprefchar{}{\bibnamedelimc}}% \mkbibnamefamily{#1}\isdot \ifdefvoid{#4}{}{\bibnamedelimd\mkbibnamesuffix{#4}\isdot}% \ifdefvoid{#2}{}{\revsdnamepunct\bibnamedelimd\mkbibnamegiven{#2}\isdot}}} {\usebibmacro{name:delim}{#1}% \usebibmacro{name:hook}{#1}% \textcolor{sshuberlincolor}{% \mkbibnamefamily{#1}\isdot \ifdefvoid{#4}{}{\bibnamedelimd\mkbibnamesuffix{#4}\isdot}% \ifboolexpe{% test {\ifdefvoid{#2}} and test {\ifdefvoid{#3}}} {} {\revsdnamepunct}% \ifdefvoid{#2}{}{\bibnamedelimd\mkbibnamegiven{#2}\isdot}% \ifdefvoid{#3}{}{\bibnamedelimd\mkbibnameprefix{#3}\isdot}}}} % {\DeclareNameAlias{sortname}{color-family-given}} %not working with parens \DeclareNameAlias{sortname}{color-family-given} \endinput