<commit_before>% $Id: dhbw_ibim.bbx,v 0.1 2011/06/08 by <NAME> $
% this style is based on standard.bbx and authoryear.bbx
% commands are modified to suit the bibliography requirements
% by the Baden Wuerttemberg Cooperative State University Stuttgart (DHBW)

\ProvidesFile{dhbw_ibim.bbx}
[\abx@bbxid $Id: dhbw_ibim.bbx,v 0.1 2011/06/08 by <NAME> $]

% BEGIN own definitions %

%titles should be unformatted / not emphasised
\DeclareFieldFormat{title}{#1\isdot}	%\isdot prevents double punctuation
\DeclareFieldFormat[inproceedings]{title}{#1\isdot}
\DeclareFieldFormat[article]{title}{#1\isdot}
\DeclareFieldFormat{booktitle}{#1\isdot}
\DeclareFieldFormat{issuetitle}{#1\isdot}
\DeclareFieldFormat{journaltitle}{#1\isdot}
\DeclareFieldFormat{maintitle}{#1\isdot}

%always use lastname, firstname (only works with biber as backend)
\DeclareNameAlias{sortname}{last-first}
\DeclareNameAlias{last-first/first-last}{last-first}
\DeclareNameAlias{default}{last-first}

% Default sizes for bibliography list
\newcommand{\lblwidth}{5cm}
\newcommand{\entrywidth}{9.5cm}


%FieldFormat for url+urldate
\DeclareFieldFormat{url}{\urlstyle{same}\url{#1}\addcomma}	%\mkbibacro{URL}\addcolon\space\url{#1}}
\DeclareFieldFormat{urldate}{\bibstring{urlseen}\addcolon\space#1}	%\mkbibparens{\bibstring{urlseen}\space#1}}

\DefineBibliographyStrings{USenglish}{%
  edition = {Edn\adddot}%	Replace ed with Edn
  urlseen = {retrieval\addcolon}%	replace 'visited on' with 'retrieval:'
}
%edition should be like 2nd Edn., not displayed if 1st Edn.
\DeclareFieldFormat{edition}{%
  \ifthenelse{\ifinteger{#1}\AND\NOT #1=1}%only display if a number and not 1
    {\mkbibordedition{#1}~\bibstring{edition}}
    {}}

%pagerefs after articles and proceedings should have a leading "p."
%\newbibmacro*{pageref}{%
%  \iflistundef{pageref}
%    {}
%    {\printtext[parens]{%
%       \ifnumgreater{\value{pageref}}{1}
%         {p. \bibstring{backrefpages}\ppspace}
%	 {p. \bibstring{backrefpage}\ppspace}%
%       \printlist[pageref][-\value{listtotal}]{pageref}}}}


%add space after author-block
\renewcommand*{\labelnamepunct}{\addspace}

%slashes between multiple authors, epublishers, places
\renewcommand*{\multinamedelim}{\addslash}
\renewcommand*{\finalnamedelim}{\addslash}
\renewcommand*{\multilistdelim}{\addslash}
\renewcommand*{\finallistdelim}{\addslash}

%default separator should be comma
\renewcommand*{\newunitpunct}{\addcomma\space}

%editors in brackets (not working!)
\renewbibmacro*{editorstrg}{%
\ifthenelse{\value{editor}>1\OR \ifandothers{editor}}
{\mkbibparens{\bibstring{editors}}}
{\mkbibparens{\bibstring{editor}}}}

\renewbibmacro*{byeditor+others}{%
  \ifnameundef{editor}
    {}
    {%\usebibmacro{byeditor+othersstrg}%
    \printtext{(Ed\adddot\addcolon}
     \setunit{\addspace}%
    \printnames{editor}% \printnames[byeditor]{editor}%
     \clearname{editor}\printtext{)}%}%
     \setunit{\addcomma}%
     \newunit}%
  %\usebibmacro{byeditorx}%
  %\usebibmacro{bytranslator+others}
  }
  
\renewbibmacro*{byeditor+othersstrg}{%
  \iffieldundef{editortype}
    {\def\abx@tempa{byeditor}}
    {\edef\abx@tempa{by\thefield{editortype}}}%
  \let\abx@tempb=\empty
  \ifnamesequal{editor}{translator}
    {\appto\abx@tempa{tr}%
     \appto\abx@tempb{\clearname{translator}}}
    {}%
  \ifnamesequal{editor}{commentator}
    {\appto\abx@tempa{co}%
     \appto\abx@tempb{\clearname{commentator}}}
    {\ifnamesequal{editor}{annotator}
       {\appto\abx@tempa{an}%
        \appto\abx@tempb{\clearname{annotator}}}
       {}}%
  \ifnamesequal{editor}{introduction}
    {\appto\abx@tempa{in}%
     \appto\abx@tempb{\clearname{introduction}}}
    {\ifnamesequal{editor}{foreword}
       {\appto\abx@tempa{fo}%
        \appto\abx@tempb{\clearname{foreword}}}
       {\ifnamesequal{editor}{afterword}
          {\appto\abx@tempa{af}%
           \appto\abx@tempb{\clearname{afterword}}}
          {}}}%
  \ifbibxstring{\abx@tempa}
    {\printtext{\bibstring{\abx@tempa}}\abx@tempb} %prints "ed. by"
    {\usebibmacro{bytypestrg}{editor}{editor}}} %probably prints the editors name

% bibenvironment with hanging indentation
% should look like a table
% see http://latex.computersci.org/Reference/ListEnvironments
% for a description of available formatting parameters

\defbibenvironment{bibliography}%
	%begin code: Sets list environment and specifies labels
	{\list
		%list label
		{\parbox[t]{\lblwidth}{\usebibmacro{author/editor+others/translator+others}}}
		%list formatting parameters<commit_msg>Fixes issue #11 - label alignment.<commit_after>% $Id: dhbw_ibim.bbx,v 0.1 2011/06/08 by <NAME> $
% this style is based on standard.bbx and authoryear.bbx
% commands are modified to suit the bibliography requirements
% by the Baden Wuerttemberg Cooperative State University Stuttgart (DHBW)

\ProvidesFile{dhbw_ibim.bbx}
[\abx@bbxid $Id: dhbw_ibim.bbx,v 0.1 2011/06/08 by <NAME> $]

% BEGIN own definitions %

%titles should be unformatted / not emphasised
\DeclareFieldFormat{title}{#1\isdot}	%\isdot prevents double punctuation
\DeclareFieldFormat[inproceedings]{title}{#1\isdot}
\DeclareFieldFormat[article]{title}{#1\isdot}
\DeclareFieldFormat{booktitle}{#1\isdot}
\DeclareFieldFormat{issuetitle}{#1\isdot}
\DeclareFieldFormat{journaltitle}{#1\isdot}
\DeclareFieldFormat{maintitle}{#1\isdot}

%always use lastname, firstname (only works with biber as backend)
\DeclareNameAlias{sortname}{last-first}
\DeclareNameAlias{last-first/first-last}{last-first}
\DeclareNameAlias{default}{last-first}

% Default sizes for bibliography list
\newcommand{\lblwidth}{5cm}
\newcommand{\entrywidth}{9.5cm}


%FieldFormat for url+urldate
\DeclareFieldFormat{url}{\urlstyle{same}\url{#1}\addcomma}	%\mkbibacro{URL}\addcolon\space\url{#1}}
\DeclareFieldFormat{urldate}{\bibstring{urlseen}\addcolon\space#1}	%\mkbibparens{\bibstring{urlseen}\space#1}}

\DefineBibliographyStrings{USenglish}{%
  edition = {Edn\adddot}%	Replace ed with Edn
  urlseen = {retrieval\addcolon}%	replace 'visited on' with 'retrieval:'
}
%edition should be like 2nd Edn., not displayed if 1st Edn.
\DeclareFieldFormat{edition}{%
  \ifthenelse{\ifinteger{#1}\AND\NOT #1=1}%only display if a number and not 1
    {\mkbibordedition{#1}~\bibstring{edition}}
    {}}

%pagerefs after articles and proceedings should have a leading "p."
%\newbibmacro*{pageref}{%
%  \iflistundef{pageref}
%    {}
%    {\printtext[parens]{%
%       \ifnumgreater{\value{pageref}}{1}
%         {p. \bibstring{backrefpages}\ppspace}
%	 {p. \bibstring{backrefpage}\ppspace}%
%       \printlist[pageref][-\value{listtotal}]{pageref}}}}


%add space after author-block
\renewcommand*{\labelnamepunct}{\addspace}

%slashes between multiple authors, epublishers, places
\renewcommand*{\multinamedelim}{\addslash}
\renewcommand*{\finalnamedelim}{\addslash}
\renewcommand*{\multilistdelim}{\addslash}
\renewcommand*{\finallistdelim}{\addslash}

%default separator should be comma
\renewcommand*{\newunitpunct}{\addcomma\space}

%editors in brackets (not working!)
\renewbibmacro*{editorstrg}{%
\ifthenelse{\value{editor}>1\OR \ifandothers{editor}}
{\mkbibparens{\bibstring{editors}}}
{\mkbibparens{\bibstring{editor}}}}

\renewbibmacro*{byeditor+others}{%
  \ifnameundef{editor}
    {}
    {%\usebibmacro{byeditor+othersstrg}%
    \printtext{(Ed\adddot\addcolon}
     \setunit{\addspace}%
    \printnames{editor}% \printnames[byeditor]{editor}%
     \clearname{editor}\printtext{)}%}%
     \setunit{\addcomma}%
     \newunit}%
  %\usebibmacro{byeditorx}%
  %\usebibmacro{bytranslator+others}
  }
  
\renewbibmacro*{byeditor+othersstrg}{%
  \iffieldundef{editortype}
    {\def\abx@tempa{byeditor}}
    {\edef\abx@tempa{by\thefield{editortype}}}%
  \let\abx@tempb=\empty
  \ifnamesequal{editor}{translator}
    {\appto\abx@tempa{tr}%
     \appto\abx@tempb{\clearname{translator}}}
    {}%
  \ifnamesequal{editor}{commentator}
    {\appto\abx@tempa{co}%
     \appto\abx@tempb{\clearname{commentator}}}
    {\ifnamesequal{editor}{annotator}
       {\appto\abx@tempa{an}%
        \appto\abx@tempb{\clearname{annotator}}}
       {}}%
  \ifnamesequal{editor}{introduction}
    {\appto\abx@tempa{in}%
     \appto\abx@tempb{\clearname{introduction}}}
    {\ifnamesequal{editor}{foreword}
       {\appto\abx@tempa{fo}%
        \appto\abx@tempb{\clearname{foreword}}}
       {\ifnamesequal{editor}{afterword}
          {\appto\abx@tempa{af}%
           \appto\abx@tempb{\clearname{afterword}}}
          {}}}%
  \ifbibxstring{\abx@tempa}
    {\printtext{\bibstring{\abx@tempa}}\abx@tempb} %prints "ed. by"
    {\usebibmacro{bytypestrg}{editor}{editor}}} %probably prints the editors name

% bibenvironment with hanging indentation
% should look like a table
% see http://latex.computersci.org/Reference/ListEnvironments
% for a description of available formatting parameters

\defbibenvironment{bibliography}%
	%begin code: Sets list environment and specifies labels
	{\list
		%list label
		{\parbox[t]{\lblwidth}{\raggedright \usebibmacro{author/editor+others/translator+others}}}
		%list formatting parameters
{'fraction_non_alphanumeric': 0.15805808024828197, 'fraction_numerical': 0.009753934825980935, 'mean_word_length': 5.088394062078272, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3577806', 'n_tokens_mistral': 3415, 'n_tokens_neox': 3193, 'n_words': 510}