I´m creating a new bibliography style by customizing the standard.bbx file for my master thesis. So far I had no big troubles but now I want to adjust the macro series number since this should be in parentheses. Due to the lack of information I somtimes only have a seriesor the number.
So far it works out well, unless I only have the series. Then a space between the last word of the series and the closing parentheses appeares.
Here is my new macro
\newbibmacro*{series+number}{%
\iffieldundef{series}% Überprüfen ob series vorhanden
{}
{ \setunit{\addspace\bibopenparen}
\printtext{Reihe \addcolon\space}%
\printfield{series}
\iffieldundef{number} % Überprüfen ob noch Bd kommt
{\printtext{\bibcloseparen}}
{\setunit{\addcomma\space}}
}%
\iffieldundef{number}%
{}
{ \iffieldundef{series}%
{\setunit{\addspace\bibopenparen}}
{}
\printtext{Bd \adddot}
\printfield{number}%
\printtext{\bibcloseparen\space}
}
\newunit}
And here is the MWE
\RequirePackage{filecontents}
\begin{filecontents*}{my_bibfile.bib}
@incollection{Akyar.2008,
author = {Akyar, Bedia},
title = {Dual Quaternions in Spatial Kinematics in an Algebraic Sense},
pages = {373--391},
bookpagination = {page},
publisher = {T{\"u}bitak},
isbn = {1010-7622},
editor = {{Scientific and Technological Research Council of Turkey}},
booktitle = {Turkish journal of mathematics},
year = {2008},
abstract = {},
shorthand = {AKYA08},
location = {Ankara},
edition = {32},
number = {4}
}
@book{Angeles.2007,
author = {Angeles, Jorge},
year = {2007},
title = {Fundamentals of Robotic Mechanical Systems},
url = {http://site.ebrary.com/lib/alltitles/docDetail.action?docID=10229254},
edition = {Third Edition},
publisher = {{Springer Science+Business Media LLC}},
isbn = {0-387-29412-0},
subtitle = {Theory, Methods, and Algorithms},
shorthand = {ANGE07},
language = {eng},
location = {Boston, MA, USA},
series = {Mechanical Engineering Series},
abstract = {},
doi = {10.1007/978-0-387-34580-2},
file = {http://gso.gbv.de/DB=2.1/PPNSET?PPN=546653987},
file = {http://external.dandelon.com/download/attachments/dandelon/ids/DEAGI363052149B0CFDDDC125715B0045ACDA.pdf},
file = {http://zbmath.org/?q=an:1140.70001}
}
\end{filecontents*}
\documentclass[fleqn]{scrreprt}
\usepackage[scaled]{helvet}
\renewcommand{\familydefault}{\sfdefault}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[style=alphabetic, % Use this style
isbn=false,
doi=false,
url=false,
maxbibnames = 4,
minbibnames = 3,
language = ngerman,
giveninits=true]{biblatex}
\bibliography{my_bibfile}
\begin{document}
\nocite{*}
\printbibliography
\end{document}
The first reference only has a number (Here (Bd. 4)). The second has a series. But bevor the closing parentheses there is a unnecessary spacing.

Since you mentioned to use renewbibmacro I have a question about it in general. I also change some of the order and punctuation and want to create a new style. So I thouht of copy the standard file and adjust what I need so. I also read about to put it in the preamble. But for me this seems that I will kind of 'overload' it with the changes.
– Lars Feb 11 '18 at 19:13