Ошибка при использовании `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если это работает.

Кстати: @collectionу s обычно нет автора, и @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если что-то выглядит не так, это было бы полезно.

Связанный контент