在 biblatex-ext 中合并两个单独的 biblatex 字段

在 biblatex-ext 中合并两个单独的 biblatex 字段

我想连接 -item 的年份和页码incollection,以便在参考书目中将它们显示为一个单元。在另一种情况下(-item 中的期刊 + 页码article),我编写了一个新的bibmacro并在 bibliography-driver 的末尾替换了相关命令article。但是,使用提供的样式biblatex-ext,我不确定如何实现此策略。在另一个问题这让我使用biblatex-ext,我收到了这个代码:

\documentclass[ngerman]{article}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[backend=biber, style=ext-authoryear-ibid, citexref=true]{biblatex}

\usepackage{libertinus}

\begin{filecontents}{\jobname.bib}
@collection{EickerWolf2017,
  title    = {Ungleichheit in Deutschland – ein »gehyptes Problem«?},
  editor   = {Eicker-Wolf, Kai and Truger, Achim},
  location = {Marburg},
  year     = {2017},
}
@incollection{Schreiner2017,
  author   = {Schreiner, Patrick},
  title    = {Löhne und Verteilung},
  crossref = {EickerWolf2017},
  pages    = {47--78},
}
@incollection{Bosch2017,
  author   = {Bosch, Gerhard and Kalina, Thorsten},
  title    = {Die deutsche Mittelschicht aus der Arbeitsmarktperspektive},
  crossref = {EickerWolf2017},
  pages    = {111--142},
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
\cite{Bosch2017,Schreiner2017}
\printbibliography
\end{document}

对于父条目的简短引用,在给出编辑者姓名后,我想将年份和页码放在括号中,并用冒号和空格分隔 [2017, p.17–46 → (2017: 17–46)] 我会使用类似这样的内容:

\newbibmacro*{year+pages}{%
  \space\printtext[parens]{\printfield{year}: \printfield{pages}}%
  \newunit}

在浏览了代码biblatex-ext并从 moewe 那里得到了一些指点之后,我就是不知道应该把它放在哪里,因为涉及到交叉引用和各种切换。有人能给我提示吗?

答案1

您可以修改中的代码,biblatex-ext以便的页面引用xrefcite直接打印在引用命令的后记中,并使用\textcite

首先,我们必须从相关的 bibdrivers 中删除打印页面的 bibmacro。然后我们修改 bibmacro,crosscite以便它将pages字段传递给引用命令。

\documentclass[ngerman]{article}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[backend=biber, style=ext-authoryear-ibid, citexref=true]{biblatex}

\usepackage{libertinus}

\DeclareDelimFormat{postnotedelim}{\addcolon\space}
\DeclareFieldFormat{postnote}{\mknormrange{#1}}

\usepackage{xpatch}
\newcommand*{\removechapterpages}[1]{%
  \xpatchbibdriver{#1}
    {\newunit\newblock
     \usebibmacro{chapter+pages}}
    {}
    {}{}}
\removechapterpages{inbook}
\removechapterpages{incollection}
\removechapterpages{inproceedings}

\renewbibmacro*{crosscite}[1]{%
  \iftoggle{bbx:citexref}
    {\iffieldundef{crossref}
       {\iffieldundef{xref}
          {\usebibmacro{#1}%
           \newunit\newblock
           \usebibmacro{chapter+pages}}
          {\usebibmacro{xrefcitewithpages}{xref}}}
       {\usebibmacro{xrefcitewithpages}{crossref}}}
    {\usebibmacro{#1}%
     \newunit\newblock
     \usebibmacro{chapter+pages}}}

\makeatletter
\newbibmacro{xrefcitewithpages}[1]{%
  \printtext{%
    \iffieldundef{pages}
      {\bbx@xrefcite{\thefield{#1}}}
      {\expandafter\bbx@xrefcite\expandafter[\abx@field@pages]{\thefield{#1}}}}%
}

\renewcommand*{\bbx@xrefcite}{%
  \AtNextCite{%
    \boolfalse{citetracker}%
    \boolfalse{pagetracker}%
    \boolfalse{backtracker}}%
  \textcite}
\makeatother

\begin{filecontents}{\jobname.bib}
@collection{EickerWolf2017,
  title    = {Ungleichheit in Deutschland – ein »gehyptes Problem«?},
  editor   = {Eicker-Wolf, Kai and Truger, Achim},
  location = {Marburg},
  year     = {2017},
}
@incollection{Schreiner2017,
  author   = {Schreiner, Patrick},
  title    = {Löhne und Verteilung},
  crossref = {EickerWolf2017},
  pages    = {47--78},
}
@incollection{Bosch2017,
  author   = {Bosch, Gerhard and Kalina, Thorsten},
  title    = {Die deutsche Mittelschicht aus der Arbeitsmarktperspektive},
  crossref = {EickerWolf2017},
  pages    = {111--142},
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
\cite{Bosch2017,Schreiner2017}
\printbibliography
\end{document}

博世,Gerhard 和 Thorsten Kalina (2017)。 “从工人市场角度看德国劳动关系”。引自:Eicker-Wolf und Truger(2017:111–142)。

相关内容