首页 > 解决方案 > Biblatex:网站引用为斜体,删除“nd”时使用标题而不是作者

问题描述

我正在尝试使用带有 BibLaTeX 的 authoryear 风格引用一个网站。

\documentclass{article}
\usepackage[utf8]{inputenc}

\begin{filecontents}{ref.bib}
@online{nanopore,
    author    = "{Oxford Nanopore Technologies}",
    title     = "Oxford Nanopore Technologies Github",
    url       = "https://github.com/nanoporetech"
}
\end{filecontents}


\usepackage[
backend=biber,
style=authoryear,
sorting=nyt,
citestyle=authoryear,
maxbibnames=99
]{biblatex}

\addbibresource{ref.bib}

\begin{document}

\parencite{nanopore}

\end{document}

这给了我

此引文

这很好,除了我想删除“nd”,所以我这样做是为了删除它:

\DeclareLabeldate[online]{%
  \field{date}
  \field{year}
  \field{eventdate}
  \field{origdate}
  \field{urldate}
}

然后我的引文发生了变化,所以 1)它打印的是标题而不是作者,2)引文是斜体的(这可能是因为它打印的是标题而不是作者)。

使用标题而不是作者的斜体引文

知道为什么会发生这种情况以及如何防止它吗?

提前致谢!

编辑:添加空间的图片链接对于@samcarter_is_at_topanswers.xyz

标签: latexcitationsbiblatex

解决方案


您可以更改在线类型的“nd”的翻译:

\documentclass{article}
\usepackage[utf8]{inputenc}

\begin{filecontents}{ref.bib}
@online{nanopore,
    author    = "{Oxford Nanopore Technologies}",
    title     = "Oxford Nanopore Technologies Github",
    url       = "https://github.com/nanoporetech"
}
\end{filecontents}


\usepackage[
backend=biber,
style=authoryear,
sorting=nyt,
citestyle=authoryear,
maxbibnames=99,
]{biblatex}

\DefineBibliographyStrings{english}{%
nodate = {\ifboolexpr{test{\ifentrytype{online}}}{\unspace}{n\adddot d\adddot}},
}

\addbibresource{ref.bib}

\begin{document}

\parencite{nanopore}

\end{document}

在此处输入图像描述


推荐阅读