使用“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 在我完全更新的系統biblatex(3.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或者,但可能不太安全,您可以從 CTANhttps://ctan.org/pkg/biblatex-nature) 並將 和 放到nature.bbx文件nature.cbx旁邊.tex。這可能會導致版本衝突,但意味著biblatex-nature如果它有效的話,您基本上將擁有更新版本。

順便說一句:@collection通常沒有作者,並且@incollection可以從中受益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 想要的,或者是風格中的錯誤。如果您可以根據自然指南仔細檢查輸出並將其報告為錯誤https://github.com/josephwright/biblatex-nature如果它看起來不正確,我們將不勝感激。

相關內容