使用“intitle”显示带有“biblatex-nature”的章节标题时出错

使用“intitle”显示带有“biblatex-nature”的章节标题时出错

我用biblatex-nature它来格式化论文的参考书目,到目前为止一切顺利,只是我希望它显示@incollection参考文献的章节标题,而默认情况下它不会显示。我在其他地方发现建议intitle在 biblatex 包调用中添加选项可以让它做到这一点,但当我尝试这样做时,我得到了一个! Package keyval Error: intitle undefined.错误。

有人能建议这里出了什么问题吗,或者有其他方法可以将章节标题包含在我的参考文献中吗?

这是我的 MWE 文件:

@collection{hsu2015pathogen,
  title={Pathogen-Host Interactions: Antigenic Variation V. Somatic Adaptations},
  author={Hsu, Ellen and Du Pasquier, Louis},
  volume={57},
  year={2015},
  publisher={Springer}
}

@incollection{jack2015evolution,
    series = {Results and {Problems} in {Cell} {Differentiation}},
    title = {Evolution of {Immunity} and {Pathogens}},
    indextitle = {Evolution of {Immunity} and {Pathogens}},
    url = {https://doi.org/10.1007/978-3-319-20819-0_1},
    urldate = {2019-02-27},
    booktitle = {Pathogen-{Host} {Interactions}: {Antigenic} {Variation} v. {Somatic} {Adaptations}},
    publisher = {Springer},
    author = {Jack, Robert S.},
    editor = {Hsu, Ellen and Du Pasquier, Louis},
    year = {2015},
    doi = {10.1007/978-3-319-20819-0_1},
    pages = {1--20}
}
\documentclass{article}

\RequirePackage[backend=biber, citestyle=numeric-comp, style=nature,
  sorting=none, natbib=true, maxnames=3, minnames=1, url=false,
  giveninits=true, sortcites=true, date=year,
  doi=false,isbn=false,intitle=false]{biblatex}

\bibliography{mwe}

\begin{document}
\parencite{jack2015evolution} is a chapter in \parencite{hsu2015pathogen}.

\printbibliography[heading=bibintoc, title={References}]
\end{document}

答案1

该选项intitle已添加到biblatex-naturev1.2i/v1.3 (2016-10-23)。MWE 在我完全更新的系统(biblatex3.12、Biber 2.12 和biblatex-naturev1.3c)上运行良好。如果您收到错误,那一定是因为您的版本biblatex-nature太旧。如果可能,请更新您的整个 TeX 发行版。

如果由于您使用权限受限或 Overleaf 的工作计算机而无法做到这一点,最安全的方法是重写驱动程序,类似于https://github.com/josephwright/biblatex-nature/commit/0a58f60bb385e8f8c383d156434470649840dc99

\documentclass{article}

\RequirePackage[backend=biber, style=nature,
  maxnames=3, minnames=1, url=false,
  giveninits=true, sortcites=true, date=year,
  doi=false, isbn=false]{biblatex}

\providetoggle{bbx:intitle}
\toggletrue{bbx:intitle}

\DeclareBibliographyDriver{inbook}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/translator+others}%
  \setunit{\labelnamepunct}\newblock
  \printlist{language}%
  \newunit\newblock
  \usebibmacro{byauthor}%
  \newunit\newblock
  \iftoggle{bbx:intitle}
    {%
      \usebibmacro{title}%
      \newblock
    }
    {}%
  \usebibmacro{in:}%
  \usebibmacro{bybookauthor}%
  \setunit*{\newunitpunct}\newblock
  \usebibmacro{maintitle+booktitle}%
  \newunit\newblock
  \usebibmacro{byeditor+others}%
  \newunit\newblock
  \printfield{edition}%
  \newunit
  \printfield{volumes}%
  \newunit\newblock
  \usebibmacro{series+number}%
  \newunit\newblock
  \printfield{note}%
  \newunit\newblock
  \usebibmacro{chapter+pages}%
  \newunit\newblock
  \usebibmacro{publisher+location+date}%
  \newunit\newblock
  \iftoggle{bbx:isbn}
    {\printfield{isbn}}
    {}%
  \newunit\newblock
  \usebibmacro{doi+eprint+url}%
  \newunit\newblock
  \usebibmacro{addendum+pubstate}%
  \setunit{\bibpagerefpunct}\newblock
  \usebibmacro{pageref}%
  \newunit\newblock
  \usebibmacro{related}%
  \usebibmacro{finentry}%
}

\DeclareBibliographyDriver{incollection}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/translator+others}%
  \setunit{\labelnamepunct}\newblock
  \printlist{language}%
  \newunit\newblock
  \usebibmacro{byauthor}%
  \newunit\newblock
  \iftoggle{bbx:intitle}
    {%
      \usebibmacro{title}%
      \newblock
    }
    {}%
  \usebibmacro{in:}%
  \usebibmacro{maintitle+booktitle}%
  \newunit\newblock
  \usebibmacro{byeditor+others}%
  \newunit\newblock
  \printfield{edition}%
  \newunit
  \printfield{volumes}%
  \newunit\newblock
  \usebibmacro{series+number}%
  \newunit\newblock
  \printfield{note}%
  \newunit\newblock
  \usebibmacro{chapter+pages}%
  \newunit\newblock
  \usebibmacro{publisher+location+date}%
  \newunit\newblock
  \iftoggle{bbx:isbn}
    {\printfield{isbn}}
    {}%
  \newunit\newblock
  \usebibmacro{doi+eprint+url}%
  \newunit\newblock
  \usebibmacro{addendum+pubstate}%
  \setunit{\bibpagerefpunct}\newblock
  \usebibmacro{pageref}%
  \newunit\newblock
  \usebibmacro{related}%
  \usebibmacro{finentry}%
}


\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@collection{hsu2015pathogen,
  title={Pathogen-Host Interactions: Antigenic Variation V. Somatic Adaptations},
  author={Hsu, Ellen and Du Pasquier, Louis},
  volume={57},
  year={2015},
  publisher={Springer}
}

@incollection{jack2015evolution,
    series = {Results and {Problems} in {Cell} {Differentiation}},
    title = {Evolution of {Immunity} and {Pathogens}},
    indextitle = {Evolution of {Immunity} and {Pathogens}},
    url = {https://doi.org/10.1007/978-3-319-20819-0_1},
    urldate = {2019-02-27},
    booktitle = {Pathogen-{Host} {Interactions}: {Antigenic} {Variation} v. {Somatic} {Adaptations}},
    publisher = {Springer},
    author = {Jack, Robert S.},
    editor = {Hsu, Ellen and Du Pasquier, Louis},
    year = {2015},
    doi = {10.1007/978-3-319-20819-0_1},
    pages = {1--20}
}
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}
\parencite{jack2015evolution} is a chapter in \parencite{hsu2015pathogen}.

\printbibliography[heading=bibintoc]
\end{document}

biblatex-nature另外,但可能不太安全,您可以从 CTAN获取当前版本(https://ctan.org/pkg/biblatex-nature) 并将nature.bbx和拖放到文件nature.cbx旁边。这可能会导致版本冲突,但如果它有效,则.tex意味着您实际上将拥有更新的版本。biblatex-nature

顺便说一句:@collections 通常没有作者,@incollections 可以从中受益crossref,所以我会让条目看起来像

@collection{hsu2015pathogen,
  title     = {Pathogen-Host Interactions: Antigenic Variation v. Somatic Adaptations},
  editor    = {Hsu, Ellen and Du Pasquier, Louis},
  series    = {Results and Problems in Cell Differentiation},
  number    = {57},
  year      = {2015},
  publisher = {Springer},
}
@incollection{jack2015evolution,
  title      = {Evolution of Immunity and Pathogens},
  author     = {Jack, Robert S.},
  doi        = {10.1007/978-3-319-20819-0_1},
  pages      = {1--20},
  crossref   = {hsu2015pathogen},
}

不幸的是,输出结果并不像我希望的那样,但我不确定这是 Nature 想要的结果还是样式上的错误。如果您可以根据 Nature 指南仔细检查输出结果,并将其报告为错误,请发送至https://github.com/josephwright/biblatex-nature如果看起来不正确,我们将不胜感激。

相关内容