I customized a bbx file for biblatex. I would like to have my references this way:
[namepartprefix] [namepartfamily], [namepartgiveni] ...
Unfortinately, there are some spurious spaces before the name prefix (see attachments below), which I can't get rid of. I know that you have to take care of spaces at the end of a line in your source code. I have put some % signs right at the end of all related lines in my bbx file. Though, it does not work properly. Where is my mistake?
Plus, the name prefix is missing from the label names, that appear as citations. How can I insert the von/de etc part to the label?
bbx-text.tex
\documentclass{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[backend=biber,style=epicstructure,sorting=nyt]{biblatex}
\addbibresource{test-companion.bib}
\begin{document}
\nocite{*}
\printbibliography
\end{document}
test-companion.bib:
@Book{Alpha:2002,
author = {Beta von Alpha},
year = {2002},
title = {Book title},
edition = {2},
note = {(= optional note)},
keywords = {Walter,KAetGen},
publisher = {Chicago},
}
@book{Gamma:2015,
editor = {Delta Gamma and Zeta Epsilon and Sigma Rho},
Publisher = {Berlin},
Title = {Another book},
Year = {2015},
edition = {3}}
@article{Iota:1998,
Author = {Kappa Iota},
Journal = {journal name},
Volume = {24},
Pages = {11--18},
Title = {article title},
Year = {1998},
keywords={KAetGen}}
@incollection{Ny:2018,
Author = {Lambda Ny},
Booktitle = {book title},
Editor = {E. Ditor},
Pages = {93--129},
Publisher = {London},
Title = {article title},
Year = {2018}}
epicstructure.bbx:
\ProvidesFile{epicstructure.bbx}[2018/06/29 v1.0 biblatex bibliography style]
% Load the standard style to avoid copy-pasting unnecessary material
\RequireBibliographyStyle{authoryear}
\ExecuteBibliographyOptions{dashed=true}
\setlength{\bibparsep}{0em}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Eigene Änderungen %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Titel kursiv
\DeclareFieldFormat{title}{\mkbibemph{#1}\isdot}
\DeclareFieldFormat[article]{title}{#1}
\DeclareFieldFormat[inbook,incollection]{title}{#1}
%%% Seitenzahlen in Zitaten ohne "S. " davor
\DeclareFieldFormat{postnote}{#1}
\DeclareFieldFormat{multipostnote}{#1}
%%% Seiten bei article ohne "pp. "
\DeclareFieldFormat{pages}{#1}
\newcommand*{\bibpagespunctarticle}{\addcolon\addspace}
\newcommand*{\bibpagespunctincollinbook}{\adddot\addspace}
%%% "/" zwischen mehreren Autoren
\renewcommand*{\multinamedelim}{\addslash}%
\renewcommand*{\finalnamedelim}{\addslash}%
\renewcommand*{\multilistdelim}{\addslash}%
\renewcommand*{\finallistdelim}{\addslash}%
\DeclareNameFormat{author}{%
\ifblank{\namepartprefix}{}{\namepartprefix\addspace}%
\namepartfamily%
\ifblank{\namepartgiven}{}{\addcomma\addspace\namepartgiveni}%
\ifthenelse{\value{listcount}<\value{liststop}}%
{\multinamedelim}%
{}%
}
\DeclareNameFormat{editor}{%
% \ifblank{\namepartprefix}{}{\namepartprefix\addspace}%
\namepartfamily%
\ifblank{\namepartgiven}{}{\addcomma\addspace\namepartgiveni}%
\ifthenelse{\value{listcount}<\value{liststop}}%
{\multinamedelim}%
{}%
}
\DeclareNameFormat{reversed}{%
\ifblank{\namepartgiven}{}{\namepartgiveni\addspace}%
\ifblank{\namepartprefix}{}{\namepartprefix\addspace}%
\namepartfamily%
\ifthenelse{\value{listcount}<\value{liststop}}%
{\multinamedelim}%
{}%
}
\renewbibmacro*{author}{%
\ifboolexpr{%
test \ifuseauthor%
and%
not test {\ifnameundef{author}}%
}%
{\printnames[author]{author}}%
{}%
}
\renewbibmacro*{editor}{%
\ifboolexpr{%
test \ifuseeditor%
and%
not test {\ifnameundef{editor}}%
}%
{\printnames[author]{editor}}%
{}%
}
\renewbibmacro*{author/editor}{%
\ifboolexpr{%
test \ifuseauthor%
and%
not test {\ifnameundef{author}}%
}%
{\usebibmacro{author}}%
{\usebibmacro{editor}}%
}
\newbibmacro*{pages+article}{%
\setunit{\bibpagespunctarticle}%
\printfield{pages}%
\newunit%
}
\renewcommand*{\bibnamedash}{%
\rule[.5ex]{2em}{.15ex}.%
}
%%% ed./eds.
\DefineBibliographyStrings{english}{%
editor={ed\adddot},%
editors={eds\adddot},%
in={in}%
}
\newbibmacro*{editorstrng}{%
\ifthenelse{\value{editor}>1}%\OR\ifandothers{editor}}%
{\bibstring{editors}}%
{\bibstring{editor}}%
}
\DeclareFieldFormat{edition}{%
#1%
}
\newbibmacro*{editionsupscr}{%
\iffieldundef{edition}%
{}%
{\textsuperscript{\printfield{edition}}}%
}
%%% (year)//(ed., year) -- article/book
\newbibmacro*{editor+edition+year}{%
\ifnameundef{editor}%
{\mkbibparens{\usebibmacro{editionsupscr}\printfield{year}}}%
{\mkbibparens{\usebibmacro{editorstrng}\addcomma\addspace\usebibmacro{editionsupscr}\printfield{year}}}%
}
%%% (year) -- inbook/incoll
\newbibmacro*{yearinbkcoll}{%
\mkbibparens{\printfield{year}}%
}
\newbibmacro*{reversed:author}{%
\printnames[reversed]{author}%
}
\newbibmacro*{reversed:editor}{%
\printnames[reversed]{editor}\addspace\mkbibparens{\usebibmacro{editorstrng}}%
}
\renewbibmacro*{in:}{%
\biblcstring{in}\intitlepunct%
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewbibmacro*{publisher+location+date}{%
\printlist{publisher}%
\iflistundef{publisher}%
{\setunit*{\addcomma\addspace}}%
{\setunit*{\addcolon\addspace}}%
\printlist{location}%
\setunit*{\addcomma\addspace}%
\usebibmacro{date}%
\newunit%
}
\renewbibmacro*{volume+number+eid}{%
\printfield{volume}%
% \setunit*{\adddot}%
\iffieldundef{number}{}{(\printfield{number})}%
\setunit{\addcomma\addspace}%
\printfield{eid}%
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Änderungen an Bibliography-Drivern %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% article: FERTIG
\DeclareBibliographyDriver{article}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/editor}\addspace%
\usebibmacro{editor+edition+year}\newunit\newblock%
\usebibmacro{title}\addcomma%
\newunit%
\usebibmacro{journal+issuetitle}%
\newunit%
\usebibmacro{pages+article}%
\usebibmacro{finentry}%
}
%%% book: FERTIG
\DeclareBibliographyDriver{book}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author/editor}\addspace%
\usebibmacro{editor+edition+year}\newunit\newblock%
\usebibmacro{maintitle+title}%
\newunit%
\iffieldundef{maintitle}%
{\printfield{volume}%
\printfield{part}}%
{}%
\newunit%
\printfield{volumes}%
\newunit\newblock%
\usebibmacro{series+number}%
\newunit\newblock%
\usebibmacro{publisher+location+date}%
\newunit\newblock%
\printfield{note}%
\usebibmacro{finentry}%
}
%%% inbook: work
\DeclareBibliographyDriver{inbook}{%
\usebibmacro{bibindex}%
\usebibmacro{begentry}%
\usebibmacro{author}\addspace%
\usebibmacro{yearinbkcoll}\newunit\newblock%
\usebibmacro{title}%
\newunit\newblock%
\usebibmacro{in:}%
\usebibmacro{reversed:editor}%
\newunit\newblock%
\usebibmacro{maintitle+booktitle}%
\newunit\newblock%
\usebibmacro{publisher+location+date}\adddot%
\printfield{pages}%
\printfield{note}%
\usebibmacro{finentry}%
}
\DeclareBibliographyAlias{incollection}{inbook}
\endinput
epicstructure.cbx:
\ProvidesFile{epicstructure.cbx}
[\abx@cbxid]
\ExecuteBibliographyOptions{labeldateparts,uniquename,uniquelist,autocite=inline}
\renewcommand*{\iffinalcitedelim}{\iflastcitekey}
\newbool{cbx:parens}
\newbibmacro*{cite}{%
\iffieldundef{shorthand}
{\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}}
{\usebibmacro{cite:label}%
\setunit{\printdelim{nonameyeardelim}}}
{\printnames[bibhyperref]{labelname}%
\setunit{\printdelim{nameyeardelim}}}%
\usebibmacro{cite:labeldate+extradate}}
{\usebibmacro{cite:shorthand}}}
\newbibmacro*{citeyear}{%
\iffieldundef{shorthand}
{\iffieldundef{labelyear}
{\usebibmacro{cite:label}}
{\usebibmacro{cite:labeldate+extradate}}}
{\usebibmacro{cite:shorthand}}}
\newbibmacro*{textcite}{%
\ifnameundef{labelname}
{\iffieldundef{shorthand}
{\usebibmacro{cite:label}%
\setunit{%
\global\booltrue{cbx:parens}%
\printdelim{nonameyeardelim}\bibopenparen}%
\ifnumequal{\value{citecount}}{1}
{\usebibmacro{prenote}}
{}%
\usebibmacro{cite:labeldate+extradate}}
{\usebibmacro{cite:shorthand}}}
{\printnames[bibhyperref]{labelname}%
\setunit{%
\global\booltrue{cbx:parens}%
\printdelim{nameyeardelim}\bibopenparen}%
\ifnumequal{\value{citecount}}{1}
{\usebibmacro{prenote}}
{}%
\usebibmacro{citeyear}}}
\newbibmacro*{cite:shorthand}{%
\printtext[bibhyperref]{\printfield{shorthand}}}
\newbibmacro*{cite:label}{%
\iffieldundef{label}
{\printtext[bibhyperref]{\printfield[citetitle]{labeltitle}}}
{\printtext[bibhyperref]{\printfield{label}}}}
\newbibmacro*{cite:labeldate+extradate}{%
\iffieldundef{labelyear}
{}
{\printtext[bibhyperref]{\usebibmacro{editionsupscr}\printlabeldateextra}}}
\newbibmacro{cite:labelyear+extrayear}{%
\blx@warning{bibmacro 'cite:labelyear+extrayear' is deprecated.\MessageBreak
Please use 'cite:labeldate+extradate'.\MessageBreak
Using 'cite:labeldate+extradate' instead}%
\usebibmacro{cite:labeldate+extradate}}
\newbibmacro*{textcite:postnote}{%
\iffieldundef{postnote}
{\ifbool{cbx:parens}
{\bibcloseparen}
{}}
{\ifbool{cbx:parens}
{\setunit{\postnotedelim}}
{\setunit{\extpostnotedelim\bibopenparen}}%
\printfield{postnote}\bibcloseparen}}
\DeclareCiteCommand{\cite}
{\usebibmacro{prenote}}%
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{\multicitedelim}
{\usebibmacro{postnote}}
\DeclareCiteCommand*{\cite}
{\usebibmacro{prenote}}%
{\usebibmacro{citeindex}%
\usebibmacro{citeyear}}
{\multicitedelim}
{\usebibmacro{postnote}}
\DeclareCiteCommand{\parencite}[\mkbibparens]
{\usebibmacro{prenote}}%
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{\multicitedelim}
{\usebibmacro{postnote}}
\DeclareCiteCommand*{\parencite}[\mkbibparens]
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{citeyear}}
{\multicitedelim}
{\usebibmacro{postnote}}
\DeclareCiteCommand{\footcite}%[\mkbibfootnote]
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{\multicitedelim}
{\usebibmacro{postnote}}
\DeclareCiteCommand{\footcitetext}[\mkbibfootnotetext]
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{\multicitedelim}
{\usebibmacro{postnote}}
\DeclareCiteCommand{\smartcite}[\iffootnote\mkbibparens\mkbibfootnote]
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{cite}}
{\multicitedelim}
{\usebibmacro{postnote}}
\DeclareCiteCommand{\textcite}
{\boolfalse{cbx:parens}}
{\usebibmacro{citeindex}%
\iffirstcitekey
{\setcounter{textcitetotal}{1}}
{\stepcounter{textcitetotal}%
\textcitedelim}%
\usebibmacro{textcite}}
{\ifbool{cbx:parens}
{\bibcloseparen\global\boolfalse{cbx:parens}}
{}}
{\usebibmacro{textcite:postnote}}
\DeclareCiteCommand{\citeauthor}
{\boolfalse{citetracker}%
\boolfalse{pagetracker}%
\usebibmacro{prenote}}
{\ifciteindex
{\indexnames{labelname}}
{}%
\printnames[bibhyperref]{labelname}}
{\multicitedelim}
{\usebibmacro{postnote}}
\DeclareCiteCommand*{\citeauthor}
{\boolfalse{citetracker}%
\boolfalse{pagetracker}%
\usebibmacro{prenote}}
{\ifciteindex
{\indexnames{labelname}}
{}%
\printnames[bibhyperref][1-1]{labelname}}
{\multicitedelim}
{\usebibmacro{postnote}}
\DeclareCiteCommand{\citeyear}
{\boolfalse{citetracker}%
\boolfalse{pagetracker}%
\usebibmacro{prenote}}
{\printfield[bibhyperref]{year}}
{\multicitedelim}
{\usebibmacro{postnote}}
\DeclareCiteCommand*{\citeyear}
{\boolfalse{citetracker}%
\boolfalse{pagetracker}%
\usebibmacro{prenote}}
{\printfield[bibhyperref]{\usebibmacro{editionsupscr}year}\printfield{extradate}}
{\multicitedelim}
{\usebibmacro{postnote}}
\DeclareMultiCiteCommand{\textcites}{\textcite}{}
\endinput

authorandeditorformats and simply using the optionsuseprefix=trueandgiveninits=true(and, I forgot,\DeclareNameAlias{sortname}{family-given})? – moewe Jun 29 '18 at 07:10