给出卷标题时逗号太多

给出卷标题时逗号太多

应用@moewe 的修复后,如下所示未提供卷/卷标题时缺少逗号对于有卷名的书籍,会打印双逗号。请比较 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
            \ifjb@humanbst@loaded\edbysep{}\fi
            \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
      \ifjb@humanbst@loaded\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
      \ifx\relax#5\relax\space\else,\space\fi% volume and booktitleaddon
      \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},
  address    = {Berlin},
  howcited   = {1},
  shorttitle = {Freiwilligkeit und Konsensfassaden}
}
@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},
  address = {Berlin},
  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},
  address = {Baltmannsweiler}
}
\end{filecontents}
\begin{document}
Test\footcite{Althoff_Freiwilligkeit,Lehnswesen,Huepper_PF}.

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

输出为: 在此处输入图片描述

需要进行哪些更改以便无论是否有卷标题,总是有一个逗号,而不会没有逗号并且不会多一个逗号?

答案1

jurabib直接通过.bst文件添加一些标点符号,并在其 LaTeX 端格式化宏中添加一些标点符号。这可能会使理解标点符号的产生方式变得棘手。

我认为我已找到此处标点符号的不同函数和宏,并设法删除了不受欢迎的双标点符号。但我不能保证我没有破坏其他任何东西(但我可以保证我只破坏了与我的答案相关的内容未提供卷/卷标题时缺少逗号,其他任何事情都不应受到影响)。

有必要对中的空字段重新创建一些测试\incolledformat,因为在非常特殊的情况下.bst文件不会在中添加逗号booktitle

\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
            \ifjb@humanbst@loaded\edbysep{}\fi
            \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
      \ifjb@humanbst@loaded\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
      \ifx\relax#5\relax\space\else,\space\fi% volume and booktitleaddon
      \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},
  address    = {Berlin},
  howcited   = {1},
  shorttitle = {Freiwilligkeit und Konsensfassaden}
}
@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},
  address = {Berlin},
  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},
  address = {Baltmannsweiler}
}
\end{filecontents}
\begin{document}
Test\footcite{Althoff_Freiwilligkeit,Lehnswesen,Huepper_PF}.

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

Althoff,Gerd:自由和意识。中产阶级政治中的情感表达形式,关于情感、效果和困境,柏林,2004 年,第 145-161 页,Oliver:Lehnrecht、Lehnswesen、In Cordes、Albrecht 等。 (Hrsg.):德语法律史手册,第 III 组,冲突与和解–诺夫哥罗德,柏林,2016 年,第 717–736 版//Hüpper,Dagmar/Topalovic,Elvira/Elspaß,Stephan:德语伴侣形式的起源与发展,In Piirainen, Elisabeth/Piirainen, Ilpo Tapani (Hrsg.):《空间与时间的短语学》,Baltmannsweiler,2002 年,第 77–99 页

相关内容