biblatex-musuos:使用 crossref 将版本作为年份前的上标

biblatex-musuos:使用 crossref 将版本作为年份前的上标

我有一个与此相关的问题:biblatex-verbose:版本作为年份前面的上标

我正在使用biblatex-musuos,该解决方案也适用于它,但仅适用于普通条目。使用 crossref 的子条目没有上标。让我困惑的是,它适用于 中的父条目和子条目biblatex-verbose。但musuosverbose都需要authortitle样式,我无法分辨出musuos哪些不同之处可能会阻止它工作。 中的 incollection-bibliography 驱动程序musuos看起来与 基本相同standard,我不知道还有什么会影响这一点。我该怎么做才能让它在 中工作musuos?(如果我遗漏了一些非常明显的东西,我深表歉意。)

这是我使用 得到的结果musuos。如果您将 MWE 中的样式更改为verbose它看起来就像应该的那样,在两年之前都有上标。

在此处输入图片描述

MWE(与带有评论的链接问题相比有微小的变化):

\documentclass{article}
\usepackage{filecontents}

\begin{filecontents}{bibliography.bib}
@mvcollection{parent,
    editor = {Editor, Edith},
    title = {Collectiontitle},
    location = {Somewhere},
    date = {2000},
    edition = {2},
    volume = {1},
}
@InCollection{child,
  author   = {Author, Alf},
  title    = {Title},
  crossref = {parent},
}
\end{filecontents}

\usepackage[style=musuos,backend=biber]{biblatex}
\usepackage{xpatch}
\addbibresource{bibliography.bib}

\DeclareFieldFormat{edition}{%
  \ifinteger{#1}
    {\ifnumcomp{#1}={1}{}% Only use for integers >1
      {\textsuperscript{#1}}}
    {#1\isdot\setunit{\addcomma\space}}}

\renewbibmacro*{publisher+location+date}{%
  \printlist{location}%
  \iflistundef{publisher}
    {\setunit*{\addspace}}% changed from \addcomma\space
    {\setunit*{\addcomma\space}}% changed from \addcolon\space
  \printlist{publisher}%
  \setunit*{\addspace}% changed from \addcomma\space
  \iffieldint{edition}{%
    \printfield{edition}}{}%
  \usebibmacro{date}%
  \newunit}
    
\newcommand{\editedition}[1]{%
  \xpatchbibdriver{#1}
    {\printfield{edition}%
     \newunit}
    {\iffieldint{edition}{}{%
      \printfield{edition}%
      \newunit}}%
    {}
    {\typeout{failed to patch driver #1}}
}
\editedition{book}
\editedition{collection}
\editedition{inbook}
\editedition{incollection}
\editedition{manual}

\begin{document}

\nocite{parent}
\nocite{child}

\printbibliography

\end{document}

答案1

由于我不是特别清楚的原因,它的驱动程序中biblatex-musuos没有使用 bibmacro ,而是使用。publisher+location+date@incollectionlocation+date

我们将必须重新定义location+date类似于publisher+location+date

\documentclass{article}

\usepackage[style=musuos,backend=biber]{biblatex}
\usepackage{xpatch}

\DeclareFieldFormat{edition}{%
  \ifinteger{#1}
    {\ifnumcomp{#1}={1}{}% Only use for integers >1
      {\textsuperscript{#1}}}
    {#1\isdot\setunit{\addcomma\space}}}

\renewbibmacro*{publisher+location+date}{%
  \printlist{location}%
  \iflistundef{publisher}
    {\setunit*{\addspace}}% changed from \addcomma\space
    {\setunit*{\addcomma\space}}% changed from \addcolon\space
  \printlist{publisher}%
  \setunit*{\addspace}% changed from \addcomma\space
  \iffieldint{edition}{%
    \printfield{edition}}{}%
  \usebibmacro{date}%
  \newunit}

\renewbibmacro*{location+date}{%
  \printlist{location}%
  \setunit*{\addcomma\space}%
  \iffieldint{edition}{%
    \printfield{edition}}{}%
  \usebibmacro{cite:labelyear+extrayear}%
  \newunit}
    
\newcommand{\editedition}[1]{%
  \xpatchbibdriver{#1}
    {\printfield{edition}%
     \newunit}
    {\iffieldint{edition}{}{%
      \printfield{edition}%
      \newunit}}%
    {}
    {\typeout{failed to patch driver #1}}
}
\editedition{book}
\editedition{collection}
\editedition{inbook}
\editedition{incollection}
\editedition{manual}

\begin{filecontents}{\jobname.bib}
@mvcollection{parent,
    editor = {Editor, Edith},
    title = {Collectiontitle},
    location = {Somewhere},
    date = {2000},
    edition = {2},
    volume = {1},
}
@InCollection{child,
  author   = {Author, Alf},
  title    = {Title},
  crossref = {parent},
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}

\nocite{parent}
\nocite{child}

\printbibliography

\end{document}

作者,Alf:标题。在:合集标题。第 1 卷。Edith 编辑。Somewhere,2 2000。

相关内容