# Comma too much when volumetitle given

After applying the fix from @moewe as seen in Missing comma when no volume/volumetitle given for books that have a volumetitle a double comma is printed. Please compare the MWE:

\documentclass[]{scrartcl}
\usepackage[ngerman]{babel}
\usepackage{filecontents}
\usepackage[]{jurabib}

\renewcommand*{\bibatsep}{,}

\makeatletter
\renewcommand*{\incolledformat}[5]{%
\bibBTsep{} %
\ifjb@edby
#3%
\ifx\relax#1\relax
\ifx\relax#5\relax\else
\ifx\relax#4\relax
\bibatsep{}%
\else
\bibatsep{}\space%
\fi
\fi
\else
\ifx\relax#5\relax
\unskip\unskip\unskip\unskip\unskip\unskip\space\Edbyname{} %
\else
\edbysep{}%
\Edbyname{} %
\fi
\begingroup
#1%
\endgroup
\fi
\ifx\relax#4\relax\else
\ifx\relax#1\relax\else
\ifx\relax#5\relax
.\space%
\else
\bibatsep{} %
\fi
\fi
\Volumename~#4%
\fi
\ifx\relax#1\relax
\ifx\relax#4\relax\else.\fi % volume empty
\else
\ifjbchicago\else.\fi
\fi
\fi
\else
\ifx\relax#1\relax\else
\begingroup
#1 % editor
\endgroup
\ifx\relax#2\relax\else#2\fi
\bothaesep%
\fi
#3%
\ifx\relax#4\relax
\unskip\bibatsep{} %<------ new https://tex.stackexchange.com/q/520741/35864
\else
\unskip %<------ new https://tex.stackexchange.com/q/450988/35864
\volumeformat{#4}%
\fi
\fi
}
\makeatother

\begin{filecontents}{\jobname.bib}
@INCOLLECTION{Althoff_Freiwilligkeit,
author     = {Gerd Althoff},
title      = {Freiwilligkeit und Konsensfassaden. Emotionale Ausdrucksformen in der Politik des Mittelalters},
booktitle  = {Pathos, Effekt, Gef\"uhl},
pages      = {S.\,145\,--\,161},
year       = {2004},
howcited   = {1},
}
@INCOLLECTION{Lehnswesen,
author = {Oliver Auge},
title = {Lehnrecht, Lehnswesen},
booktitle = {Hand\-w\"orterbuch zur Deutschen Rechtsgeschichte},
pages = {Sp.\,717\,--\,736},
year = {2016},
editor = {Albrecht Cordes and Hans-Peter Haferkamp and Heiner L\"uck and Dieter Werkm\"uller},
volume = {III},
shorttitle = {Lehnrecht, Lehnswesen in: HRG~III, 2.\,Auflage},
volumetitle = {Konfliktbew\"altigung\,--\,Nowgorod}
}
@INCOLLECTION{Huepper_PF,
author = {Dagmar H\"upper and Elvira Topalovic and Stephan Elspa\ss{}},
title = {Zur Entstehung und Entwicklung von Paarformeln im Deutschen},
shorttitle = {Paarformeln},
booktitle = {Phraseologie in Raum und Zeit},
editor = {Elisabeth Piirainen and Ilpo Tapani Piirainen},
year = {2002},
pages = {S.\,77\,--\,99},
}
\end{filecontents}
\begin{document}
Test\footcite{Althoff_Freiwilligkeit,Lehnswesen,Huepper_PF}.

\bibliography{\jobname}
\bibliographystyle{jurabib}
\end{document}


with the output:

What needs to be changed so that there is always one comma, never none and never one too much no matter if there is a volumetitle or not?

jurabib adds some punctuation directly via the .bst file and some punctuation in its LaTeX-side formatting macros. That can make it tricky to follow how exactly punctuation is produced.

I think I tracked down the different functions and macros for the punctuation here and managed to remove the undesirable double punctuation. But I can't guarantee that I haven't broken anything else (I can guarantee though that I only broke stuff related to my answer to Missing comma when no volume/volumetitle given, anything else should be unaffected).

It was necessary to recreate some tests for empty fields in \incolledformat, because the .bst file would not add a comma to the booktitle in very specific circumstances.

\documentclass[]{scrartcl}
\usepackage[ngerman]{babel}
\usepackage{filecontents}
\usepackage[]{jurabib}

\renewcommand*{\bibatsep}{,}

\makeatletter
\renewcommand*{\incolledformat}[5]{%
\bibBTsep{} %
\ifjb@edby
#3%
\ifx\relax#1\relax
\ifx\relax#5\relax\else
\ifx\relax#4\relax
\bibatsep{}%
\else
\bibatsep{}\space%
\fi
\fi
\else
\ifx\relax#5\relax
\unskip\unskip\unskip\unskip\unskip\unskip\space\Edbyname{} %
\else
\edbysep{}%
\Edbyname{} %
\fi
\begingroup
#1%
\endgroup
\fi
\ifx\relax#4\relax\else
\ifx\relax#1\relax\else
\ifx\relax#5\relax
.\space%
\else
\bibatsep{} %
\fi
\fi
\Volumename~#4%
\fi
\ifx\relax#1\relax
\ifx\relax#4\relax\else.\fi % volume empty
\else
\ifjbchicago\else.\fi
\fi
\fi
\else
\ifx\relax#1\relax\else
\begingroup
#1 % editor
\endgroup
\ifx\relax#2\relax\else#2\fi
\bothaesep %
\fi
#3%
\ifx\relax#4\relax
% START https://tex.stackexchange.com/q/522721/35864
\ifx\relax#1\relax
\ifx\relax#5\relax
\unskip\bibatsep{}
\fi
\fi
%  END  https://tex.stackexchange.com/q/522721/35864
\else
\unskip %<------ new https://tex.stackexchange.com/q/450988/35864
\volumeformat{#4}%
\fi
\fi
}
\makeatother

\begin{filecontents}{\jobname.bib}
@INCOLLECTION{Althoff_Freiwilligkeit,
author     = {Gerd Althoff},
title      = {Freiwilligkeit und Konsensfassaden. Emotionale Ausdrucksformen in der Politik des Mittelalters},
booktitle  = {Pathos, Effekt, Gef\"uhl},
pages      = {S.\,145\,--\,161},
year       = {2004},
howcited   = {1},
}
@INCOLLECTION{Lehnswesen,
author = {Oliver Auge},
title = {Lehnrecht, Lehnswesen},
booktitle = {Hand\-w\"orterbuch zur Deutschen Rechtsgeschichte},
pages = {Sp.\,717\,--\,736},
year = {2016},
editor = {Albrecht Cordes and Hans-Peter Haferkamp and Heiner L\"uck and Dieter Werkm\"uller},
volume = {III},
shorttitle = {Lehnrecht, Lehnswesen in: HRG~III, 2.\,Auflage},
volumetitle = {Konfliktbew\"altigung\,--\,Nowgorod}
}
@INCOLLECTION{Huepper_PF,
author = {Dagmar H\"upper and Elvira Topalovic and Stephan Elspa\ss{}},
title = {Zur Entstehung und Entwicklung von Paarformeln im Deutschen},
shorttitle = {Paarformeln},
booktitle = {Phraseologie in Raum und Zeit},
editor = {Elisabeth Piirainen and Ilpo Tapani Piirainen},
year = {2002},
pages = {S.\,77\,--\,99},
}
\end{filecontents}
\begin{document}
Test\footcite{Althoff_Freiwilligkeit,Lehnswesen,Huepper_PF}.

\bibliography{\jobname}
\bibliographystyle{jurabib}
\end{document}


• Just as a warning to future visitors: As far as I am aware jurabib is virtually unmaintained at the moment (it was last updated almost 16 years ago) and has (now) a very small user base. I find jurabib fascinating because it played an important role in the evolution of biblatex (in my opinion and to my knowledge at least). Furthermore, it can be customised in ways and has features many BibTeX styles can only dream of. ... – moewe Jan 3 at 14:25
• ... But it appears to be a very complex beast. Its structure and the entire code setup make it extremely hard to modify things for which there is no simple interface. Especially the shared responsibility between .bst file and LaTeX macros for (light) formatting make things hard to understand. (biblatex got more radical there: all formatting is done on the LaTeX side. The BibTeX/Biber side only provides the almost raw data.) Unless jurabib appears to give you exactly what you need, you may want to look for an alternative. – moewe Jan 3 at 14:28
• Thanks @moewe, your fix works and it seems in my document it has no negative side effects. However I agree with your comment, jurabib in its current state has to be taken with a grain of salt! – TobiBS Jan 4 at 3:50
• +1 for the remarks in the comment and the detective work in the answer. – Dr. Manuel Kuehner Jan 4 at 14:59